Trait Primitives

Source
pub trait Primitives: NodePrimitives {
    type ChainSpec: EthChainSpec + Debug;
    type HaltReason: Debug;

    // Required methods
    fn build_spec(
        genesis: &Genesis,
    ) -> Result<Arc<Self::ChainSpec>, ClientError>;
    fn validate_header(
        header: &SealedHeader,
        chain_spec: Arc<Self::ChainSpec>,
    ) -> Result<(), ConsensusError>;
    fn transact<DB>(
        input: &ContractInput,
        db: DB,
        header: &Header,
        difficulty: U256,
        chain_spec: Arc<Self::ChainSpec>,
    ) -> Result<ResultAndState<Self::HaltReason>, String>
       where DB: Database;
    fn active_fork_name(chain_spec: &Self::ChainSpec, header: &Header) -> String;
}

Required Associated Types§

Source

type ChainSpec: EthChainSpec + Debug

Source

type HaltReason: Debug

Required Methods§

Source

fn build_spec(genesis: &Genesis) -> Result<Arc<Self::ChainSpec>, ClientError>

Source

fn validate_header( header: &SealedHeader, chain_spec: Arc<Self::ChainSpec>, ) -> Result<(), ConsensusError>

Source

fn transact<DB>( input: &ContractInput, db: DB, header: &Header, difficulty: U256, chain_spec: Arc<Self::ChainSpec>, ) -> Result<ResultAndState<Self::HaltReason>, String>
where DB: Database,

Source

fn active_fork_name(chain_spec: &Self::ChainSpec, header: &Header) -> String

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 Primitives for EthPrimitives

Source§

type ChainSpec = ChainSpec

Source§

type HaltReason = HaltReason

Source§

fn build_spec(genesis: &Genesis) -> Result<Arc<Self::ChainSpec>, ClientError>

Source§

fn validate_header( header: &SealedHeader, chain_spec: Arc<Self::ChainSpec>, ) -> Result<(), ConsensusError>

Source§

fn transact<DB: Database>( input: &ContractInput, db: DB, header: &Header, difficulty: U256, chain_spec: Arc<Self::ChainSpec>, ) -> Result<ResultAndState<Self::HaltReason>, String>

Source§

fn active_fork_name(chain_spec: &Self::ChainSpec, header: &Header) -> String

Implementors§