mirror of
https://github.com/pezkuwichain/pezframe-metadata.git
synced 2026-06-16 17:51:07 +00:00
Add Runtime type to metadata
This commit is contained in:
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [14.0.0-rc.3] - 2021-08-31
|
||||||
|
### Added
|
||||||
|
- Add Runtime type to metadata
|
||||||
|
|
||||||
## [14.0.0-rc.2] - 2021-08-04
|
## [14.0.0-rc.2] - 2021-08-04
|
||||||
### Changed
|
### Changed
|
||||||
Combine Map/NMap/DoubleMap StorageEntryTypes [#23](https://github.com/paritytech/frame-metadata/pull/23)
|
Combine Map/NMap/DoubleMap StorageEntryTypes [#23](https://github.com/paritytech/frame-metadata/pull/23)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "frame-metadata"
|
name = "frame-metadata"
|
||||||
version = "14.0.0-rc.2"
|
version = "14.0.0-rc.3"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
@@ -50,17 +50,25 @@ pub struct RuntimeMetadataV14 {
|
|||||||
pub pallets: Vec<PalletMetadata<PortableForm>>,
|
pub pallets: Vec<PalletMetadata<PortableForm>>,
|
||||||
/// Metadata of the extrinsic.
|
/// Metadata of the extrinsic.
|
||||||
pub extrinsic: ExtrinsicMetadata<PortableForm>,
|
pub extrinsic: ExtrinsicMetadata<PortableForm>,
|
||||||
|
/// The type of the `Runtime`.
|
||||||
|
pub ty: <PortableForm as Form>::Type,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RuntimeMetadataV14 {
|
impl RuntimeMetadataV14 {
|
||||||
pub fn new(pallets: Vec<PalletMetadata>, extrinsic: ExtrinsicMetadata) -> Self {
|
pub fn new(
|
||||||
|
pallets: Vec<PalletMetadata>,
|
||||||
|
extrinsic: ExtrinsicMetadata,
|
||||||
|
runtime_type: MetaType,
|
||||||
|
) -> 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);
|
||||||
Self {
|
Self {
|
||||||
types: registry.into(),
|
types: registry.into(),
|
||||||
pallets,
|
pallets,
|
||||||
extrinsic,
|
extrinsic,
|
||||||
|
ty,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user