Skip to content

Commit

Permalink
v16: Add unstable metadata v16 (#82)
Browse files Browse the repository at this point in the history
* v16: Add unstable metadata v16

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v16: Add deprecation info

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v16: Extrinsics with multiple versions

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v16: Rename signed extensions to transaction extensions

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v16: Remove the runtime type entirely

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v16: Remove BTreeMap<Compact<u8>> and use plain u8 instead to impl
serialize

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
  • Loading branch information
lexnv authored Oct 9, 2024
1 parent 50d42be commit 201d9e5
Show file tree
Hide file tree
Showing 2 changed files with 682 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frame-metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ pub mod v14;
#[cfg(feature = "current")]
pub mod v15;

/// Unstable Metadata v16
#[cfg(feature = "unstable")]
pub mod v16;

/// Metadata prefix.
pub const META_RESERVED: u32 = 0x6174656d; // 'meta' warning for endianness.

Expand Down Expand Up @@ -161,6 +165,12 @@ pub enum RuntimeMetadata {
/// Version 15 for runtime metadata, as raw encoded bytes.
#[cfg(not(feature = "current"))]
V15(OpaqueMetadata),
/// Version 16 for runtime metadata.
#[cfg(feature = "unstable")]
V16(v16::RuntimeMetadataV16),
/// Version 16 for runtime metadata, as raw encoded bytes.
#[cfg(not(feature = "unstable"))]
V16(OpaqueMetadata),
}

impl RuntimeMetadata {
Expand All @@ -183,6 +193,7 @@ impl RuntimeMetadata {
RuntimeMetadata::V13(_) => 13,
RuntimeMetadata::V14(_) => 14,
RuntimeMetadata::V15(_) => 15,
RuntimeMetadata::V16(_) => u32::MAX,
}
}
}
Expand Down
Loading

0 comments on commit 201d9e5

Please sign in to comment.