Trait Primitives

Source
pub trait Primitives: NodePrimitives {
    type ChainSpec: 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;
}

Required Associated Types§

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,

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>

Implementors§