mirror of
https://github.com/pezkuwichain/pezframe-metadata.git
synced 2026-06-14 15:41:03 +00:00
v15/metadata: Add outer enum types for calls, events, errors (#57)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -50,6 +50,12 @@ pub struct RuntimeMetadataV15 {
|
|||||||
pub ty: <PortableForm as Form>::Type,
|
pub ty: <PortableForm as Form>::Type,
|
||||||
/// Metadata of the Runtime API.
|
/// Metadata of the Runtime API.
|
||||||
pub apis: Vec<RuntimeApiMetadata<PortableForm>>,
|
pub apis: Vec<RuntimeApiMetadata<PortableForm>>,
|
||||||
|
/// The type of the outer `RuntimeCall` enum.
|
||||||
|
pub call_enum_ty: <PortableForm as Form>::Type,
|
||||||
|
/// The type of the outer `RuntimeEvent` enum.
|
||||||
|
pub event_enum_ty: <PortableForm as Form>::Type,
|
||||||
|
/// The type of the outer `RuntimeError` enum.
|
||||||
|
pub error_enum_ty: <PortableForm as Form>::Type,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RuntimeMetadataV15 {
|
impl RuntimeMetadataV15 {
|
||||||
@@ -59,18 +65,27 @@ impl RuntimeMetadataV15 {
|
|||||||
extrinsic: ExtrinsicMetadata,
|
extrinsic: ExtrinsicMetadata,
|
||||||
runtime_type: MetaType,
|
runtime_type: MetaType,
|
||||||
apis: Vec<RuntimeApiMetadata>,
|
apis: Vec<RuntimeApiMetadata>,
|
||||||
|
call_enum_ty: MetaType,
|
||||||
|
event_enum_ty: MetaType,
|
||||||
|
error_enum_ty: MetaType,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let mut registry = Registry::new();
|
let mut registry = Registry::new();
|
||||||
let pallets = registry.map_into_portable(pallets);
|
let pallets = registry.map_into_portable(pallets);
|
||||||
let extrinsic = extrinsic.into_portable(&mut registry);
|
let extrinsic = extrinsic.into_portable(&mut registry);
|
||||||
let ty = registry.register_type(&runtime_type);
|
let ty = registry.register_type(&runtime_type);
|
||||||
let apis = registry.map_into_portable(apis);
|
let apis = registry.map_into_portable(apis);
|
||||||
|
let call_enum_ty = registry.register_type(&call_enum_ty);
|
||||||
|
let event_enum_ty = registry.register_type(&event_enum_ty);
|
||||||
|
let error_enum_ty = registry.register_type(&error_enum_ty);
|
||||||
Self {
|
Self {
|
||||||
types: registry.into(),
|
types: registry.into(),
|
||||||
pallets,
|
pallets,
|
||||||
extrinsic,
|
extrinsic,
|
||||||
ty,
|
ty,
|
||||||
apis,
|
apis,
|
||||||
|
call_enum_ty,
|
||||||
|
event_enum_ty,
|
||||||
|
error_enum_ty,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user