pub enum TransactionDataRequest {
GetStatus(TxId),
Enhancement(TxId),
TransactionsInvolvingAddress(TransactionsInvolvingAddress),
GetSpendingTx(OutPoint),
}Expand description
A request for transaction data enhancement, spentness check, or discovery of spends from a given transparent address within a specific block range.
Variants§
GetStatus(TxId)
Information about the chain’s view of a transaction is requested.
The caller evaluating this request on behalf of the wallet backend should respond to this
request by determining the status of the specified transaction with respect to the main
chain; if using lightwalletd for access to chain data, this may be obtained by
interpreting the results of the GetTransaction RPC method. It should then call
WalletWrite::set_transaction_status to provide the resulting transaction status
information to the wallet backend.
Enhancement(TxId)
Transaction enhancement (download of complete raw transaction data) is requested.
The caller evaluating this request on behalf of the wallet backend should respond to this
request by providing complete data for the specified transaction to
wallet::decrypt_and_store_transaction; if using lightwalletd for access to chain
state, this may be obtained via the GetTransaction RPC method. If no data is available
for the specified transaction, this should be reported to the backend using
WalletWrite::set_transaction_status. A TransactionDataRequest::Enhancement request
subsumes any previously existing TransactionDataRequest::GetStatus request.
TransactionsInvolvingAddress(TransactionsInvolvingAddress)
transparent-inputs only.Information about transactions that receive or spend funds belonging to the specified transparent address is requested.
Fully transparent transactions, and transactions that do not contain either shielded inputs
or shielded outputs belonging to the wallet, may not be discovered by the process of
out-of-order chain scanning due to race conditions related to advancing the transparent
address gap limit; as a consequence, the wallet must actively query to find transactions
that spend such funds. Ideally we’d be able to query by [OutPoint] but this is not
currently functionality that is supported by the light wallet server; for full-node wallets
or other arrangements that allow privacy-preserving retrieval of individually identifying
information such as backends that support private information retrieval (PIR) consider
enabling the spend-index feature.
The caller evaluating this request on behalf of the wallet backend should respond to this
request by detecting transactions involving the specified address within the provided block
range; if using lightwalletd for access to chain data, this may be performed using the
GetTaddressTxids RPC method. It should then call wallet::decrypt_and_store_transaction
for each transaction so detected. If no transactions are detected within the given range,
the caller should instead invoke WalletWrite::notify_address_checked with
block_end_height - 1 as the as_of_height argument.
GetSpendingTx(OutPoint)
spend-index only.The main-chain transaction that spends of a specific transparent output, or confirmation that the output remains unspent, is requested.
When the spend-index feature is enabled, GetSpendingTx requests will be emitted by the
backend instead of TransactionDataRequest::TransactionsInvolvingAddress, in
circumstances when spentness determination is needed. This feature should only be enabled
for wallets whose chain-data source can resolve the spend of an individual outpoint
directly — for example a full node that maintains a spent-outpoint index. It avoids needing
to retrieve potentially large amounts of transaction history (in the cas of a
heavily-reused address) just to discover whether one output was spent.
The caller evaluating this request on behalf of the wallet backend should determine whether
outpoint has been spent on the main chain. Spentness should be taken from an
authoritative source (e.g. the node’s UTXO set); the spend index is used only to identify
the spending transaction. If the output is spent, the caller should provide the spending
transaction to wallet::decrypt_and_store_transaction. If the output is confirmed
unspent as of some height, the caller should invoke
WalletWrite::notify_output_verified_unspent with that height. If the output is known to
be spent but the spending transaction cannot yet be resolved (e.g. an index is still being
built — see ZcashFoundation/zebra#10806), the caller should do nothing, so that the request
is re-issued and retried later.
Implementations§
Source§impl TransactionDataRequest
impl TransactionDataRequest
Sourcepub fn transactions_involving_address(
address: TransparentAddress,
block_range_start: BlockHeight,
block_range_end: Option<BlockHeight>,
request_at: Option<SystemTime>,
tx_status_filter: TransactionStatusFilter,
output_status_filter: OutputStatusFilter,
) -> Self
Available on crate feature transparent-inputs only.
pub fn transactions_involving_address( address: TransparentAddress, block_range_start: BlockHeight, block_range_end: Option<BlockHeight>, request_at: Option<SystemTime>, tx_status_filter: TransactionStatusFilter, output_status_filter: OutputStatusFilter, ) -> Self
transparent-inputs only.Constructs a request for Information about transactions that receive or spend funds belonging to the specified transparent address.
§Parameters:
address: The address to request transactions and/or UTXOs for.block_range_start: Only transactions mined at heights greater than or equal to this height should be returned.block_range_end: Only transactions mined at heights less than this height should be returned.request_at: If arequest_attime is set, the caller evaluating this request should attempt to retrieve transaction data related to the specified address at a time that is as close as practical to the specified instant, and in a fashion that decorrelates this request to a light wallet server from other requests made by the same caller. This may be ignored by callers that are able to satisfy the request without exposing correlations between addresses to untrusted parties; for example, a wallet application that uses a private, trusted-for-privacy supplier of chain data can safely ignore this field.tx_status_filter: The caller should respond to this request only with transactions that conform to the specified transaction status filter.- `output_status_filter: The caller should respond to this request only with transactions containing outputs that conform to the specified output status filter.
See TransactionDataRequest::TransactionsInvolvingAddress for more information.
Trait Implementations§
Source§impl Clone for TransactionDataRequest
impl Clone for TransactionDataRequest
Source§impl Debug for TransactionDataRequest
impl Debug for TransactionDataRequest
impl Eq for TransactionDataRequest
Source§impl Hash for TransactionDataRequest
impl Hash for TransactionDataRequest
Source§impl Ord for TransactionDataRequest
impl Ord for TransactionDataRequest
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TransactionDataRequest
impl PartialEq for TransactionDataRequest
Source§impl PartialOrd for TransactionDataRequest
impl PartialOrd for TransactionDataRequest
impl StructuralPartialEq for TransactionDataRequest
Auto Trait Implementations§
impl Freeze for TransactionDataRequest
impl RefUnwindSafe for TransactionDataRequest
impl Send for TransactionDataRequest
impl Sync for TransactionDataRequest
impl Unpin for TransactionDataRequest
impl UnsafeUnpin for TransactionDataRequest
impl UnwindSafe for TransactionDataRequest
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PossiblyOption<T> for T
impl<T> PossiblyOption<T> for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.