Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[trivial] add note on usage of twox hash #13089

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frame/fast-unstake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ pub mod pallet {
/// The map of all accounts wishing to be unstaked.
///
/// Keeps track of `AccountId` wishing to unstake and it's corresponding deposit.
///
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
#[pallet::storage]
pub type Queue<T: Config> = CountedStorageMap<_, Twox64Concat, T::AccountId, BalanceOf<T>>;

Expand Down
2 changes: 2 additions & 0 deletions frame/nomination-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,8 @@ pub mod pallet {
pub type MaxPoolMembersPerPool<T: Config> = StorageValue<_, u32, OptionQuery>;

/// Active members.
///
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
#[pallet::storage]
pub type PoolMembers<T: Config> =
CountedStorageMap<_, Twox64Concat, T::AccountId, PoolMember<T>>;
Expand Down
8 changes: 8 additions & 0 deletions frame/staking/src/pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ pub mod pallet {
pub type Invulnerables<T: Config> = StorageValue<_, Vec<T::AccountId>, ValueQuery>;

/// Map from all locked "stash" accounts to the controller account.
///
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
#[pallet::storage]
#[pallet::getter(fn bonded)]
pub type Bonded<T: Config> = StorageMap<_, Twox64Concat, T::AccountId, T::AccountId>;
Expand Down Expand Up @@ -320,12 +322,16 @@ pub mod pallet {
pub type Ledger<T: Config> = StorageMap<_, Blake2_128Concat, T::AccountId, StakingLedger<T>>;

/// Where the reward payment should be made. Keyed by stash.
///
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
#[pallet::storage]
#[pallet::getter(fn payee)]
pub type Payee<T: Config> =
StorageMap<_, Twox64Concat, T::AccountId, RewardDestination<T::AccountId>, ValueQuery>;

/// The map from (wannabe) validator stash key to the preferences of that validator.
///
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
#[pallet::storage]
#[pallet::getter(fn validators)]
pub type Validators<T: Config> =
Expand Down Expand Up @@ -353,6 +359,8 @@ pub mod pallet {
///
/// Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
/// [`Call::chill_other`] dispatchable by anyone.
///
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
#[pallet::storage]
#[pallet::getter(fn nominators)]
pub type Nominators<T: Config> =
Expand Down