mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 07:01:02 +00:00
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:
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user