Repository navigation
Conversation
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.
Summary
ZcashWallet.prepareMoveToIronwood(pool): a transaction that moves what the wallet holds in the Sapling pool, or its transparent coins, to its own Ironwood receiver. A send spends Ironwood funds only, so this is how funds received on the Sapling or transparent receiver of the wallet's address become spendable.ZcashWallet.movableFunds(): what each of the two pools holds that such a move can take.confirmSendand dropped withcancelSend, as a send is.This PR has no view. The view that offers the moves is #1569. The moves are covered here by unit tests and by two legs of the regtest end-to-end test.
Stacked on #1566.
Commits
feat: move Zcash Sapling and transparent funds to Ironwood.Size
10 files, +2108/-83. About 1070 lines are code: the send service (+655: the two prepared transactions, the Sapling witness scan, the two preparations, the selection and fee arithmetic, and the call of the native transparent builder), the wallet (about 285 changed lines, of which about 60 move the body of
prepareSendinto a method the move shares), the pending-send store (+120 for the move records) and the history mapper (about 50). About 990 lines are unit tests and 80 are the end-to-end legs.How it works
prepareNativeSaplingPayment), and transparent coins to an Ironwood output (prepareNativeShieldingSend). Neither can pay another pool, which is why this is a move to the wallet's own address and not a choice of source in the send form.movableFunds()reports a pool as empty when its first move could not pay its fee, by ZIP 317's arithmetic (15000 for one transparent coin, 20000 for up to two Sapling notes). The fee of a prepared move is still the backend's quote.WalletInfo.otherData, becauseWalletInfo's update methods read the row and write it back in a later step, so a refresh that updates the chain height at the same time could write the record away. The file is read and written under its lock.Known limits
zcash_flutter.zcash_flutterkeeps witnesses current during sync. As for a send, the server learns the height of the oldest note.Not changed here
WalletInfo's update methods can lose an update to one another, for every coin. This PR avoids them for its record and leaves them as they are.Verification
At this PR's head (
140c9ea14):flutter analyzeon the changed Dart files: no issues. CI's format check on them: clean.flutter testsuite: 1587 passed, 8 skipped, run at the top of the stack (Add a Zcash migration view to the More menu #1569).Not covered by a test: the release of a transparent move's coins at its expiry height, and the native transparent builder with an empty Ironwood tree.