referrerpolicy=no-referrer-when-downgrade

Trait bp_runtime::StorageDoubleMapKeyProvider

source ·
pub trait StorageDoubleMapKeyProvider {
    type Hasher1: StorageHasher;
    type Key1: FullCodec + Send + Sync;
    type Hasher2: StorageHasher;
    type Key2: FullCodec + Send + Sync;
    type Value: 'static + FullCodec;

    const MAP_NAME: &'static str;

    // Provided method
    fn final_key(
        pallet_prefix: &str,
        key1: &Self::Key1,
        key2: &Self::Key2,
    ) -> StorageKey { ... }
}
Expand description

Can be used to access the runtime storage key of a StorageDoubleMap.

Required Associated Types§

source

type Hasher1: StorageHasher

The same as StorageDoubleMap::Hasher1.

source

type Key1: FullCodec + Send + Sync

The same as StorageDoubleMap::Key1.

source

type Hasher2: StorageHasher

The same as StorageDoubleMap::Hasher2.

source

type Key2: FullCodec + Send + Sync

The same as StorageDoubleMap::Key2.

source

type Value: 'static + FullCodec

The same as StorageDoubleMap::Value.

Required Associated Constants§

source

const MAP_NAME: &'static str

The name of the variable that holds the StorageDoubleMap.

Provided Methods§

source

fn final_key( pallet_prefix: &str, key1: &Self::Key1, key2: &Self::Key2, ) -> StorageKey

This is a copy of the frame_support::storage::generator::StorageDoubleMap::storage_double_map_final_key.

We’re using it because to call storage_double_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§