Fix gas calculation error when confirming tx because of the modal premount, improve cancelled tx detection
This commit is contained in:
parent
75d37a5f39
commit
0dd2ad5f5d
|
@ -21,7 +21,7 @@ export const estimateTxGasCosts = async (
|
|||
const nonce = await safeInstance.methods.nonce().call()
|
||||
const threshold = await safeInstance.methods.getThreshold().call()
|
||||
|
||||
const isExecution = (tx && tx.confirmations.size === threshold) || preApprovingOwner || threshold === '1'
|
||||
const isExecution = (tx && tx.confirmations.size === threshold) || !!preApprovingOwner || threshold === '1'
|
||||
|
||||
let txData
|
||||
if (isExecution) {
|
||||
|
|
|
@ -123,16 +123,18 @@ const ExpandedTx = ({
|
|||
tx={tx}
|
||||
safeAddress={safeAddress}
|
||||
/>
|
||||
<ApproveTxModal
|
||||
isOpen={openModal === 'approveTx'}
|
||||
processTransaction={processTransaction}
|
||||
onClose={closeModal}
|
||||
tx={tx}
|
||||
userAddress={userAddress}
|
||||
safeAddress={safeAddress}
|
||||
threshold={threshold}
|
||||
thresholdReached={thresholdReached}
|
||||
/>
|
||||
{openModal === 'approveTx' && (
|
||||
<ApproveTxModal
|
||||
isOpen
|
||||
processTransaction={processTransaction}
|
||||
onClose={closeModal}
|
||||
tx={tx}
|
||||
userAddress={userAddress}
|
||||
safeAddress={safeAddress}
|
||||
threshold={threshold}
|
||||
thresholdReached={thresholdReached}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -115,8 +115,9 @@ const extendedTransactionsSelector: Selector<GlobalState, RouterProps, List<Tran
|
|||
let replacementTransaction
|
||||
if (!tx.isExecuted) {
|
||||
replacementTransaction = transactions.findLast(
|
||||
(transaction) => transaction.nonce === tx.nonce
|
||||
&& isAfter(parseISO(transaction.submissionDate), parseISO(tx.submissionDate)),
|
||||
(transaction) => (transaction.nonce === tx.nonce
|
||||
&& isAfter(parseISO(transaction.submissionDate), parseISO(tx.submissionDate)))
|
||||
|| transaction.nonce > tx.nonce,
|
||||
)
|
||||
if (replacementTransaction) {
|
||||
extendedTx = tx.set('cancelled', true)
|
||||
|
|
Loading…
Reference in New Issue