Skip to content

Add WalletCore build-only transaction APIs - #614

Open
3esmit wants to merge 1 commit into
devfrom
spel-wallet-build-api
Open

Add WalletCore build-only transaction APIs#614
3esmit wants to merge 1 commit into
devfrom
spel-wallet-build-api

Conversation

@3esmit

@3esmit 3esmit commented Jul 13, 2026

Copy link
Copy Markdown

🎯 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 their
behavior.

Closes #613

⚙️ Approach

  • Add WalletCore::build_pub_tx, build_privacy_preserving_tx, and
    submit_transaction.
  • Preserve existing send_* and *_with_pre_check signatures and
    behavior through private build helpers and explicit Wallet submission.
  • Add AccountIdentity::account_id() while preserving
    public_account_id().
  • Add public and privacy-preserving integration coverage for
    build -> submit -> poll.

🧪 How to Test

Requires Docker Compose v2. Run:

cargo test -p wallet
RISC0_DEV_MODE=1 cargo test -p integration_tests --test wallet_build
cargo clippy -p wallet --all-targets --all-features -- -D warnings

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

  • Integrate these APIs into the downstream transaction-builder work after this
    change has a published commit or release tag.
  • Keep CLI adoption and CLI behavior changes in separate follow-up work.

📋 PR Completion Checklist

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

Copilot AI review requested due to automatic review settings July 13, 2026 00:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and WalletCore::submit_transaction, and refactored existing send_* paths to use them.
  • Added AccountIdentity::account_id() (keeping public_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.

@3esmit
3esmit requested review from Arjentix and moudyellaz July 14, 2026 18:32
@3esmit
3esmit changed the base branch from main to dev July 14, 2026 19:13
@3esmit
3esmit force-pushed the spel-wallet-build-api branch 3 times, most recently from 04037ae to a2a6d8e Compare July 14, 2026 22:19
@agureev agureev mentioned this pull request Jul 15, 2026
7 tasks
@3esmit
3esmit force-pushed the spel-wallet-build-api branch from a2a6d8e to 7a40979 Compare July 15, 2026 15:24
@3esmit

3esmit commented Jul 15, 2026

Copy link
Copy Markdown
Author

I rebased this into dev as required by contribution guidelines. All checks now pass. R
ecommend reviewing the CI run pipeline, as it constantly fails with disk out of space, and it takes way to long due repetitive compiles of nextest.

Consider:

  • running all dependencies of nextest under the same CI as separate sub jobs, so nextest is compiled only once;
  • and downloading integration test archive only one - so the CI don't runs out of space.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add WalletCore build-only and submit APIs

3 participants