62 lines
19 KiB
HTML
62 lines
19 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Read-only operations required for testing light wallet functions."><title>WalletTest in zcash_client_backend::data_api - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-20739d33.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="zcash_client_backend" data-themes="" data-resource-suffix="" data-rustdoc-version="1.88.0-nightly (74509131e 2025-04-29)" data-channel="nightly" data-search-js="search-f7877310.js" data-settings-js="settings-5514c975.js" ><script src="../../static.files/storage-4e99c027.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-7ef8a74a.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../zcash_client_backend/index.html">zcash_<wbr>client_<wbr>backend</a><span class="version">0.18.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Wallet<wbr>Test</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.get_checkpoint_history" title="get_checkpoint_history">get_checkpoint_history</a></li><li><a href="#tymethod.get_notes" title="get_notes">get_notes</a></li><li><a href="#tymethod.get_sent_note_ids" title="get_sent_note_ids">get_sent_note_ids</a></li><li><a href="#tymethod.get_sent_outputs" title="get_sent_outputs">get_sent_outputs</a></li><li><a href="#tymethod.get_transparent_output" title="get_transparent_output">get_transparent_output</a></li><li><a href="#tymethod.get_tx_history" title="get_tx_history">get_tx_history</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In zcash_<wbr>client_<wbr>backend::<wbr>data_<wbr>api</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">zcash_client_backend</a>::<wbr><a href="index.html">data_api</a></div><h1>Trait <span class="trait">WalletTest</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/zcash_client_backend/data_api.rs.html#1636-1690">Source</a> </span></div><pre class="rust item-decl"><code>pub trait WalletTest: <a class="trait" href="trait.InputSource.html" title="trait zcash_client_backend::data_api::InputSource">InputSource</a> + <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a> {
|
|
// Required methods
|
|
fn <a href="#tymethod.get_tx_history" class="fn">get_tx_history</a>(
|
|
&self,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="testing/struct.TransactionSummary.html" title="struct zcash_client_backend::data_api::testing::TransactionSummary">TransactionSummary</a><<Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.AccountId" title="type zcash_client_backend::data_api::WalletRead::AccountId">AccountId</a>>>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.get_sent_note_ids" class="fn">get_sent_note_ids</a>(
|
|
&self,
|
|
_txid: &TxId,
|
|
_protocol: ShieldedProtocol,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../wallet/struct.NoteId.html" title="struct zcash_client_backend::wallet::NoteId">NoteId</a>>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.get_sent_outputs" class="fn">get_sent_outputs</a>(
|
|
&self,
|
|
txid: &TxId,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.OutputOfSentTx.html" title="struct zcash_client_backend::data_api::OutputOfSentTx">OutputOfSentTx</a>>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.get_checkpoint_history" class="fn">get_checkpoint_history</a>(
|
|
&self,
|
|
protocol: &ShieldedProtocol,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><(BlockHeight, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Position>)>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.get_transparent_output" class="fn">get_transparent_output</a>(
|
|
&self,
|
|
outpoint: &OutPoint,
|
|
allow_unspendable: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../wallet/struct.WalletTransparentOutput.html" title="struct zcash_client_backend::wallet::WalletTransparentOutput">WalletTransparentOutput</a>>, <Self as <a class="trait" href="trait.InputSource.html" title="trait zcash_client_backend::data_api::InputSource">InputSource</a>>::<a class="associatedtype" href="trait.InputSource.html#associatedtype.Error" title="type zcash_client_backend::data_api::InputSource::Error">Error</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.get_notes" class="fn">get_notes</a>(
|
|
&self,
|
|
protocol: ShieldedProtocol,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../wallet/struct.ReceivedNote.html" title="struct zcash_client_backend::wallet::ReceivedNote">ReceivedNote</a><Self::<a class="associatedtype" href="trait.InputSource.html#associatedtype.NoteRef" title="type zcash_client_backend::data_api::InputSource::NoteRef">NoteRef</a>, <a class="enum" href="../wallet/enum.Note.html" title="enum zcash_client_backend::wallet::Note">Note</a>>>, <Self as <a class="trait" href="trait.InputSource.html" title="trait zcash_client_backend::data_api::InputSource">InputSource</a>>::<a class="associatedtype" href="trait.InputSource.html#associatedtype.Error" title="type zcash_client_backend::data_api::InputSource::Error">Error</a>>;
|
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Read-only operations required for testing light wallet functions.</p>
|
|
<p>These methods expose internal details or unstable interfaces, primarily to enable use
|
|
of the <a href="testing/index.html" title="mod zcash_client_backend::data_api::testing"><code>testing</code></a> framework. They should not be used in production software.</p>
|
|
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.get_tx_history" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#1642-1647">Source</a><h4 class="code-header">fn <a href="#tymethod.get_tx_history" class="fn">get_tx_history</a>(
|
|
&self,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="testing/struct.TransactionSummary.html" title="struct zcash_client_backend::data_api::testing::TransactionSummary">TransactionSummary</a><<Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.AccountId" title="type zcash_client_backend::data_api::WalletRead::AccountId">AccountId</a>>>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>></h4></section></summary><div class="docblock"><p>Returns a vector of transaction summaries.</p>
|
|
<p>Currently test-only, as production use could return a very large number of results; either
|
|
pagination or a streaming design will be necessary to stabilize this feature for production
|
|
use.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.get_sent_note_ids" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#1651-1655">Source</a><h4 class="code-header">fn <a href="#tymethod.get_sent_note_ids" class="fn">get_sent_note_ids</a>(
|
|
&self,
|
|
_txid: &TxId,
|
|
_protocol: ShieldedProtocol,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../wallet/struct.NoteId.html" title="struct zcash_client_backend::wallet::NoteId">NoteId</a>>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>></h4></section></summary><div class="docblock"><p>Returns the note IDs for shielded notes sent by the wallet in a particular
|
|
transaction.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.get_sent_outputs" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#1659-1662">Source</a><h4 class="code-header">fn <a href="#tymethod.get_sent_outputs" class="fn">get_sent_outputs</a>(
|
|
&self,
|
|
txid: &TxId,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.OutputOfSentTx.html" title="struct zcash_client_backend::data_api::OutputOfSentTx">OutputOfSentTx</a>>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>></h4></section></summary><div class="docblock"><p>Returns the outputs for a transaction sent by the wallet.</p>
|
|
</div></details><section id="tymethod.get_checkpoint_history" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#1665-1671">Source</a><h4 class="code-header">fn <a href="#tymethod.get_checkpoint_history" class="fn">get_checkpoint_history</a>(
|
|
&self,
|
|
protocol: &ShieldedProtocol,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><(BlockHeight, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Position>)>, <Self as <a class="trait" href="trait.WalletRead.html" title="trait zcash_client_backend::data_api::WalletRead">WalletRead</a>>::<a class="associatedtype" href="trait.WalletRead.html#associatedtype.Error" title="type zcash_client_backend::data_api::WalletRead::Error">Error</a>></h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.get_transparent_output" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#1679-1683">Source</a><h4 class="code-header">fn <a href="#tymethod.get_transparent_output" class="fn">get_transparent_output</a>(
|
|
&self,
|
|
outpoint: &OutPoint,
|
|
allow_unspendable: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../wallet/struct.WalletTransparentOutput.html" title="struct zcash_client_backend::wallet::WalletTransparentOutput">WalletTransparentOutput</a>>, <Self as <a class="trait" href="trait.InputSource.html" title="trait zcash_client_backend::data_api::InputSource">InputSource</a>>::<a class="associatedtype" href="trait.InputSource.html#associatedtype.Error" title="type zcash_client_backend::data_api::InputSource::Error">Error</a>></h4></section><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>transparent-inputs</code></strong> only.</div></span></summary><div class="docblock"><p>Fetches the transparent output corresponding to the provided <code>outpoint</code>.
|
|
Allows selecting unspendable outputs for testing purposes.</p>
|
|
<p>Returns <code>Ok(None)</code> if the UTXO is not known to belong to the wallet or is not
|
|
spendable as of the chain tip height.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.get_notes" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#1686-1689">Source</a><h4 class="code-header">fn <a href="#tymethod.get_notes" class="fn">get_notes</a>(
|
|
&self,
|
|
protocol: ShieldedProtocol,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../wallet/struct.ReceivedNote.html" title="struct zcash_client_backend::wallet::ReceivedNote">ReceivedNote</a><Self::<a class="associatedtype" href="trait.InputSource.html#associatedtype.NoteRef" title="type zcash_client_backend::data_api::InputSource::NoteRef">NoteRef</a>, <a class="enum" href="../wallet/enum.Note.html" title="enum zcash_client_backend::wallet::Note">Note</a>>>, <Self as <a class="trait" href="trait.InputSource.html" title="trait zcash_client_backend::data_api::InputSource">InputSource</a>>::<a class="associatedtype" href="trait.InputSource.html#associatedtype.Error" title="type zcash_client_backend::data_api::InputSource::Error">Error</a>></h4></section></summary><div class="docblock"><p>Returns all the notes that have been received by the wallet.</p>
|
|
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/zcash_client_backend/data_api/trait.WalletTest.js" async></script></section></div></main></body></html> |