pub trait ConstantAddress {
    type Target: DecodeWithMetadata;

    // Required methods
    fn pallet_name(&self) -> &str;
    fn constant_name(&self) -> &str;

    // Provided method
    fn validation_hash(&self) -> Option<[u8; 32]> { ... }
}
Expand description

This represents a constant address. Anything implementing this trait can be used to fetch constants.

Required Associated Types§

source

type Target: DecodeWithMetadata

The target type of the value that lives at this address.

Required Methods§

source

fn pallet_name(&self) -> &str

The name of the pallet that the constant lives under.

source

fn constant_name(&self) -> &str

The name of the constant in a given pallet.

Provided Methods§

source

fn validation_hash(&self) -> Option<[u8; 32]>

An optional hash which, if present, will be checked against the node metadata to confirm that the return type matches what we are expecting.

Implementors§