Skip to main content

Sigops

Trait Sigops 

Source
pub trait Sigops {
    // Required method
    fn scripts(&self) -> impl Iterator<Item = 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) -> impl Iterator<Item = Vec<u8>>

Returns an iterator over the input and output scripts in the transaction.

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 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 Sigops for Transaction

Source§

fn scripts(&self) -> impl Iterator<Item = Vec<u8>>

Source§

impl Sigops for Transaction

Source§

fn scripts(&self) -> impl Iterator<Item = Vec<u8>>

Source§

impl Sigops for UnminedTx

Source§

fn scripts(&self) -> impl Iterator<Item = Vec<u8>>

Implementors§