referrerpolicy=no-referrer-when-downgrade
bp_runtime

Type Alias TransactionEraOf

Source
pub type TransactionEraOf<C> = TransactionEra<BlockNumberOf<C>, HashOf<C>>;
Expand description

Transaction era used by the chain.

Aliased Type§

enum TransactionEraOf<C> {
    Immortal,
    Mortal(HeaderId<<C as Chain>::Hash, <C as Chain>::BlockNumber>, u32),
}

Variants§

§

Immortal

Transaction is immortal.

§

Mortal(HeaderId<<C as Chain>::Hash, <C as Chain>::BlockNumber>, u32)

Transaction is valid for a given number of blocks, starting from given block.

Implementations

Source§

impl<BlockNumber: Copy + UniqueSaturatedInto<u64>, BlockHash: Copy> TransactionEra<BlockNumber, BlockHash>

Source

pub fn new( best_block_id: HeaderId<BlockHash, BlockNumber>, mortality_period: Option<u32>, ) -> Self

Prepare transaction era, based on mortality period and current best block number.

Source

pub fn immortal() -> Self

Create new immortal transaction era.

Source

pub fn mortality_period(&self) -> Option<u32>

Returns mortality period if transaction is mortal.

Source

pub fn frame_era(&self) -> Era

Returns era that is used by FRAME-based runtimes.

Source

pub fn signed_payload(&self, genesis_hash: BlockHash) -> BlockHash

Returns header hash that needs to be included in the signature payload.

Trait Implementations

Source§

impl<BlockNumber: Clone, BlockHash: Clone> Clone for TransactionEra<BlockNumber, BlockHash>

Source§

fn clone(&self) -> TransactionEra<BlockNumber, BlockHash>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<BlockNumber, BlockHash> Debug for TransactionEra<BlockNumber, BlockHash>
where BlockNumber: Debug, BlockHash: Debug,

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<BlockNumber: PartialEq, BlockHash: PartialEq> PartialEq for TransactionEra<BlockNumber, BlockHash>

Source§

fn eq(&self, other: &TransactionEra<BlockNumber, BlockHash>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<BlockNumber: Copy, BlockHash: Copy> Copy for TransactionEra<BlockNumber, BlockHash>

Source§

impl<BlockNumber, BlockHash> StructuralPartialEq for TransactionEra<BlockNumber, BlockHash>