Skip to main content

Sigops

Trait Sigops 

Source
pub trait Sigops {
    // Required method
    fn scripts(&self) -> Vec<Vec<u8>>;

    // Provided method
    fn sigops(&self) -> Result<u32, Error> { ... }
}
Expand description

Trait for counting the number of transparent signature operations in the transparent inputs and outputs of a transaction.

Mirrors zcashd’s GetLegacySigOpCount().

All transparent inputs are included, including the coinbase input script. zcashd charges coinbase scriptSig sigops against the block MAX_BLOCK_SIGOPS limit, so Zebra must do the same to avoid a consensus split.

Required Methods§

Source

fn scripts(&self) -> Vec<Vec<u8>>

Returns the input and output scripts in the transaction as owned byte vectors.

For consensus sigop accounting, this must include the coinbase input script (height prefix followed by extra data), matching zcashd’s GetLegacySigOpCount().

Provided Methods§

Source

fn sigops(&self) -> Result<u32, Error>

Returns the number of transparent signature operations in the transparent inputs and outputs of the given transaction.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Sigops for Transaction

Source§

fn scripts(&self) -> Vec<Vec<u8>>

Source§

impl Sigops for Transaction

Source§

fn scripts(&self) -> Vec<Vec<u8>>

Source§

impl Sigops for UnminedTx

Source§

fn scripts(&self) -> Vec<Vec<u8>>

Implementors§