mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 20:17:57 +00:00
Sensible way of selecting Prime member (#5346)
* Calculate prime votes only during the election * Migration * Fix build, enable migration * Fix tests * Bump runtime version * Update frame/elections-phragmen/src/lib.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
This commit is contained in:
@@ -185,3 +185,12 @@ pub fn remove_storage_prefix(module: &[u8], item: &[u8], hash: &[u8]) {
|
||||
key[32..].copy_from_slice(hash);
|
||||
frame_support::storage::unhashed::kill_prefix(&key)
|
||||
}
|
||||
|
||||
/// Get a particular value in storage by the `module`, the map's `item` name and the key `hash`.
|
||||
pub fn take_storage_item<K: Encode + Sized, T: Decode + Sized, H: StorageHasher>(
|
||||
module: &[u8],
|
||||
item: &[u8],
|
||||
key: K,
|
||||
) -> Option<T> {
|
||||
take_storage_value(module, item, key.using_encoded(H::hash).as_ref())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user