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 duplicate 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
impl Copy for SurjectionInput
impl Eq for SurjectionInput
impl StructuralPartialEq for SurjectionInput
Auto Trait Implementations§
impl Freeze for SurjectionInput
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