storage doublemap in decl_storage (#1918)

* factorization

* introduce GenericUnhashedStorage

* implement generator and storage

* impl double map in storage macro

* improve StorageDoubleMapXX methods

* remove storage from example and impl test

* remove old comments

* wasm compatible

* improve imports

* rename storages

* update runtime impl version

* make code less verbose

* impl hash config for second key in double map

hash available are all of Hashable trait

* use double map in decl_storage for contract

* fix double map config issue

* add hasher into metadata

* update impl version and build wasm

* doc

* add attrs

* update metadata version

* update runtime version

* fix unused storage
This commit is contained in:
thiolliere
2019-03-28 17:40:50 +01:00
committed by Gav Wood
parent e3516d2bf4
commit f9d0da0a18
18 changed files with 843 additions and 207 deletions
+3 -1
View File
@@ -31,7 +31,9 @@ use sr_std::borrow::Borrow;
/// The storage key (i.e. the key under which the `Value` will be stored) is created from two parts.
/// The first part is a hash of a concatenation of the `PREFIX` and `Key1`. And the second part
/// is a hash of a `Key2`.
pub trait StorageDoubleMap {
///
/// Hasher are implemented in derive_key* methods.
pub trait StorageDoubleMapWithHasher {
type Key1: Codec;
type Key2: Codec;
type Value: Codec + Default;