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 nonce = await safeInstance.methods.nonce().call()
|
||||||
const threshold = await safeInstance.methods.getThreshold().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
|
let txData
|
||||||
if (isExecution) {
|
if (isExecution) {
|
||||||
|
|
|
@ -123,8 +123,9 @@ const ExpandedTx = ({
|
||||||
tx={tx}
|
tx={tx}
|
||||||
safeAddress={safeAddress}
|
safeAddress={safeAddress}
|
||||||
/>
|
/>
|
||||||
|
{openModal === 'approveTx' && (
|
||||||
<ApproveTxModal
|
<ApproveTxModal
|
||||||
isOpen={openModal === 'approveTx'}
|
isOpen
|
||||||
processTransaction={processTransaction}
|
processTransaction={processTransaction}
|
||||||
onClose={closeModal}
|
onClose={closeModal}
|
||||||
tx={tx}
|
tx={tx}
|
||||||
|
@ -133,6 +134,7 @@ const ExpandedTx = ({
|
||||||
threshold={threshold}
|
threshold={threshold}
|
||||||
thresholdReached={thresholdReached}
|
thresholdReached={thresholdReached}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,8 +115,9 @@ const extendedTransactionsSelector: Selector<GlobalState, RouterProps, List<Tran
|
||||||
let replacementTransaction
|
let replacementTransaction
|
||||||
if (!tx.isExecuted) {
|
if (!tx.isExecuted) {
|
||||||
replacementTransaction = transactions.findLast(
|
replacementTransaction = transactions.findLast(
|
||||||
(transaction) => transaction.nonce === tx.nonce
|
(transaction) => (transaction.nonce === tx.nonce
|
||||||
&& isAfter(parseISO(transaction.submissionDate), parseISO(tx.submissionDate)),
|
&& isAfter(parseISO(transaction.submissionDate), parseISO(tx.submissionDate)))
|
||||||
|
|| transaction.nonce > tx.nonce,
|
||||||
)
|
)
|
||||||
if (replacementTransaction) {
|
if (replacementTransaction) {
|
||||||
extendedTx = tx.set('cancelled', true)
|
extendedTx = tx.set('cancelled', true)
|
||||||
|
|
Loading…
Reference in New Issue