feat: generic Extrinsic on System; Client::storage taking Option<T::Hash>; (#63)

This commit is contained in:
Maciej Hirsz
2020-01-14 16:09:01 +01:00
committed by Andrew Jones
parent d9e7848161
commit 691244fef2
5 changed files with 19 additions and 10 deletions
+5 -1
View File
@@ -29,6 +29,7 @@ use frame_support::Parameter;
use sp_runtime::traits::{
Bounded,
CheckEqual,
Extrinsic,
Hash,
Header,
MaybeDisplay,
@@ -108,6 +109,9 @@ pub trait System: 'static + Eq + Clone + Debug {
type Header: Parameter
+ Header<Number = Self::BlockNumber, Hash = Self::Hash>
+ DeserializeOwned;
/// Extrinsic type within blocks.
type Extrinsic: Parameter + Member + Extrinsic + Debug + MaybeSerializeDeserialize;
}
/// The System extension trait for the Client.
@@ -141,7 +145,7 @@ impl<T: System + Balances + 'static, S: 'static> SystemStore for Client<T, S> {
Ok(map) => map,
Err(err) => return Box::new(future::err(err)),
};
Box::new(self.fetch_or(map.key(account_id), map.default()))
Box::new(self.fetch_or(map.key(account_id), None, map.default()))
}
}