Fix linked map for trait types and Option (#1809)

* Fix linked map for traits.

* Fix Option<_> variant.

*  Improve naming a tad

* Rebuild runtime

* Encapsulate private data in the inner module.

* Bump impl version.

* Fix deriving codec in srml-example.

* Fix derivation without importing parity-codec-derive.

* Fix config() for map.
This commit is contained in:
Tomasz Drwięga
2019-02-18 19:23:00 +01:00
committed by Gav Wood
parent 72bb8ef4c5
commit 9a2f1b2007
12 changed files with 238 additions and 148 deletions
+4 -1
View File
@@ -136,11 +136,12 @@ macro_rules! for_each_tuple {
#[cfg(test)]
mod tests {
use super::*;
use parity_codec::Codec;
use runtime_io::{with_externalities, Blake2Hasher};
use runtime_primitives::BuildStorage;
pub trait Trait {
type BlockNumber;
type BlockNumber: Codec + Default;
type Origin;
}
@@ -160,6 +161,8 @@ mod tests {
decl_storage! {
trait Store for Module<T: Trait> as Example {
pub Data get(data) build(|_| vec![(15u32, 42u64)]): linked_map u32 => u64;
pub GenericData get(generic_data): linked_map T::BlockNumber => T::BlockNumber;
pub GenericData2 get(generic_data2): linked_map T::BlockNumber => Option<T::BlockNumber>;
}
}