Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

fix: add set/deleteGuard #3645

Merged
merged 5 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@gnosis.pm/safe-core-sdk": "^2.0.0",
"@gnosis.pm/safe-deployments": "^1.8.0",
"@gnosis.pm/safe-react-components": "^0.9.8",
"@gnosis.pm/safe-react-gateway-sdk": "^2.10.0",
"@gnosis.pm/safe-react-gateway-sdk": "^2.10.1",
"@gnosis.pm/safe-web3-lib": "^1.0.0",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.0",
Expand Down
2 changes: 2 additions & 0 deletions src/logic/safe/store/models/types/gateway.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
TransactionListItem,
TransactionListPage,
TransactionStatus,
TransactionInfo,
SettingsChange,
} from '@gnosis.pm/safe-react-gateway-sdk'

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const TxInfo = ({ info, name }: { info: AssetInfo; name?: string }) => {
case 'SWAP_OWNER':
case 'CHANGE_THRESHOLD':
case 'CHANGE_IMPLEMENTATION':
case 'SET_GUARD':
case 'DELETE_GUARD':
break
case 'ENABLE_MODULE':
case 'DISABLE_MODULE':
Expand Down
18 changes: 16 additions & 2 deletions src/routes/safe/components/Transactions/TxList/TxInfoSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SettingsChange } from '@gnosis.pm/safe-react-gateway-sdk'
import { SettingsChange, SettingsInfo } from '@gnosis.pm/safe-react-gateway-sdk'
import { ReactElement } from 'react'

import { AddressInfo } from './AddressInfo'
Expand Down Expand Up @@ -85,7 +85,21 @@ export const TxInfoSettings = ({ settingsInfo }: TxInfoSettingsProps): ReactElem
</InfoDetails>
)
}
case 'SET_GUARD': {
return (
<InfoDetails title="Set guard:">
<AddressInfo
address={settingsInfo.guard.value}
name={settingsInfo.guard?.name || undefined}
avatarUrl={settingsInfo.guard?.logoUri || undefined}
/>
</InfoDetails>
)
}
case 'DELETE_GUARD': {
return <InfoDetails title="Delete guard">{null}</InfoDetails>
katspaugh marked this conversation as resolved.
Show resolved Hide resolved
}
default:
return null
return <InfoDetails title={(settingsInfo as SettingsInfo).type}>{null}</InfoDetails>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const useTransactionType = (tx: Transaction): TxTypeProps => {
break
}
case 'SettingsChange': {
setType({ icon: SettingsTxIcon, text: tx.txInfo.dataDecoded.method })
// deleteGuard doesn't exist in Solidity
// It is decoded as 'setGuard' with a settingsInfo.type of 'DELETE_GUARD'
const isDeleteGuard = tx.txInfo.settingsInfo?.type === 'DELETE_GUARD'
setType({ icon: SettingsTxIcon, text: isDeleteGuard ? 'deleteGuard' : tx.txInfo.dataDecoded.method })
break
}
case 'Custom': {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1965,10 +1965,10 @@
react-media "^1.10.0"
web3-utils "^1.6.0"

"@gnosis.pm/safe-react-gateway-sdk@^2.10.0":
version "2.10.0"
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-react-gateway-sdk/-/safe-react-gateway-sdk-2.10.0.tgz#88e2307d21d548ea43dde8fa33630d3539e39741"
integrity sha512-P0A6XgjpEwCzZpk0vjLOYuaOmXL020khJF9FQRwCYPrllPUzrGjpm5gdqExNdnefrrDUKeWUumkucoXqBaMblA==
"@gnosis.pm/safe-react-gateway-sdk@^2.10.1":
version "2.10.1"
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-react-gateway-sdk/-/safe-react-gateway-sdk-2.10.1.tgz#62f4abf733855e734aa1eab4be4778ccd08fe689"
integrity sha512-uIosTEqmoxhCy7WS8sIzXde2nJQwzC+KfNoeDQVeLZtEpnRZQ7R+N/qDtORMUJfKeyc8cIwkKXmVc2DRgSRxOQ==
dependencies:
cross-fetch "^3.1.5"

Expand Down