Some metadata cleanup and improvements (#857)

* Do not encode the `origin` parameter in the metadata

* Remove obsolete macro

* Encode outer dispatch in metadata
This commit is contained in:
Bastian Köcher
2018-10-01 18:50:30 +02:00
committed by Gav Wood
parent ec8dda0dd4
commit a21b2bfbb8
7 changed files with 144 additions and 115 deletions
+18
View File
@@ -261,6 +261,23 @@ pub enum StorageFunctionModifier {
Required,
}
/// All metadata about the outer dispatch.
#[derive(Clone, PartialEq, Eq, Encode)]
#[cfg_attr(feature = "std", derive(Decode, Debug, Serialize))]
pub struct OuterDispatchMetadata {
pub name: DecodeDifferentStr,
pub calls: DecodeDifferentArray<OuterDispatchCall>,
}
/// A Call from the outer dispatch.
#[derive(Clone, PartialEq, Eq, Encode)]
#[cfg_attr(feature = "std", derive(Decode, Debug, Serialize))]
pub struct OuterDispatchCall {
pub name: DecodeDifferentStr,
pub prefix: DecodeDifferentStr,
pub index: u16,
}
/// All metadata about an runtime module.
#[derive(Clone, PartialEq, Eq, Encode)]
#[cfg_attr(feature = "std", derive(Decode, Debug, Serialize))]
@@ -276,4 +293,5 @@ pub struct RuntimeModuleMetadata {
pub struct RuntimeMetadata {
pub outer_event: OuterEventMetadata,
pub modules: DecodeDifferentArray<RuntimeModuleMetadata>,
pub outer_dispatch: OuterDispatchMetadata,
}