Skip to content

Abstract devtool coupling behind a general client interface#1272

Draft
Timi16 wants to merge 10 commits into
zingolabs:devfrom
Timi16:abstract-devtool-client-interface
Draft

Abstract devtool coupling behind a general client interface#1272
Timi16 wants to merge 10 commits into
zingolabs:devfrom
Timi16:abstract-devtool-client-interface

Conversation

@Timi16

@Timi16 Timi16 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Timi16 and others added 2 commits June 20, 2026 13:41
Introduce TestWallet trait, WalletPoolBalances, and TestClients<W> so
wallet-test code depends on a backend-agnostic interface rather than
devtool specifics (zingolabs#1264). Also addresses pacu's review on zingolabs#1259:

- Replace hand-rolled txid_internal_bytes with TxId-based
  txid_from_devtool (proven ecosystem type).
- Return Zatoshis from spendable_balance instead of raw u64.

Refs zingolabs#1264, zingolabs#1262
Comment thread integration-tests/wallet-tests/Cargo.toml Outdated
@zancas

zancas commented Jun 26, 2026

Copy link
Copy Markdown
Member

If you can produce a variant of this that does not add new dependencies that would be more interesting.

@Timi16

Timi16 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

If you can produce a variant of this that does not add new dependencies that would be more interesting.

Okat alright would look into it thank you

@zancas

zancas commented Jun 26, 2026

Copy link
Copy Markdown
Member

Moving to draft until it removes new dependencies.

@zancas zancas marked this pull request as draft June 26, 2026 19:57
@Timi16 Timi16 force-pushed the abstract-devtool-client-interface branch from 37c6cb0 to 6308346 Compare June 26, 2026 21:57
@Timi16 Timi16 marked this pull request as ready for review June 26, 2026 21:59
@Timi16

Timi16 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Moving to draft until it removes new dependencies.

Made changes and ready to review

@Timi16 Timi16 requested a review from zancas June 26, 2026 22:01

@zancas zancas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why isn't this PR'd against https://github.com/zingolabs/infrastructure ?

@Timi16

Timi16 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

The changes in this PR live entirely in integration-tests/wallet-tests/. It adds TestWallet, WalletPoolBalances, TestClients<W>, and the TestWallet impl for the ZcashDevtool adapter — all inside Zaino’s own test harness. Nothing in zcash_local_net or the infrastructure was modified.

The abstraction wraps zcash_local_net::client::Client so that Zaino’s test bodies depend on a backend-agnostic trait (TestWallet) rather than directly calling ZcashDevtool methods. This decoupling is on the Zaino side: it lets us swap or add wallet backends (e.g. a future zingolib or mock backend) without touching the infrastructure.

The TestWallet impl for ZcashDevtool lives here because it adapts an external type (ZcashDevtool) to a Zaino-local trait (TestWallet), which is exactly where Rust’s orphan rules require it to live.

@Timi16 Timi16 requested a review from zancas June 27, 2026 00:49
Comment thread integration-tests/wallet-tests/src/lib.rs Outdated
@Timi16 Timi16 requested a review from zancas June 27, 2026 02:45
@zancas zancas marked this pull request as draft June 27, 2026 23:26
@Timi16

Timi16 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Let me get back to work

Timi16 added 2 commits June 30, 2026 18:28
…t-interface

# Conflicts:
#	live-tests/e2e/tests/devtool.rs
#	live-tests/e2e/tests/devtool_zcashd.rs
#	live-tests/e2e/tests/test_vectors.rs
@Timi16 Timi16 force-pushed the abstract-devtool-client-interface branch from 9bf1ab0 to c83bef5 Compare July 1, 2026 01:32
@Timi16 Timi16 force-pushed the abstract-devtool-client-interface branch from c83bef5 to 3e1e755 Compare July 1, 2026 01:33
@Timi16 Timi16 marked this pull request as ready for review July 1, 2026 01:33
@zancas

zancas commented Jul 1, 2026

Copy link
Copy Markdown
Member

OK marking draft for now.

@zancas zancas marked this pull request as draft July 1, 2026 15:16
@Timi16

Timi16 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

OK marking draft for now.

Okay

@Timi16

Timi16 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

OK marking draft for now.

Why did you make this a draft please would love to know

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.

2 participants