Enum elements::SurjectionInput
source · pub enum SurjectionInput {
Unknown(Asset),
Known {
asset: AssetId,
asset_bf: AssetBlindingFactor,
},
}
Expand description
Data structure used to provide inputs to SurjectionProof
methods.
Inputs for which we don’t know the secrets can be SurjectionInput::Unknown
,
while inputs from user’s wallet should be SurjectionInput::Known
Explicit assets can be provided as SurjectionInput::Unknown
. There is no
need to construct a Known
variant with secrets
Variants§
Unknown(Asset)
Unknown inputs for whom we don’t know the secrets(asset tags/blinding factors)
Known
Known inputs for whom we know blinding factors
Implementations§
source§impl SurjectionInput
impl SurjectionInput
sourcepub fn from_comm(asset: Asset) -> Self
pub fn from_comm(asset: Asset) -> Self
Creates a new SurjectionInput
from commitment
sourcepub fn from_txout_secrets(secrets: TxOutSecrets) -> Self
pub fn from_txout_secrets(secrets: TxOutSecrets) -> Self
Creates a new SurjectionInput
from TxOutSecrets
sourcepub fn surjection_target<C: Signing>(
&self,
secp: &Secp256k1<C>
) -> Result<(Generator, Tag, Tweak), TxOutError>
pub fn surjection_target<C: Signing>( &self, secp: &Secp256k1<C> ) -> Result<(Generator, Tag, Tweak), TxOutError>
Handy method to convert SurjectionInput
into a surjection target
that can be used while creating a new SurjectionProof.
Only errors when the input asset is Null.
Trait Implementations§
source§impl Clone for SurjectionInput
impl Clone for SurjectionInput
source§fn clone(&self) -> SurjectionInput
fn clone(&self) -> SurjectionInput
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SurjectionInput
impl Debug for SurjectionInput
source§impl From<Asset> for SurjectionInput
impl From<Asset> for SurjectionInput
source§impl From<TxOutSecrets> for SurjectionInput
impl From<TxOutSecrets> for SurjectionInput
source§fn from(v: TxOutSecrets) -> Self
fn from(v: TxOutSecrets) -> Self
Converts to this type from the input type.
source§impl Hash for SurjectionInput
impl Hash for SurjectionInput
source§impl PartialEq for SurjectionInput
impl PartialEq for SurjectionInput
source§fn eq(&self, other: &SurjectionInput) -> bool
fn eq(&self, other: &SurjectionInput) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for SurjectionInput
impl Eq for SurjectionInput
impl StructuralPartialEq for SurjectionInput
Auto Trait Implementations§
impl RefUnwindSafe for SurjectionInput
impl Send for SurjectionInput
impl Sync for SurjectionInput
impl Unpin for SurjectionInput
impl UnwindSafe for SurjectionInput
Blanket Implementations§
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
Mutably borrows from an owned value. Read more