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:
Demi Obenour
2020-05-21 11:57:29 +00:00
committed by GitHub
parent a90c4232e3
commit ee6633e038
9 changed files with 41 additions and 0 deletions
+2
View File
@@ -257,6 +257,8 @@ decl_storage! {
/// The next asset identifier up for grabs.
NextAssetId get(fn next_asset_id): T::AssetId;
/// The total unit supply of an asset.
///
/// TWOX-NOTE: `AssetId` is trusted, so this is safe.
TotalSupply: map hasher(twox_64_concat) T::AssetId => T::Balance;
}
}