referrerpolicy=no-referrer-when-downgrade

Trait bp_runtime::StorageMapKeyProvider

source ·
pub trait StorageMapKeyProvider {
    type Hasher: StorageHasher;
    type Key: FullCodec + Send + Sync;
    type Value: 'static + FullCodec;

    const MAP_NAME: &'static str;

    // Provided method
    fn final_key(pallet_prefix: &str, key: &Self::Key) -> StorageKey { ... }
}
Expand description

Can be use to access the runtime storage key of a StorageMap.

Required Associated Types§

source

type Hasher: StorageHasher

The same as StorageMap::Hasher1.

source

type Key: FullCodec + Send + Sync

The same as StorageMap::Key1.

source

type Value: 'static + FullCodec

The same as StorageMap::Value.

Required Associated Constants§

source

const MAP_NAME: &'static str

The name of the variable that holds the StorageMap.

Provided Methods§

source

fn final_key(pallet_prefix: &str, key: &Self::Key) -> StorageKey

This is a copy of the frame_support::storage::generator::StorageMap::storage_map_final_key.

We’re using it because to call storage_map_final_key directly, we need access to the runtime and pallet instance, which (sometimes) is impossible.

Object Safety§

This trait is not object safe.

Implementors§