Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for transparent-source-only (TEX) addresses #1257

Merged
merged 56 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2fae4bb
ZIP 320 implementation.
daira Jun 22, 2024
0f3de63
Apply documentation suggestions from code review.
daira Jun 22, 2024
549fe0b
In `reserve_next_n_ephemeral_addresses`, exclude addresses observed in
daira Jun 22, 2024
eb88461
Address review comment: `EphemeralIvk` should not implement `Incoming…
daira Jun 22, 2024
c6520cf
Change the protobuf schema to explicitly specify whether a `ChangeValue`
daira Jun 22, 2024
2f521d7
If a change memo is supplied, it should not be used in the second step
daira Jun 23, 2024
0f49dae
`mark_ephemeral_address_as_mined` now prefers setting `mined_in_tx` to
daira Jun 23, 2024
637ae92
Add a migration test for the `ephemeral_addresses` migration.
daira Jun 23, 2024
994f6ff
Change type of `n` in `reserve_next_n_ephemeral_addresses`.
daira Jun 24, 2024
25f07da
Add a constraint on the range of `ephemeral_addresses(address_index)`.
daira Jun 24, 2024
e164b59
Move most ephemeral address index handling into helper functions in
daira Jun 24, 2024
914acb5
Move most remaining code for wallet support of ephemeral addresses into
daira Jun 24, 2024
745054b
`find_account_for_transparent_output` now searches unreserved ephemeral
daira Jun 24, 2024
6b465b7
Document the mapping functions on `zcash_client_backend::wallet::Reci…
daira Jun 24, 2024
4f43a01
Refactor transparent address metadata lookups. This is correct as-is but
daira Jun 25, 2024
5a90fff
Factor out the conversion of the `diversifier_index_be` field in the
daira Jun 25, 2024
7fb3557
Implement `WalletRead::get_transparent_address_metadata` for
daira Jun 25, 2024
7d8a96f
Don't cache metadata between steps; it's not an important optimization.
daira Jun 25, 2024
bd6c9f3
Apply documentation suggestions from code review.
daira Jun 26, 2024
0735390
Rename `amount` to `transfer_amount` in `send_multi_step_proposed_tra…
daira Jun 26, 2024
c926e7c
Filter ephemeral transparent `ChangeValue`s by `is_ephemeral()` as we…
daira Jun 26, 2024
ffb2ddf
`zcash_client_backend::fees::ChangeValue` is now an enum, allowing only
daira Jun 26, 2024
b778139
Refactor ephemeral output-related parameters to balance calculation.
daira Jun 26, 2024
7a05b44
Make mutable inputs to closures in `create_proposed_transaction` expl…
daira Jun 26, 2024
6471d4c
Don't assume that prior step outputs are ephemeral iff they are
daira Jun 27, 2024
ec4a6d0
Documentation improvements.
daira Jun 27, 2024
81a2846
Simpler way to calculate `has_shielded_inputs`.
daira Jun 27, 2024
f0e5aab
Improve discrimination of proposal errors.
daira Jun 27, 2024
feabe6d
Remove complicated code to calculate the number of dust spends.
daira Jun 26, 2024
baccb43
Restore the logic to determine whether we are spending inputs that are
daira Jun 28, 2024
9c082dc
`zcash_primitives::transaction::fees::zip317::FeeRule::non_standard` has
daira Jun 28, 2024
3829663
Change note selection query to select notes > 5000 zats, not >= 5000 …
daira Jun 28, 2024
25006ab
Documentation improvement from code review.
daira Jun 28, 2024
3922d71
Change the type of `n` in `reserve_next_n_ephemeral_addresses` back t…
daira Jun 28, 2024
d32b7db
Remove `ChangeValue::new`. Also document `ChangeValue::is_ephemeral` as
daira Jun 28, 2024
286439a
Define a constant `EphemeralParameters::NONE` instead of deriving `De…
daira Jun 29, 2024
bc38f2a
Document the `possible_change` parameter to `check_for_uneconomic_inp…
daira Jun 29, 2024
7838c04
Make `ephemeral_parameters` and `EphemeralParameters::NONE` available
daira Jun 29, 2024
14bdcde
We cannot spend prior outputs at all when "transparent-inputs" is not
daira Jun 29, 2024
8636daa
Tiny simplification.
daira Jun 29, 2024
01ff201
Minor changes responding to review comments.
daira Jul 3, 2024
b63ff5b
Rename `get_reserved_ephemeral_addresses` to `get_known_ephemeral_add…
daira Jul 3, 2024
e97da43
Refactoring to address review comments.
daira Jul 3, 2024
a01588b
Ensure that `mark_ephemeral_address_as_mined` correctly handles indices
daira Jul 4, 2024
86428c4
Refactor `find_account_for_transparent_output` (now called
daira Jul 4, 2024
b48f627
Minor simplification in a test.
daira Jul 4, 2024
6bc22f4
Documentation fixes and improvements.
daira Jul 4, 2024
27ca6e4
Remove unneeded `impl SealedChangeLevelKey for EphemeralIvk`.
daira Jul 4, 2024
bda6451
Change `unwrap`s to `expect`s when constructing `NonHardenedChildIndex`.
daira Jul 4, 2024
22b8cff
The `TxId` argument to `EphemeralAddressReuse` does not need to be op…
daira Jul 4, 2024
9856a70
Simpler handling of a potential overflow.
daira Jul 4, 2024
56aa348
Extend the `send_multi_step_proposed_transfer` test to check the beha…
daira Jul 4, 2024
aa43123
Use `EphemeralBalance` instead of `EphemeralParameters`
nuttycom Jul 16, 2024
dbb5eeb
Fix a potential crash related to varying behavior between change stra…
nuttycom Jul 16, 2024
24b6d50
Apply suggestions from code review
nuttycom Jul 16, 2024
f8bedd8
Make ephemeral_addresses.address unique
nuttycom Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 44 additions & 13 deletions zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,38 @@ and this library adheres to Rust's notion of
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Notable changes
`zcash_client_backend` now supports TEX (transparent-source-only) addresses as specified
in ZIP 320. Sending to one or more TEX addresses will automatically create a multi-step
proposal that uses two transactions.

In order to take advantage of this support, client wallets will need to be able to send
multiple transactions created from `zcash_client_backend::data_api::wallet::create_proposed_transactions`.
This API was added in `zcash_client_backend` 0.11.0 but previously could only return a
single transaction.

**Note:** This feature changes the use of transparent addresses in ways that are relevant
to security and access to funds, and that may interact with other wallet behaviour. In
particular it exposes new ephemeral transparent addresses belonging to the wallet, which
need to be scanned in order to recover funds if the first transaction of the proposal is
mined but the second is not, or if someone (e.g. the TEX-address recipient) sends back
funds to those addresses. See [ZIP 320](https://zips.z.cash/zip-0320) for details.

### Added
- `zcash_client_backend::data_api`:
- `chain::BlockCache` trait, behind the `sync` feature flag.
- `WalletRead::get_spendable_transparent_outputs`.
- `zcash_client_backend::fees`:
- `ChangeValue::{transparent, shielded}`
- `ChangeValue::shielded, is_ephemeral`
- `ChangeValue::ephemeral_transparent` (when "transparent-inputs" is enabled)
- `sapling::EmptyBundleView`
- `orchard::EmptyBundleView`
- `zcash_client_backend::proposal`:
- `impl Hash for {StepOutput, StepOutputIndex}`
- `zcash_client_backend::scanning`:
- `testing` module
- `zcash_client_backend::sync` module, behind the `sync` feature flag
- `zcash_client_backend::sync` module, behind the `sync` feature flag.
- `zcash_client_backend::wallet::Recipient::map_ephemeral_transparent_outpoint`

### Changed
- MSRV is now 1.70.0.
Expand All @@ -28,36 +48,47 @@ and this library adheres to Rust's notion of
`change_memo` is given, and defends against losing money by using
`DustAction::AddDustToFee` with a too-high dust threshold.
See [#1430](https://github.com/zcash/librustzcash/pull/1430) for details.
- `zcash_client_backend::zip321` has been extracted to, and is now a reexport
- `zcash_client_backend::zip321` has been extracted to, and is now a reexport
of the root module of the `zip321` crate. Several of the APIs of this module
have changed as a consequence of this extraction; please see the `zip321`
CHANGELOG for details.
- `zcash_client_backend::data_api`:
- `WalletRead` has new `get_reserved_ephemeral_addresses` and
`get_transparent_address_metadata` methods.
- `WalletWrite` has a new `reserve_next_n_ephemeral_addresses` method.
- `error::Error` has a new `Address` variant.
- `wallet::input_selection::InputSelectorError` has a new `Address` variant.
- `zcash_client_backend::proto::proposal::Proposal::{from_standard_proposal,
try_into_standard_proposal}` each no longer require a `consensus::Parameters`
argument.
- `zcash_client_backend::data_api::fees`
- The return type of `ChangeValue::output_pool`, and the type of the
`output_pool` argument to `ChangeValue::new`, have changed from
`ShieldedProtocol` to `zcash_protocol::PoolType`.
- The return type of `ChangeValue::new` is now optional; it returns `None`
if a memo is given for the transparent pool. Use `ChangeValue::shielded`
to avoid this error case when creating a `ChangeValue` known to be for a
shielded pool.
- When the "transparent-inputs" feature is enabled, `ChangeValue` can also
represent an ephemeral transparent output in a proposal. Accordingly, the
return type of `ChangeValue::output_pool` has (unconditionally) changed
from `ShieldedProtocol` to `zcash_protocol::PoolType`.
- `ChangeStrategy::compute_balance`: this trait method has an additional
`&EphemeralParameters` parameter when the "transparent-inputs" feature is
enabled. This can be used to specify whether the change memo should be
ignored, and the amounts of additional transparent P2PKH inputs and
outputs. Passing `&Default::default()` will retain the previous behaviour.
- `zcash_client_backend::input_selection::GreedyInputSelectorError` has a
new variant `UnsupportedTexAddress`.
- `zcash_client_backend::proto::ProposalDecodingError` has a new variant
`InvalidEphemeralRecipient`.
- `zcash_client_backend::wallet::Recipient` variants have changed. Instead of
wrapping protocol-address types, the `Recipient` type now wraps a
`zcash_address::ZcashAddress`. This simplifies the process of tracking the
original address to which value was sent.
wrapping protocol-address types, the `External` and `InternalAccount` variants
now wrap a `zcash_address::ZcashAddress`. This simplifies the process of
tracking the original address to which value was sent. There is also a new
`EphemeralTransparent` variant, and an additional generic parameter for the
type of metadata associated with an ephemeral transparent outpoint.

### Removed
- `zcash_client_backend::data_api`:
- `WalletRead::get_unspent_transparent_outputs` has been removed because its
semantics were unclear and could not be clarified. Use
`WalletRead::get_spendable_transparent_outputs` instead.
- `zcash_client_backend::fees::ChangeValue::new`. Use `ChangeValue::shielded`
or `ChangeValue::ephemeral_transparent` instead.

## [0.12.1] - 2024-03-27

Expand Down
25 changes: 16 additions & 9 deletions zcash_client_backend/proto/proposal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ message ReceivedOutput {
uint64 value = 4;
}

// A reference a payment in a prior step of the proposal. This payment must
// A reference to a payment in a prior step of the proposal. This payment must
// belong to the wallet.
message PriorStepOutput {
uint32 stepIndex = 1;
uint32 paymentIndex = 2;
}

// A reference a change output from a prior step of the proposal.
// A reference to a change or ephemeral output from a prior step of the proposal.
message PriorStepChange {
uint32 stepIndex = 1;
uint32 changeIndex = 2;
Expand Down Expand Up @@ -112,22 +112,29 @@ enum FeeRule {

// The proposed change outputs and fee value.
message TransactionBalance {
// A list of change output values.
// A list of change or ephemeral output values.
repeated ChangeValue proposedChange = 1;
// The fee to be paid by the proposed transaction, in zatoshis.
uint64 feeRequired = 2;
}

// A proposed change output. If the transparent value pool is selected,
// the `memo` field must be null.
// A proposed change or ephemeral output. If the transparent value pool is
// selected, the `memo` field must be null.
//
// When the `isEphemeral` field of a `ChangeValue` is set, it represents
// an ephemeral output, which must be spent by a subsequent step. This is
// only supported for transparent outputs. Each ephemeral output will be
// given a unique t-address.
message ChangeValue {
// The value of a change output to be created, in zatoshis.
// The value of a change or ephemeral output to be created, in zatoshis.
uint64 value = 1;
// The value pool in which the change output should be created.
// The value pool in which the change or ephemeral output should be created.
ValuePool valuePool = 2;
// The optional memo that should be associated with the newly created change output.
// Memos must not be present for transparent change outputs.
// The optional memo that should be associated with the newly created output.
// Memos must not be present for transparent outputs.
MemoBytes memo = 3;
// Whether this is to be an ephemeral output.
bool isEphemeral = 4;
daira marked this conversation as resolved.
Show resolved Hide resolved
}

// An object wrapper for memo bytes, to facilitate representing the
Expand Down
158 changes: 144 additions & 14 deletions zcash_client_backend/src/data_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@
consensus::BlockHeight,
memo::{Memo, MemoBytes},
transaction::{
components::amount::{BalanceError, NonNegativeAmount},
components::{
amount::{BalanceError, NonNegativeAmount},
OutPoint,
},
Transaction, TxId,
},
};

#[cfg(feature = "transparent-inputs")]
use {
crate::wallet::TransparentAddressMetadata,
zcash_primitives::{legacy::TransparentAddress, transaction::components::OutPoint},
};
use {crate::wallet::TransparentAddressMetadata, zcash_primitives::legacy::TransparentAddress};

#[cfg(any(test, feature = "test-dependencies"))]
use zcash_primitives::consensus::NetworkUpgrade;
Expand Down Expand Up @@ -890,10 +890,14 @@
query: NullifierQuery,
) -> Result<Vec<(Self::AccountId, orchard::note::Nullifier)>, Self::Error>;

/// Returns the set of all transparent receivers associated with the given account.
/// Returns the set of non-ephemeral transparent receivers associated with the given
/// account controlled by this wallet.
///
/// The set contains all non-ephemeral transparent receivers that are known to have
/// been derived under this account. Wallets should scan the chain for UTXOs sent to
/// these receivers.
daira marked this conversation as resolved.
Show resolved Hide resolved
///
/// The set contains all transparent receivers that are known to have been derived
/// under this account. Wallets should scan the chain for UTXOs sent to these
/// Use [`Self::get_reserved_ephemeral_addresses`] to obtain the ephemeral transparent
/// receivers.
#[cfg(feature = "transparent-inputs")]
fn get_transparent_receivers(
Expand All @@ -903,8 +907,11 @@
Ok(HashMap::new())
nuttycom marked this conversation as resolved.
Show resolved Hide resolved
}

/// Returns a mapping from transparent receiver to not-yet-shielded UTXO balance,
/// for each address associated with a nonzero balance.
/// Returns a mapping from each transparent receiver associated with the specified account
/// to its not-yet-shielded UTXO balance as of the end of the block at the provided
/// `max_height`, when that balance is non-zero.
///
/// Balances of ephemeral transparent addresses will not be included.
#[cfg(feature = "transparent-inputs")]
fn get_transparent_balances(
&self,
Expand All @@ -913,6 +920,78 @@
) -> Result<HashMap<TransparentAddress, NonNegativeAmount>, Self::Error> {
Ok(HashMap::new())
}

/// Returns the metadata associated with a given transparent receiver in an account
/// controlled by this wallet.
///
/// This is equivalent to (but may be implemented more efficiently than):
/// ```compile_fail
/// if let Some(result) = self.get_transparent_receivers(account)?.get(address) {
/// return Ok(result.clone());
daira marked this conversation as resolved.
Show resolved Hide resolved
/// }
/// if let Some(result) = self.get_reserved_ephemeral_addresses(account, false)?.get(address) {
/// return Ok(result.clone());
/// }
/// Ok(None)
/// ```
///
/// Returns `Ok(None)` if the address is not recognized, or we do not have metadata for it.
nuttycom marked this conversation as resolved.
Show resolved Hide resolved
/// Returns `Ok(Some(metadata))` if we have the metadata.
#[cfg(feature = "transparent-inputs")]
fn get_transparent_address_metadata(

Check warning on line 941 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L941

Added line #L941 was not covered by tests
&self,
account: Self::AccountId,
address: &TransparentAddress,
) -> Result<Option<TransparentAddressMetadata>, Self::Error> {
// This should be overridden.
if let Some(result) = self.get_transparent_receivers(account)?.get(address) {
return Ok(result.clone());

Check warning on line 948 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L947-L948

Added lines #L947 - L948 were not covered by tests
}
nuttycom marked this conversation as resolved.
Show resolved Hide resolved
if let Some(result) = self
.get_reserved_ephemeral_addresses(account, false)?
.get(address)

Check warning on line 952 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L950-L952

Added lines #L950 - L952 were not covered by tests
{
return Ok(result.clone());

Check warning on line 954 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L954

Added line #L954 was not covered by tests
}
Ok(None)

Check warning on line 956 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L956

Added line #L956 was not covered by tests
}

/// Returns the set of reserved ephemeral transparent addresses associated with the
/// given account controlled by this wallet.
///
/// The set contains all ephemeral transparent receivers that are known to have
/// been derived under this account. Wallets should scan the chain for UTXOs sent to
/// these receivers, but do not need to do so regularly. Under expected usage, outputs
/// would only be detected with these receivers in the following situations:
///
/// - This wallet created a payment to a ZIP 320 (TEX) address, but the second
/// transaction (that spent the output sent to the ephemeral address) did not get
/// mined before it expired.
/// - In this case the output will already be known to the wallet (because it
/// stores the transactions that it creates).
///
/// - Another wallet app using the same seed phrase created a payment to a ZIP 320
/// address, and this wallet queried for the ephemeral UTXOs after the first
/// transaction was mined but before the second transaction was mined.
/// - In this case, the output should not be considered unspent until the expiry
/// height of the transaction it was received in has passed. Wallets creating
/// payments to TEX addresses generally set the same expiry height for the first
/// and second transactions, meaning that this wallet does not need to observe
/// the second transaction to determine when it would have expired.
///
/// - A TEX address recipient decided to return funds that the wallet had sent to
/// them.
///
/// In all cases, the wallet should re-shield the unspent outputs, in a separate
/// transaction per ephemeral address, before re-spending the funds.
#[cfg(feature = "transparent-inputs")]
fn get_reserved_ephemeral_addresses(

Check warning on line 988 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L988

Added line #L988 was not covered by tests
daira marked this conversation as resolved.
Show resolved Hide resolved
&self,
_account: Self::AccountId,
_for_detection: bool,
daira marked this conversation as resolved.
Show resolved Hide resolved
) -> Result<HashMap<TransparentAddress, Option<TransparentAddressMetadata>>, Self::Error> {
Ok(HashMap::new())

Check warning on line 993 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L993

Added line #L993 was not covered by tests
daira marked this conversation as resolved.
Show resolved Hide resolved
}
}

/// The relevance of a seed to a given wallet.
Expand Down Expand Up @@ -1243,7 +1322,7 @@
/// This type is capable of representing both shielded and transparent outputs.
pub struct SentTransactionOutput<AccountId> {
output_index: usize,
recipient: Recipient<AccountId, Note>,
recipient: Recipient<AccountId, Note, OutPoint>,
value: NonNegativeAmount,
memo: Option<MemoBytes>,
}
Expand All @@ -1260,7 +1339,7 @@
/// * `memo` - the memo that was sent with this output
pub fn from_parts(
output_index: usize,
recipient: Recipient<AccountId, Note>,
recipient: Recipient<AccountId, Note, OutPoint>,
value: NonNegativeAmount,
memo: Option<MemoBytes>,
) -> Self {
Expand All @@ -1282,8 +1361,8 @@
self.output_index
}
/// Returns the recipient address of the transaction, or the account id and
/// resulting note for wallet-internal outputs.
pub fn recipient(&self) -> &Recipient<AccountId, Note> {
/// resulting note/outpoint for wallet-internal outputs.
pub fn recipient(&self) -> &Recipient<AccountId, Note, OutPoint> {
&self.recipient
}
/// Returns the value of the newly created output.
Expand Down Expand Up @@ -1542,6 +1621,28 @@
///
/// There may be restrictions on heights to which it is possible to truncate.
fn truncate_to_height(&mut self, block_height: BlockHeight) -> Result<(), Self::Error>;

/// Reserves the next `n` available ephemeral addresses for the given account.
/// This cannot be undone, so as far as possible, errors associated with transaction
/// construction should have been reported before calling this method.
///
/// To ensure that sufficient information is stored on-chain to allow recovering
/// funds sent back to any of the used addresses, a "gap limit" of 20 addresses
/// should be observed as described in [BIP 44].
///
/// Returns an error if there is insufficient space within the gap limit to allocate
/// the given number of addresses, or if the account identifier does not correspond
/// to a known account.
///
/// Precondition: `n < 0x80000000`
///
/// [BIP 44]: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#user-content-Address_gap_limit
#[cfg(feature = "transparent-inputs")]
fn reserve_next_n_ephemeral_addresses(
&mut self,
account_id: Self::AccountId,
n: u32,
) -> Result<Vec<(TransparentAddress, TransparentAddressMetadata)>, Self::Error>;
daira marked this conversation as resolved.
Show resolved Hide resolved
}

/// This trait describes a capability for manipulating wallet note commitment trees.
Expand Down Expand Up @@ -1869,6 +1970,25 @@
) -> Result<HashMap<TransparentAddress, NonNegativeAmount>, Self::Error> {
Ok(HashMap::new())
}

#[cfg(feature = "transparent-inputs")]
fn get_transparent_address_metadata(

Check warning on line 1975 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L1975

Added line #L1975 was not covered by tests
&self,
_account: Self::AccountId,
_address: &TransparentAddress,
) -> Result<Option<TransparentAddressMetadata>, Self::Error> {
Ok(None)

Check warning on line 1980 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L1980

Added line #L1980 was not covered by tests
}

#[cfg(feature = "transparent-inputs")]
fn get_reserved_ephemeral_addresses(

Check warning on line 1984 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L1984

Added line #L1984 was not covered by tests
&self,
_account: Self::AccountId,
_for_detection: bool,
) -> Result<HashMap<TransparentAddress, Option<TransparentAddressMetadata>>, Self::Error>
{
Ok(HashMap::new())

Check warning on line 1990 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L1990

Added line #L1990 was not covered by tests
}
}

impl WalletWrite for MockWalletDb {
Expand Down Expand Up @@ -1931,6 +2051,16 @@
) -> Result<Self::UtxoRef, Self::Error> {
Ok(0)
}

#[cfg(feature = "transparent-inputs")]
fn reserve_next_n_ephemeral_addresses(

Check warning on line 2056 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L2056

Added line #L2056 was not covered by tests
&mut self,
_account_id: Self::AccountId,
n: u32,
) -> Result<Vec<(TransparentAddress, TransparentAddressMetadata)>, Self::Error> {
assert!(n < 0x80000000);
Err(())

Check warning on line 2062 in zcash_client_backend/src/data_api.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_backend/src/data_api.rs#L2061-L2062

Added lines #L2061 - L2062 were not covered by tests
}
}

impl WalletCommitmentTrees for MockWalletDb {
Expand Down
Loading
Loading