* Fix how the nonce of the cancel transaction is calculated * make use useState to handle nonce state * fix to prevent "0" being treated as undefined Co-authored-by: nicolas <nicosampler@users.noreply.github.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
This commit is contained in:
parent
8e52ec5f60
commit
5665d69145
|
@ -80,7 +80,12 @@ export const createTransaction = (
|
|||
const safeInstance = await getGnosisSafeInstanceAt(safeAddress)
|
||||
const lastTx = await getLastTx(safeAddress)
|
||||
const nextNonce = await getNewTxNonce(lastTx, safeInstance)
|
||||
const nonce = txNonce ? txNonce.toString() : nextNonce
|
||||
|
||||
let nonce = nextNonce
|
||||
if (txNonce !== undefined) {
|
||||
nonce = txNonce.toString()
|
||||
}
|
||||
|
||||
const isExecution = await shouldExecuteTransaction(safeInstance, nonce, lastTx)
|
||||
const safeVersion = await getCurrentSafeVersion(safeInstance)
|
||||
let safeTxGas
|
||||
|
|
|
@ -89,7 +89,7 @@ export const useTransactionParameters = (props?: Props): TxParameters => {
|
|||
}
|
||||
|
||||
const safeNonce = Number(props?.initialSafeNonce || 0)
|
||||
if (!safeNonce) {
|
||||
if (safeNonce === undefined) {
|
||||
getSafeNonce()
|
||||
}
|
||||
}, [safeAddress, props?.initialSafeNonce])
|
||||
|
|
Loading…
Reference in New Issue