Enum chain_impl_mockchain::transaction::Witness
source · pub enum Witness {
Utxo(SpendingSignature<WitnessUtxoData>),
Account(SpendingCounter, Witness),
OldUtxo(PublicKey<Ed25519>, [u8; 32], Signature<WitnessUtxoData, Ed25519>),
Multisig(SpendingCounter, Witness),
}
Expand description
Structure that proofs that certain user agrees with
some data. This structure is used to sign Transaction
and get SignedTransaction
out.
It’s important that witness works with opaque structures and may not know the contents of the internal transaction.
Variants§
Utxo(SpendingSignature<WitnessUtxoData>)
Account(SpendingCounter, Witness)
OldUtxo(PublicKey<Ed25519>, [u8; 32], Signature<WitnessUtxoData, Ed25519>)
Multisig(SpendingCounter, Witness)
Implementations§
source§impl Witness
impl Witness
sourcepub fn new_utxo_data(
block0: &HeaderId,
sign_data_hash: &TransactionSignDataHash
) -> WitnessUtxoData
pub fn new_utxo_data( block0: &HeaderId, sign_data_hash: &TransactionSignDataHash ) -> WitnessUtxoData
Creates new Witness
value.
pub fn new_utxo<F>( block0: &HeaderId, sign_data_hash: &TransactionSignDataHash, sign: F ) -> Selfwhere F: FnOnce(&WitnessUtxoData) -> Signature<WitnessUtxoData, Ed25519>,
pub fn new_old_utxo_data( block0: &HeaderId, sign_data_hash: &TransactionSignDataHash ) -> WitnessUtxoData
pub fn new_old_utxo<F>( block0: &HeaderId, sign_data_hash: &TransactionSignDataHash, sign: F, some_bytes: &[u8; 32] ) -> Selfwhere F: FnOnce(&WitnessUtxoData) -> (PublicKey<Ed25519>, Signature<WitnessUtxoData, Ed25519>),
pub fn new_account_data( block0: &HeaderId, sign_data_hash: &TransactionSignDataHash, spending_counter: SpendingCounter ) -> WitnessAccountData
pub fn new_account<F>( block0: &HeaderId, sign_data_hash: &TransactionSignDataHash, spending_counter: SpendingCounter, sign: F ) -> Selfwhere F: FnOnce(&WitnessAccountData) -> Witness,
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Trait Implementations§
source§impl DeserializeFromSlice for Witness
impl DeserializeFromSlice for Witness
fn deserialize_from_slice(codec: &mut Codec<&[u8]>) -> Result<Self, ReadError>
fn deserialize_validate_from_slice( codec: &mut Codec<&[u8]> ) -> Result<(), ReadError>
source§impl Serialize for Witness
impl Serialize for Witness
impl Eq for Witness
Auto Trait Implementations§
impl RefUnwindSafe for Witness
impl Send for Witness
impl Sync for Witness
impl Unpin for Witness
impl UnwindSafe for Witness
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