Type Alias IndexMap

Source
pub type IndexMap<T: Config<I>, I: 'static = ()> = StorageNMap<_GeneratedPrefixForStorageIndexMap<T, I>, (NMapKey<Blake2_128Concat, CommitReason<T, I>>, NMapKey<Blake2_128Concat, IndexDigest<T>>), IndexInfo<T, I>, OptionQuery>;
Expand description

Stores index information for a given CommitReason additionally keyed by IndexDigest.

Each index represents a collection of digest entries, each holding a share and variant,
functioning as an aggregation layer between individual digests and higher-level pools.

§Key Structure:

(CommitReason, IndexDigest) -> IndexInfo

§Purpose:

  • Provides a way to group multiple digest entries under a single reason.
  • Simplifies calculations related to composite positions and share-based aggregation.
  • Allows reusability and modularization of commitment logic (e.g., an index can feed into a pool).

§Notes:

  • An index cannot exist without an associated reason, enforcing a clear ownership hierarchy.
  • Each IndexInfo tracks its own Entries, total capital, and current balance_of.
  • IndexInfo is used as a foundational structure for generating higher-order constructs like PoolInfo.

Storage type is [StorageNMap] with keys type (CommitReason < T, I >, IndexDigest < T >) and value type IndexInfo < T, I >.

Aliased Type§

pub struct IndexMap<T: Config<I>, I: 'static = ()>(/* private fields */);