Support v16 metadata and use it by default if it's available (#1999)

* Support v16 metadata and use it by default if it's available

* lockfile

* fix blocks test; new transaction extension in kitchensink runtime

* Bump scale-typegen to 0.11.1 to cater for Duration prelude type

* fmt

* Fix no-std test building

* Cargo update and bump substrate deps

* Update test and no-std deps

* fmt

* fix test
This commit is contained in:
James Wilson
2025-05-08 14:44:44 +01:00
committed by GitHub
parent 4524590821
commit 9ba89e3ed7
16 changed files with 1674 additions and 1223 deletions
+6 -3
View File
@@ -8,6 +8,11 @@ mod v14;
mod v15;
mod v16;
/// The metadata versions that we support converting into [`crate::Metadata`].
/// These are ordest from highest to lowest, so that the metadata we'd want to
/// pick first is first in the array.
pub const SUPPORTED_METADATA_VERSIONS: [u32; 3] = [16, 15, 14];
/// An error emitted if something goes wrong converting [`frame_metadata`]
/// types into [`crate::Metadata`].
#[derive(Debug, PartialEq, Eq, DeriveError)]
@@ -79,9 +84,7 @@ impl TryFrom<frame_metadata::RuntimeMetadataPrefixed> for crate::Metadata {
}
frame_metadata::RuntimeMetadata::V14(m) => m.try_into(),
frame_metadata::RuntimeMetadata::V15(m) => m.try_into(),
frame_metadata::RuntimeMetadata::V16(_opaque) => {
Err(TryFromError::UnsupportedMetadataVersion(16))
}
frame_metadata::RuntimeMetadata::V16(m) => m.try_into(),
}
}
}
+1
View File
@@ -42,6 +42,7 @@ use utils::{
type ArcStr = Arc<str>;
pub use from::TryFromError;
pub use from::SUPPORTED_METADATA_VERSIONS;
pub use utils::validation::MetadataHasher;
type CustomMetadataInner = frame_metadata::v15::CustomMetadata<PortableForm>;