Add Assets module (#925)

* Add Assets module

* Fixes

* Fix

* Update comments

* Support `GenesisConfig` without any fields

Fixes: #923

* Do not generate an empty `GenesisConfig`, instead generate no `GenesisConfig`
This commit is contained in:
Gav Wood
2018-10-20 12:43:00 +02:00
committed by GitHub
parent 7f6862ba5e
commit 583c24f017
13 changed files with 360 additions and 42 deletions
+1 -1
View File
@@ -791,7 +791,7 @@ impl<Block> client::backend::Backend<Block, Blake2Hasher> for Backend<Block> whe
match self.storage.state_db.revert_one() {
Some(commit) => {
apply_state_commit(&mut transaction, commit);
let removed = best.clone();
let _removed = best.clone();
best -= As::sa(1);
let header = self.blockchain.header(BlockId::Number(best))?.ok_or_else(
|| client::error::ErrorKind::UnknownBlock(
+16 -3
View File
@@ -269,19 +269,32 @@ pub fn verify_encoded_lazy<V: Verify, T: codec::Encode>(sig: &V, item: &T, signe
#[macro_export]
macro_rules! __impl_outer_config_types {
($concrete:ident $config:ident $snake:ident $($rest:ident)*) => {
(
$concrete:ident $config:ident $snake:ident < $ignore:ident > $( $rest:tt )*
) => {
#[cfg(any(feature = "std", test))]
pub type $config = $snake::GenesisConfig<$concrete>;
__impl_outer_config_types! {$concrete $($rest)*}
};
(
$concrete:ident $config:ident $snake:ident $( $rest:tt )*
) => {
#[cfg(any(feature = "std", test))]
pub type $config = $snake::GenesisConfig;
__impl_outer_config_types! {$concrete $($rest)*}
};
($concrete:ident) => ()
}
#[macro_export]
/// Implement the output "meta" module configuration struct.
macro_rules! impl_outer_config {
( pub struct $main:ident for $concrete:ident { $( $config:ident => $snake:ident, )* } ) => {
__impl_outer_config_types! { $concrete $( $config $snake )* }
(
pub struct $main:ident for $concrete:ident {
$( $config:ident => $snake:ident $( < $generic:ident > )*, )*
}
) => {
__impl_outer_config_types! { $concrete $( $config $snake $( < $generic > )* )* }
#[cfg(any(feature = "std", test))]
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
+1 -1
View File
@@ -566,5 +566,5 @@ pub trait ProvideInherent {
pub trait Extrinsic {
/// Is this `Extrinsic` signed?
/// If no information are available about signed/unsigned, `None` should be returned.
fn is_signed(&self) -> Option<bool>;
fn is_signed(&self) -> Option<bool> { None }
}