Skip to content
Snippets Groups Projects
Commit 1aff1a90 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

doc storage

parent 5aca751a
No related branches found
No related tags found
No related merge requests found
Pipeline #18712 passed
......@@ -128,37 +128,45 @@ pub mod pallet {
// STORAGE //
/// maps member id to account id
#[pallet::storage]
#[pallet::getter(fn account_id_of)]
pub type AccountIdOf<T: Config> =
StorageMap<_, Twox64Concat, T::MemberId, T::AccountId, OptionQuery>;
/// count the number of authorities
#[pallet::storage]
#[pallet::getter(fn authorities_counter)]
pub type AuthoritiesCounter<T: Config> = StorageValue<_, u32, ValueQuery>;
/// list incoming authorities
#[pallet::storage]
#[pallet::getter(fn incoming)]
pub type IncomingAuthorities<T: Config> = StorageValue<_, Vec<T::MemberId>, ValueQuery>;
/// list online authorities
#[pallet::storage]
#[pallet::getter(fn online)]
pub type OnlineAuthorities<T: Config> = StorageValue<_, Vec<T::MemberId>, ValueQuery>;
/// list outgoing authorities
#[pallet::storage]
#[pallet::getter(fn outgoing)]
pub type OutgoingAuthorities<T: Config> = StorageValue<_, Vec<T::MemberId>, ValueQuery>;
/// maps member id to member data
#[pallet::storage]
#[pallet::getter(fn member)]
pub type Members<T: Config> =
StorageMap<_, Twox64Concat, T::MemberId, MemberData<T::AccountId>, OptionQuery>;
/// maps session index to the list of member id set to expire at this session
#[pallet::storage]
#[pallet::getter(fn members_expire_on)]
pub type MembersExpireOn<T: Config> =
StorageMap<_, Twox64Concat, SessionIndex, Vec<T::MemberId>, ValueQuery>;
/// maps session index to the list of member id forced to rotate keys before this session
#[pallet::storage]
#[pallet::getter(fn must_rotate_keys_before)]
pub type MustRotateKeysBefore<T: Config> =
......
......@@ -169,6 +169,7 @@ pub mod pallet {
// STORAGE //
/// maps identity index to identity value
#[pallet::storage]
#[pallet::getter(fn identity)]
pub type Identities<T: Config> = CountedStorageMap<
......@@ -179,19 +180,22 @@ pub mod pallet {
OptionQuery,
>;
/// maps account id to identity index
#[pallet::storage]
#[pallet::getter(fn identity_index_of)]
pub type IdentityIndexOf<T: Config> =
StorageMap<_, Blake2_128, T::AccountId, T::IdtyIndex, OptionQuery>;
/// maps identity name to null type (simply a set)
#[pallet::storage]
#[pallet::getter(fn identity_by_did)]
pub type IdentitiesNames<T: Config> = StorageMap<_, Blake2_128, IdtyName, (), OptionQuery>;
/// counter of the identity index to give to the next identity
#[pallet::storage]
pub(super) type NextIdtyIndex<T: Config> = StorageValue<_, T::IdtyIndex, ValueQuery>;
/// Identities by removed block
/// maps block number to the list of identities set to be removed at this bloc
#[pallet::storage]
#[pallet::getter(fn removable_on)]
pub type IdentitiesRemovableOn<T: Config> =
......
......@@ -108,21 +108,26 @@ pub mod pallet {
// STORAGE //
/// maps identity id to membership data
// (expiration block for instance)
#[pallet::storage]
#[pallet::getter(fn membership)]
pub type Membership<T: Config<I>, I: 'static = ()> =
CountedStorageMap<_, Twox64Concat, T::IdtyId, MembershipData<T::BlockNumber>, OptionQuery>;
/// maps block number to the list of identity id set to expire at this block
#[pallet::storage]
#[pallet::getter(fn memberships_expire_on)]
pub type MembershipsExpireOn<T: Config<I>, I: 'static = ()> =
StorageMap<_, Twox64Concat, T::BlockNumber, Vec<T::IdtyId>, ValueQuery>;
/// maps identity id to pending membership metadata
#[pallet::storage]
#[pallet::getter(fn pending_membership)]
pub type PendingMembership<T: Config<I>, I: 'static = ()> =
StorageMap<_, Twox64Concat, T::IdtyId, T::MetaData, OptionQuery>;
/// maps block number to the list of memberships set to expire at this block
#[pallet::storage]
#[pallet::getter(fn pending_memberships_expire_on)]
pub type PendingMembershipsExpireOn<T: Config<I>, I: 'static = ()> =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment