mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 06:01:02 +00:00
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:
@@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user