mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-25 10:41:08 +00:00
Introduce default-setting prime for collective (#5137)
* Introduce default-setting prime for collective * Docs. * Elections phragmen supports prime * Fix * Membership supports prime * Fix * Update frame/collective/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -91,6 +91,14 @@ impl<T: FullCodec, G: StorageValue<T>> storage::StorageValue<T> for G {
|
||||
unhashed::put(&Self::storage_value_final_key(), &val)
|
||||
}
|
||||
|
||||
fn set(maybe_val: Self::Query) {
|
||||
if let Some(val) = G::from_query_to_optional_value(maybe_val) {
|
||||
unhashed::put(&Self::storage_value_final_key(), &val)
|
||||
} else {
|
||||
unhashed::kill(&Self::storage_value_final_key())
|
||||
}
|
||||
}
|
||||
|
||||
fn kill() {
|
||||
unhashed::kill(&Self::storage_value_final_key())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user