referrerpolicy=no-referrer-when-downgrade
pub trait AsTransactionAuthorizedOrigin {
    // Required method
    fn is_transaction_authorized(&self) -> bool;
}
Expand description

Interface to differentiate between Runtime Origins authorized to include a transaction into the block and dispatch it, and those who aren’t.

This trait targets transactions, by which we mean extrinsics which are validated through a TransactionExtension. This excludes bare extrinsics (i.e. inherents), which have their call, not their origin, validated and authorized.

Typically, upon validation or application of a transaction, the origin resulting from the transaction extension (see TransactionExtension) is checked for authorization. The transaction is then rejected or applied.

In FRAME, an authorized origin is either an Origin::Signed System origin or a custom origin authorized in a TransactionExtension.

Required Methods§

source

fn is_transaction_authorized(&self) -> bool

Whether the origin is authorized to include a transaction in a block.

In typical FRAME chains, this function returns false if the origin is a System Origin::None variant, true otherwise, meaning only signed or custom origin resulting from the transaction extension pipeline are authorized.

NOTE: This function should not be used in the context of bare extrinsics (i.e. inherents), as bare extrinsics do not authorize the origin but rather the call itself, and are not validated through the TransactionExtension pipeline.

Implementors§