pub trait OnChainConfig: Send + Sync + DeserializeOwned {
    const IDENTIFIER: &'static str;
    const ADDRESS: &'static str = CONFIG_ADDRESS_STR;
    const CONFIG_ID: ConfigID = ConfigID(Self::ADDRESS, Self::IDENTIFIER);

    // Provided methods
    fn deserialize_default_impl(bytes: &[u8]) -> Result<Self, Error> { ... }
    fn deserialize_into_config(bytes: &[u8]) -> Result<Self, Error> { ... }
    fn fetch_config<T>(storage: &T) -> Option<Self>
       where T: ConfigStorage { ... }
}
Expand description

Trait to be implemented by a Rust struct representation of an on-chain config that is stored in storage as a serialized byte array

Required Associated Constants§

const IDENTIFIER: &'static str

Provided Associated Constants§

const ADDRESS: &'static str = CONFIG_ADDRESS_STR

const CONFIG_ID: ConfigID = ConfigID(Self::ADDRESS, Self::IDENTIFIER)

Provided Methods§

fn deserialize_default_impl(bytes: &[u8]) -> Result<Self, Error>

fn deserialize_into_config(bytes: &[u8]) -> Result<Self, Error>

fn fetch_config<T>(storage: &T) -> Option<Self>where T: ConfigStorage,

Implementors§

§

impl OnChainConfig for OnChainConsensusConfig

§

const IDENTIFIER: &'static str = "DiemConsensusConfig"

§

impl OnChainConfig for Limit

§

const IDENTIFIER: &'static str = "Limit"

§

impl OnChainConfig for DiemVersion

§

const IDENTIFIER: &'static str = "DiemVersion"

§

impl OnChainConfig for RegisteredCurrencies

§

const IDENTIFIER: &'static str = "RegisteredCurrencies"

§

impl OnChainConfig for VMConfig

§

const IDENTIFIER: &'static str = "DiemVMConfig"

§

impl OnChainConfig for VMPublishingOption

§

const IDENTIFIER: &'static str = "DiemTransactionPublishingOption"

§

impl OnChainConfig for ValidatorSet

§

const IDENTIFIER: &'static str = "DiemSystem"