diff --git a/src/logic/safe/utils/updateSafe.js b/src/logic/safe/utils/upgradeSafe.js similarity index 93% rename from src/logic/safe/utils/updateSafe.js rename to src/logic/safe/utils/upgradeSafe.js index f01c8015..51524e97 100644 --- a/src/logic/safe/utils/updateSafe.js +++ b/src/logic/safe/utils/upgradeSafe.js @@ -10,7 +10,7 @@ import type { MultiSendTransactionInstanceType } from '~/logic/contracts/safeCon import { DELEGATE_CALL } from '~/logic/safe/transactions' import { getWeb3 } from '~/logic/wallets/getWeb3' -export const upgradeSafeToLastVersion = async (safeAddress: string, createTransaction: Function) => { +export const upgradeSafeToLatestVersion = async (safeAddress: string, createTransaction: Function) => { const sendTransactions = async (txs: Array) => { const web3 = getWeb3() const encodeMultiSendCallData = getEncodedMultiSendCallData(txs, web3) @@ -35,13 +35,13 @@ export const upgradeSafeToLastVersion = async (safeAddress: string, createTransa operation: 0, to: safeAddress, value: 0, - data: fallbackHandlerTxData, + data: updateSafeTxData, }, { operation: 0, to: safeAddress, value: 0, - data: updateSafeTxData, + data: fallbackHandlerTxData, }, ] return sendTransactions(txs) diff --git a/src/routes/safe/components/Settings/UpdateSafeModal/index.jsx b/src/routes/safe/components/Settings/UpdateSafeModal/index.jsx index e98f6e8e..de77f8c8 100644 --- a/src/routes/safe/components/Settings/UpdateSafeModal/index.jsx +++ b/src/routes/safe/components/Settings/UpdateSafeModal/index.jsx @@ -10,7 +10,7 @@ import GnoForm from '~/components/forms/GnoForm' import Block from '~/components/layout/Block' import Button from '~/components/layout/Button' import { styles } from './style' -import { upgradeSafeToLastVersion } from '~/logic/safe/utils/updateSafe' +import { upgradeSafeToLatestVersion } from '~/logic/safe/utils/upgradeSafe' type Props = { onClose: Function, @@ -22,7 +22,7 @@ type Props = { const UpdateSafeModal = ({ onClose, classes, safeAddress, createTransaction }: Props) => { const handleSubmit = async () => { // Call the update safe method - await upgradeSafeToLastVersion(safeAddress, createTransaction) + await upgradeSafeToLatestVersion(safeAddress, createTransaction) onClose() } diff --git a/src/test/safe.dom.upgrade.test.js b/src/test/getEncodedMultiSendCallData.test.js similarity index 87% rename from src/test/safe.dom.upgrade.test.js rename to src/test/getEncodedMultiSendCallData.test.js index a0290671..4c1ea0ff 100644 --- a/src/test/safe.dom.upgrade.test.js +++ b/src/test/getEncodedMultiSendCallData.test.js @@ -21,16 +21,16 @@ describe('Upgrade a Safe', () => { operation: 0, to: safeAddress, value: 0, - data: fallbackHandlerTxData, + data: updateSafeTxData, }, { operation: 0, to: safeAddress, value: 0, - data: updateSafeTxData, + data: fallbackHandlerTxData, }, ] - const expectedEncodedData = '0x8d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f08a0323000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf44000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247de7edef00000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f0000000000000000000000000000' + const expectedEncodedData = '0x8d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247de7edef00000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f08a0323000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000' const multiSendTxData = getEncodedMultiSendCallData(txs, web3) expect(multiSendTxData).toEqual(expectedEncodedData) })