Skip to main content

Environment

Trait Environment 

Source
pub trait Environment: AutoTraits {
    type Storage: Storage<Context = Self::StorageContext>;
    type Network: Network<Node = Self::ValidatorNode>;
    type Signer: Signer;
    type Wallet: Wallet;
    type ValidatorNode: ValidatorNode + AutoTraits + Clone;
    type StorageContext: Context<Extra: ExecutionRuntimeContext> + AutoTraits;

    // Required methods
    fn storage(&self) -> &Self::Storage;
    fn network(&self) -> &Self::Network;
    fn signer(&self) -> &Self::Signer;
    fn wallet(&self) -> &Self::Wallet;
}
Expand description

The collection of services (storage, network, signer and wallet) available to the client.

Required Associated Types§

Source

type Storage: Storage<Context = Self::StorageContext>

The persistent storage backend.

Source

type Network: Network<Node = Self::ValidatorNode>

The provider of validator nodes.

Source

type Signer: Signer

The signer used to sign on behalf of chain owners.

Source

type Wallet: Wallet

The wallet tracking the chains followed by the client.

Source

type ValidatorNode: ValidatorNode + AutoTraits + Clone

The validator node type produced by the network provider.

Source

type StorageContext: Context<Extra: ExecutionRuntimeContext> + AutoTraits

The storage context used by the storage backend.

Required Methods§

Source

fn storage(&self) -> &Self::Storage

Returns a reference to the storage backend.

Source

fn network(&self) -> &Self::Network

Returns a reference to the network provider.

Source

fn signer(&self) -> &Self::Signer

Returns a reference to the signer.

Source

fn wallet(&self) -> &Self::Wallet

Returns a reference to the wallet.

Implementors§