mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Add notes about safe uses of twox (#6082)
* Add notes about safe uses of twox * Update frame/grandpa/src/lib.rs Co-authored-by: Nikolay Volf <nikvolf@gmail.com> * Update frame/elections/src/lib.rs * Apply suggestions from code review Co-authored-by: Gavin Wood <gavin@parity.io> Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
@@ -442,16 +442,22 @@ pub struct BalanceLock<Balance> {
|
||||
decl_storage! {
|
||||
trait Store for Module<T: Trait> as GenericAsset {
|
||||
/// Total issuance of a given asset.
|
||||
///
|
||||
/// TWOX-NOTE: `AssetId` is trusted.
|
||||
pub TotalIssuance get(fn total_issuance) build(|config: &GenesisConfig<T>| {
|
||||
let issuance = config.initial_balance * (config.endowed_accounts.len() as u32).into();
|
||||
config.assets.iter().map(|id| (id.clone(), issuance)).collect::<Vec<_>>()
|
||||
}): map hasher(twox_64_concat) T::AssetId => T::Balance;
|
||||
|
||||
/// The free balance of a given asset under an account.
|
||||
///
|
||||
/// TWOX-NOTE: `AssetId` is trusted.
|
||||
pub FreeBalance:
|
||||
double_map hasher(twox_64_concat) T::AssetId, hasher(blake2_128_concat) T::AccountId => T::Balance;
|
||||
|
||||
/// The reserved balance of a given asset under an account.
|
||||
///
|
||||
/// TWOX-NOTE: `AssetId` is trusted.
|
||||
pub ReservedBalance:
|
||||
double_map hasher(twox_64_concat) T::AssetId, hasher(blake2_128_concat) T::AccountId => T::Balance;
|
||||
|
||||
@@ -459,6 +465,8 @@ decl_storage! {
|
||||
pub NextAssetId get(fn next_asset_id) config(): T::AssetId;
|
||||
|
||||
/// Permission options for a given asset.
|
||||
///
|
||||
/// TWOX-NOTE: `AssetId` is trusted.
|
||||
pub Permissions get(fn get_permission):
|
||||
map hasher(twox_64_concat) T::AssetId => PermissionVersions<T::AccountId>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user