Fix nonce 0 check (#1941)

This commit is contained in:
Daniel Sanchez 2021-02-23 20:06:49 +01:00 committed by GitHub
parent 9b2dd8141c
commit ac920f0361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -80,11 +80,7 @@ export const createTransaction = (
const safeInstance = await getGnosisSafeInstanceAt(safeAddress)
const lastTx = await getLastTx(safeAddress)
const nextNonce = await getNewTxNonce(lastTx, safeInstance)
let nonce = nextNonce
if (txNonce !== undefined) {
nonce = txNonce.toString()
}
const nonce = txNonce !== undefined ? txNonce.toString() : nextNonce
const isExecution = await shouldExecuteTransaction(safeInstance, nonce, lastTx)
const safeVersion = await getCurrentSafeVersion(safeInstance)

View File

@ -88,11 +88,10 @@ export const useTransactionParameters = (props?: Props): TxParameters => {
}
}
const safeNonce = Number(props?.initialSafeNonce || 0)
if (safeNonce === undefined) {
getSafeNonce()
}
}, [safeAddress, props?.initialSafeNonce])
}, [safeAddress, safeNonce])
return {
safeNonce,