(Feature) Refactor gas calculation#1756
(Feature) Refactor gas calculation#1756dasanra merged 29 commits intofeature/1048-tx-will-fail-warningfrom
Conversation
Remove estimateTransactionGas from gas.ts
…Approval to gas.ts
Refactors useEstimateTransactionGas to return isCreation and isOffChainSignature
Moves getPreValidatedSignatures to safeTxSigner.ts
Uses TransactionFeesText on ApproveTxModal
|
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
|
Hey @rmeissner we have some questions about the signatures in order to make a call to We have this code for estimating the gas (you can check the complete function here): We are getting that error here: calculateGasOf will basically do a The signatures that we provided are these ones: The safe: But if we continue executing the transaction, the method Do you have any ideas about why this could be happening? |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
…/gnosis/safe-react into feature/refactor-gas-calculation
| txConfirmations === threshold || !!preApprovingOwner || threshold === 1 | ||
|
|
||
| const checkIfTxIsApproveAndExecution = (threshold: number, txConfirmations: number): boolean => | ||
| txConfirmations + 1 === threshold |
There was a problem hiding this comment.
not sure to understand this, are we checking the checkbox status somewhere?
There was a problem hiding this comment.
It's not needed, it's the same logic that uses the checkbox in ApproveTxModal here:
const oneConfirmationLeft = !thresholdReached && tx.confirmations.size + 1 === threshold
const isTheTxReadyToBeExecuted = oneConfirmationLeft ? true : thresholdReached
…r-gas-calculation
| }: TransactionExecutionEstimationProps): Promise<number> => { | ||
| const safeInstance = await getGnosisSafeInstanceAt(safeAddress) | ||
| try { | ||
| if (approvalAndExecution) { |
There was a problem hiding this comment.
If we try to use execTransaction .call() to estimate the gas without having all the "confirmed" signatures (no prevalidated with the sentinel) we got an error: Hash has not been approved, so in case that the user wants to do an "approve and execute" we will calculate the gas using the same method as for creation safe.requiredTxGas.
|
Travis automatic deployment: |
|
Travis automatic deployment: |
src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx
Outdated
Show resolved
Hide resolved
|
Travis automatic deployment: |
|
Travis automatic deployment: |
…r-gas-calculation # Conflicts: # src/routes/safe/components/Transactions/TxsTable/ExpandedTx/ApproveTxModal/index.tsx
|
Travis automatic deployment: |
|
Travis automatic deployment: |
Closes #1752
Depends on #1675