Add WalletCore build-only transaction APIs - #614
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds build-only transaction APIs to WalletCore, allowing downstream callers to construct both public and privacy-preserving transactions without submitting them, and to explicitly submit later via a new wallet-owned submission method. It refactors existing send_* and *_with_pre_check methods to preserve their signatures/behavior while delegating through the new build + submit flow, and adds integration coverage for build -> submit -> poll.
Changes:
- Added
WalletCore::build_pub_tx,WalletCore::build_privacy_preserving_tx, andWalletCore::submit_transaction, and refactored existingsend_*paths to use them. - Added
AccountIdentity::account_id()(keepingpublic_account_id()intact) plus unit test coverage for all identity variants. - Added an integration test covering public and privacy-preserving
build -> submit -> poll, asserting that build-only does not submit.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lez/wallet/src/lib.rs | Introduces build-only + submit APIs and refactors existing send APIs to preserve behavior via build-then-submit. |
| lez/wallet/src/account_manager.rs | Adds AccountIdentity::account_id() and tests projecting IDs across all variants. |
| integration_tests/tests/wallet_build.rs | Adds integration coverage ensuring build-only doesn’t submit and explicit submission works for both transaction types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
04037ae to
a2a6d8e
Compare
a2a6d8e to
7a40979
Compare
|
I rebased this into Consider:
|
🎯 Purpose
Add build-only Wallet APIs for downstream transaction builders. Wallet can now
build public and privacy-preserving transactions without submitting them; the
caller explicitly submits through Wallet. Existing
send_*APIs retain theirbehavior.
Closes #613
⚙️ Approach
WalletCore::build_pub_tx,build_privacy_preserving_tx, andsubmit_transaction.send_*and*_with_pre_checksignatures andbehavior through private build helpers and explicit Wallet submission.
AccountIdentity::account_id()while preservingpublic_account_id().build -> submit -> poll.🧪 How to Test
Requires Docker Compose v2. Run:
The integration test lets a sequencer block interval pass after each build and
asserts the built hash remains absent. It then explicitly submits the
transaction through Wallet and polls for its result.
🔗 Dependencies
None.
🔜 Future Work
change has a published commit or release tag.
📋 PR Completion Checklist