Trait tributary_chain::transaction::Transaction

source ·
pub trait Transaction: 'static + Send + Sync + Clone + Eq + Debug + ReadWrite {
    // Required methods
    fn kind(&self) -> TransactionKind<'_>;
    fn hash(&self) -> [u8; 32];
    fn verify(&self) -> Result<(), TransactionError>;

    // Provided method
    fn sig_hash(&self, genesis: [u8; 32]) -> <Ristretto as Ciphersuite>::F { ... }
}

Required Methods§

source

fn kind(&self) -> TransactionKind<'_>

Return what type of transaction this is.

source

fn hash(&self) -> [u8; 32]

Return the hash of this transaction.

The hash must NOT commit to the signature.

source

fn verify(&self) -> Result<(), TransactionError>

Perform transaction-specific verification.

Provided Methods§

source

fn sig_hash(&self, genesis: [u8; 32]) -> <Ristretto as Ciphersuite>::F

Obtain the challenge for this transaction’s signature.

Do not override this unless you know what you’re doing.

Panics if called on non-signed transactions.

Object Safety§

This trait is not object safe.

Implementors§