mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-29 09:07:24 +00:00
Prevent account storage leakage (#270)
* WIP * Iteration over all keys with the specified prefix * Add clear_prefix in runtime-io * Introduce a custom storage impl: Double Map * Remove prefix * Impl for_keys_with_prefix for light client * Fix wasm_executor * Test storage removal leads to removal of stroage * Check for ok result in storage tests. * Add docs. * Remove commented code under decl_storage! * Add clear_prefix test in runtime-io * Add test for wasm_executor * Prefix walking test. * Rebuild binaries.
This commit is contained in:
committed by
Gav Wood
parent
aa747e3fae
commit
2510774f3b
@@ -459,6 +459,11 @@ pub mod unhashed {
|
||||
runtime_io::clear_storage(key);
|
||||
}
|
||||
|
||||
/// Ensure keys with the given `prefix` have no entries in storage.
|
||||
pub fn kill_prefix(prefix: &[u8]) {
|
||||
runtime_io::clear_prefix(prefix);
|
||||
}
|
||||
|
||||
/// Get a Vec of bytes from storage.
|
||||
pub fn get_raw(key: &[u8]) -> Option<Vec<u8>> {
|
||||
runtime_io::storage(key)
|
||||
|
||||
Reference in New Issue
Block a user