Implement iter for doublemap (#5504)

* implement iter for doublemap

* fmt

* fix tests

* fix staking mock

* address comment

* update doc and constraint for reversible hasher

Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
thiolliere
2020-04-15 16:49:08 +02:00
committed by GitHub
parent 24fc051c86
commit 28edcbfe8d
7 changed files with 187 additions and 67 deletions
+5
View File
@@ -60,7 +60,12 @@ pub trait StorageHasher: 'static {
}
/// Hasher to use to hash keys to insert to storage.
///
/// Reversible hasher store the encoded key after the hash part.
pub trait ReversibleStorageHasher: StorageHasher {
/// Split the hash part out of the input.
///
/// I.e. for input `&[hash ++ key ++ some]` returns `&[key ++ some]`
fn reverse(x: &[u8]) -> &[u8];
}