Use makeMaxSpend to build max-spend transactions#6059
Draft
j0ntz wants to merge 2 commits into
Draft
Conversation
Migrate the Send Max flow in SendScene2 and the token migration in MigrateWalletCompletionScene to the new EdgeCurrencyWallet.makeMaxSpend API, which builds the max-spend transaction atomically instead of combining getMaxSpendable and makeSpend. Display-only and reduced-amount call sites continue to use getMaxSpendable.
Add testID props to the address Enter button (AddressTile2) and the flip input Max button (ExchangedFlipInput2) so the Send Max maestro flow can drive them by id.
Contributor
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
Depends on the new
EdgeCurrencyWallet.makeMaxSpendAPI in edge-core-js (EdgeApp/edge-core-js#727). Draft until that core change is published and bumped here — CI will not pass against the currently-publishededge-core-jsbecausemakeMaxSpenddoes not exist on the wallet type yet.Requirements
If you have made any visual changes to the GUI. Make sure you have:
Description
Migrate the build-a-max-spend-transaction call sites from the
getMaxSpendable+makeSpendpattern to the new atomicEdgeCurrencyWallet.makeMaxSpendAPI:SendScene2— the "Send Max" flow now callsmakeMaxSpendand reads the resulting amount back from the transaction for the spending-limit / minimum checks and the flip-input display.MigrateWalletCompletionScene— the token-migration path now builds the full-balance transfer viamakeMaxSpend.Display-only and reduced-amount call sites (amount quote plugin, ramp scene, FIO staking, and the mainnet-migration path that sends
max − feeTotal) continue to usegetMaxSpendable, since they need the amount value rather than a built transaction.Also adds
testIDs to the address "Enter" button and the flip-input "Max" button (separate commit) so the max-spend flow can be driven in automated UI tests.Asana: https://app.asana.com/0/1215088146871429/1207967192999590
Testing
tsc --noEmitclean against the local (linked) edge-core-js build withmakeMaxSpend.coreWallet.makeMaxSpend, which built the max-spend transaction (max amount = balance − network fee) and rendered it ready to send. Proof screenshots attached.