Trait CovOperations

Source
pub trait CovOperations: Sized {
    // Required methods
    fn chk_size(self, len: usize) -> Self;
    fn chk_amt(self) -> Self;
    fn verify_cov(self, key: &PublicKey) -> Self;
    fn post_codesep_script(self) -> Self;
}
Expand description

Additional operations required on script builder for Covenant operations support

Required Methods§

Source

fn chk_size(self, len: usize) -> Self

Assert that the size of top stack elem is len

Source

fn chk_amt(self) -> Self

Assert that the top item is a valid confidential Amount If it starts with 1, the len must be 9, otherwise the len must be 33

Source

fn verify_cov(self, key: &PublicKey) -> Self

Assuming the 10 sighash components + 1 sig on the top of stack for segwit sighash as created by init_stack CAT all of them and check sig from stack

Source

fn post_codesep_script(self) -> Self

Get the script code for the covenant script assuming the above construction of covenants which uses OP_CODESEP

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 CovOperations for Builder

Source§

fn post_codesep_script(self) -> Self

The second parameter decides whether the script code should a hashlock verifying the entire script

Source§

fn chk_size(self, len: usize) -> Self

Source§

fn chk_amt(self) -> Self

Source§

fn verify_cov(self, key: &PublicKey) -> Self

Implementors§