pub trait TestFvk: Clone {
type Nullifier: Copy;
// Required methods
fn sapling_ovk(&self) -> Option<OutgoingViewingKey>;
fn orchard_ovk(&self, scope: Scope) -> Option<OutgoingViewingKey>;
fn add_spend<R: RngCore + CryptoRng>(
&self,
ctx: &mut CompactTx,
nf: Self::Nullifier,
rng: &mut R,
);
fn add_output<P: Parameters, R: RngCore + CryptoRng>(
&self,
ctx: &mut CompactTx,
params: &P,
height: BlockHeight,
req: AddressType,
value: Zatoshis,
initial_sapling_tree_size: u32,
rng: &mut R,
) -> Self::Nullifier;
fn add_logical_action<P: Parameters, R: RngCore + CryptoRng>(
&self,
ctx: &mut CompactTx,
params: &P,
height: BlockHeight,
nf: Self::Nullifier,
req: AddressType,
value: Zatoshis,
initial_sapling_tree_size: u32,
rng: &mut R,
) -> Self::Nullifier;
}
test-dependencies
only.Expand description
Trait used by tests that require a full viewing key.
Required Associated Types§
Required Methods§
Sourcefn sapling_ovk(&self) -> Option<OutgoingViewingKey>
fn sapling_ovk(&self) -> Option<OutgoingViewingKey>
Returns the Sapling outgoing viewing key corresponding to this full viewing key, if any.
Sourcefn orchard_ovk(&self, scope: Scope) -> Option<OutgoingViewingKey>
Available on crate feature orchard
only.
fn orchard_ovk(&self, scope: Scope) -> Option<OutgoingViewingKey>
orchard
only.Returns the Orchard outgoing viewing key corresponding to this full viewing key, if any.
Sourcefn add_spend<R: RngCore + CryptoRng>(
&self,
ctx: &mut CompactTx,
nf: Self::Nullifier,
rng: &mut R,
)
fn add_spend<R: RngCore + CryptoRng>( &self, ctx: &mut CompactTx, nf: Self::Nullifier, rng: &mut R, )
Adds a single spend to the given CompactTx
of a note previously received by
this full viewing key.
Sourcefn add_output<P: Parameters, R: RngCore + CryptoRng>(
&self,
ctx: &mut CompactTx,
params: &P,
height: BlockHeight,
req: AddressType,
value: Zatoshis,
initial_sapling_tree_size: u32,
rng: &mut R,
) -> Self::Nullifier
fn add_output<P: Parameters, R: RngCore + CryptoRng>( &self, ctx: &mut CompactTx, params: &P, height: BlockHeight, req: AddressType, value: Zatoshis, initial_sapling_tree_size: u32, rng: &mut R, ) -> Self::Nullifier
Adds a single output to the given CompactTx
that will be received by this full
viewing key.
req
allows configuring how the full viewing key will detect the output.
Sourcefn add_logical_action<P: Parameters, R: RngCore + CryptoRng>(
&self,
ctx: &mut CompactTx,
params: &P,
height: BlockHeight,
nf: Self::Nullifier,
req: AddressType,
value: Zatoshis,
initial_sapling_tree_size: u32,
rng: &mut R,
) -> Self::Nullifier
fn add_logical_action<P: Parameters, R: RngCore + CryptoRng>( &self, ctx: &mut CompactTx, params: &P, height: BlockHeight, nf: Self::Nullifier, req: AddressType, value: Zatoshis, initial_sapling_tree_size: u32, rng: &mut R, ) -> Self::Nullifier
Adds both a spend and an output to the given CompactTx
.
- If this is a Sapling full viewing key, the transaction will gain both a Spend and an Output.
- If this is an Orchard full viewing key, the transaction will gain an Action.
req
allows configuring how the full viewing key will detect the output.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl TestFvk for FullViewingKey
Available on crate feature orchard
only.
impl TestFvk for FullViewingKey
orchard
only.type Nullifier = Nullifier
fn sapling_ovk(&self) -> Option<OutgoingViewingKey>
fn orchard_ovk(&self, scope: Scope) -> Option<OutgoingViewingKey>
fn add_spend<R: RngCore + CryptoRng>( &self, ctx: &mut CompactTx, revealed_spent_note_nullifier: Self::Nullifier, rng: &mut R, )
fn add_output<P: Parameters, R: RngCore + CryptoRng>( &self, ctx: &mut CompactTx, _: &P, _: BlockHeight, req: AddressType, value: Zatoshis, _: u32, rng: &mut R, ) -> Self::Nullifier
fn add_logical_action<P: Parameters, R: RngCore + CryptoRng>( &self, ctx: &mut CompactTx, _: &P, _: BlockHeight, revealed_spent_note_nullifier: Self::Nullifier, address_type: AddressType, value: Zatoshis, _: u32, rng: &mut R, ) -> Self::Nullifier
Source§impl<A: TestFvk> TestFvk for &A
impl<A: TestFvk> TestFvk for &A
type Nullifier = <A as TestFvk>::Nullifier
fn sapling_ovk(&self) -> Option<OutgoingViewingKey>
Source§fn orchard_ovk(&self, scope: Scope) -> Option<OutgoingViewingKey>
fn orchard_ovk(&self, scope: Scope) -> Option<OutgoingViewingKey>
orchard
only.