Skip to content

Integrate Zcash with the wallet UI - #1565

Draft
sneurlax wants to merge 2 commits into
feat/zcash-e2efrom
feat/zcash-ui
Draft

sneurlax wants to merge 2 commits into
feat/zcash-e2efrom
feat/zcash-ui

Conversation

@sneurlax

@sneurlax sneurlax commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • List Zcash in the app: the coin list entry in configure_stack_wallet.sh, the README line, and the wallet creation matrix entry.
  • New wallet: the wallet takes its birthday from the node's tip (init(isRestore: false)). If the node does not answer, the half-made wallet is deleted and the error says what to check.
  • Restore: by block height only, in the restore view and in Stack Backup. A Zcash restore without a height is not offered, because a missing birthday would either skip history or scan the whole chain.
  • Stack Backup restore: Zcash wallets restore from their saved height, and a reverted restore deletes the Zcash files of the wallets it removes.
  • Tor: creating or restoring a Zcash wallet while Tor is enabled first shows the standard warning for a coin without Tor support, because both contact the node.
  • Node form: "Test connection" asks the node for its chain and tip, and passes for a node of the wallet's network only.
  • Send: the memo field, the fee shown without a fee rate picker, and "Send all" leaves room for the fee.

Stacked on #1564, which is stacked on #1563.

Commits

  1. style: dart format restore_options_view.dart is formatter output only. That file was last changed before the SDK constraint moved to 3.13, so CI's format check fails on any change to it. Running dart format on the staging version reproduces this commit.
  2. feat: integrate Zcash with the wallet UI is the change.

Size

The feature commit is 18 files, +370/-44. About 150 lines are in existing views and helpers (70 of them the restore options view, where a coin condition that was repeated six times becomes two locals), 28 in Stack Backup restore, 43 in the node test and the session helper it calls, and 168 in tests.

Themes

This PR does not touch the default themes. A coin a theme does not know gets the placeholder icon and the default colour, which staging's theme code already does. The Zcash art is in the theme server's main and in feat/zcash-themes (#1567), which can land before or after this.

Known limits

  • With Tor enabled, opening, creating or restoring a Zcash wallet shows the standard warning for coins without Tor support, and the wallet then connects in the clear. A Stack Backup restore and the node form's test connect without that warning, as they do for Xelis. The node test fails for a node marked clearnet-only while Tor is on, as for every coin.
  • Creating a wallet needs the node, for the tip.
  • A restore returns once the node has answered, and the wallet then scans from its height as it syncs. From an old height that takes a long time, shown as syncing without a percentage. The scan continues after a restart.
  • A Stack Backup restore closes each wallet once it is restored, as it does for every coin. For Zcash that stops the scan the restore had started, and the wallet's base class logs the stopped refresh as a failed one. The scan starts again when the wallet is next opened.
  • A node host typed with a scheme has to agree with the SSL switch: https://host with the switch off fails the test.
  • The memo is not shown on the confirmation view, as for Stellar.
  • "Send all" leaves the fee of a payment to a Unified Address. A payment of the whole balance to a transparent or Sapling address needs a larger fee and is refused by the wallet for lack of funds: the user lowers the amount.
  • Funds received on the Sapling or transparent receiver of the wallet's address, and Orchard funds from before the Ironwood upgrade, count towards the total and cannot be spent until a later PR.
  • A payment to a Sapling address needs the Sapling proving parameters and is refused with a message that says so, until the PR that downloads them.
  • The wallet creation matrix entry for Zcash contacts the default node.

Not changed here

  • This PR and the Grin UI PR (Integrate Grin with the shared Slatepack UI #1540) both add a coin to configure_stack_wallet.sh, the creation matrix and its counts in wallet_creation_runner_test.dart, and both add a case to the Stack Backup restore. Whichever lands second has a small conflict there.
  • A restore that is cancelled just as its wallet is added can leave that wallet listed. That race is in the shared restore view and affects every coin.
  • At startup the app removes wallets that were never verified, through a path that deletes the wallet's database entry only. For Zcash that leaves the encrypted state file and its key behind. The path predates this PR; with the cleanup above, a Zcash wallet reaches it only if the app dies during creation or restore.
  • The default nodes are zec.rocks:443 and testnet.zec.rocks:443 (set in Add Zcash wallet core integration #1563). They are a product decision that can change without code review of this stack.

Verification

At this PR's head (caed3d64d):

  • flutter analyze on the changed Dart files: no errors.
  • CI's format check on the PR's changed Dart files: clean.
  • The Zcash tests, with the ones this PR adds (the restore options view and the node check): 135 pass.
  • The eight scripts/tests that CI runs, run as CI runs them: pass. wallet_creation_runner_test.dart covers the new matrix counts.
  • The wallet creation suite for Zcash on Linux (dart scripts/test_wallet_creation.dart --device linux --coin zcash), which drives the built app through creating and reopening a wallet against the default node: 2/2, run at the top of the stack (Download the Sapling parameters for Zcash sends #1566).
  • The end-to-end suite from Add Zcash regtest end-to-end test coverage #1564: 1/1.
  • The full flutter test suite, at the top of the stack (Download the Sapling parameters for Zcash sends #1566): 1570 passed, 8 skipped, and three of the Firo cache tests named in Add Zcash wallet core integration #1563, which time out in full runs on this machine and pass on their own (17/17).

"Send all" has no widget test: the send views have no test harness on staging. Its amount comes from the wallet's fee estimate, which the end-to-end test compares with the fee of a prepared send.

@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.36090% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.12%. Comparing base (53cd4ef) to head (caed3d6).

Files with missing lines Patch % Lines
...iew/restore_options_view/restore_options_view.dart 73.01% 17 Missing ⚠️
..._view/new_wallet_recovery_phrase_warning_view.dart 0.00% 12 Missing ⚠️
...views/restore_wallet_view/restore_wallet_view.dart 0.00% 12 Missing ⚠️
...ck_backup_views/helpers/restore_create_backup.dart 0.00% 10 Missing ⚠️
lib/pages/send_view/send_view.dart 27.27% 8 Missing ⚠️
lib/utilities/test_node_connection.dart 0.00% 8 Missing ⚠️
...ack_view/wallet_view/sub_widgets/desktop_send.dart 22.22% 7 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           feat/zcash-e2e    #1565      +/-   ##
==================================================
+ Coverage           21.80%   22.12%   +0.31%     
==================================================
  Files                1157     1157              
  Lines              116360   116430      +70     
==================================================
+ Hits                25374    25755     +381     
+ Misses              90986    90675     -311     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant