-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: transaction estimation flow (#1549)
- Closes #1546 - Simplified the estimation / approval part of the DAPP Approve Transaction screen - Send transaction part - Simulate transaction before sending, avoiding the user to spend gas in case of fail - Skip estimating dependencies at this point, on this approval step we don’t wanna change the tx anymore - Refact the transaction estimation part: - Save the `initialTxRequest` as the one the dev first informed. All further changes will be always done based on this first tx informed - Do the estimation, fee changes, funding if needed, and generate a `proposedTxRequest` which may have some changes - this `proposedTxRequest` is gonna be the one to go for approval - If the user choose to customize gas or tips, we apply again to the `initialTxRequest` and create a new `proposetTxRequest`, this way we don’t continuously manipulate a transactionRequest. Instead we always have a safe start point - If the user didn't customize the `gasLimit` we automatically increase 20% on it, avoiding OutOfGas errors - Remove all `minGasLimit`, letting the user just inform the gas he wants, if it’s too low the dryRun will fail - For the approve screen to start in “Advanced Mode” - It will be needed that the tip informed in the tx is different then the regularTip and fastTIp we calculated - Also the gas can be different from the one calculated on proposedTxRequest, this will also make the Advanced Mode initiated
- Loading branch information
1 parent
6dd69ce
commit c163db4
Showing
15 changed files
with
176 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fuels-wallet": minor | ||
--- | ||
|
||
Increase gasLimit by 20% to avoid OutOfGas error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fuels-wallet": minor | ||
--- | ||
|
||
Refactor transaction estimation / customization of fees flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.