mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
srml: consensus: kill storage (#2098)
* srml: consensus: kill storage items * srml: consensus: add test for set and kill storage * runtime: bump spec_version update wasm blobs
This commit is contained in:
@@ -51,6 +51,7 @@ impl<S: codec::Codec + Default> StorageVec for AuthorityStorageVec<S> {
|
||||
const PREFIX: &'static [u8] = well_known_keys::AUTHORITY_PREFIX;
|
||||
}
|
||||
|
||||
pub type Key = Vec<u8>;
|
||||
pub type KeyValue = (Vec<u8>, Vec<u8>);
|
||||
|
||||
/// Handling offline validator reports in a generic way.
|
||||
@@ -216,6 +217,13 @@ decl_module! {
|
||||
}
|
||||
}
|
||||
|
||||
/// Kill some items from storage.
|
||||
fn kill_storage(keys: Vec<Key>) {
|
||||
for key in &keys {
|
||||
storage::unhashed::kill(&key);
|
||||
}
|
||||
}
|
||||
|
||||
fn on_finalise() {
|
||||
if let Some(original_authorities) = <OriginalAuthorities<T>>::take() {
|
||||
let current_authorities = AuthorityStorageVec::<T::SessionKey>::items();
|
||||
|
||||
Reference in New Issue
Block a user