referrerpolicy=no-referrer-when-downgrade
bp_runtime

Trait 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 Constants§

Source

const MAP_NAME: &'static str

The name of the variable that holds the 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.

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

impl StorageDoubleMapKeyProvider for ImportedParaHeadsKeyProvider

impl<AccountId, Reward, RewardBalance> StorageDoubleMapKeyProvider for RelayerRewardsKeyProvider<AccountId, Reward, RewardBalance>
where AccountId: 'static + Codec + EncodeLike + Send + Sync, Reward: Codec + EncodeLike + Send + Sync, RewardBalance: 'static + Codec + EncodeLike + Send + Sync,