Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update frame metadata to v16 #657

Merged
merged 7 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ members = [
async-trait = "0.1.68"
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ['derive'] }
derive_more = { version = "0.99.5" }
frame-metadata = { version = "15.1", default-features = false, features = ["v14", "v15-unstable", "serde_full", "decode"] }
frame-metadata = { version = "16.0", default-features = false, features = ["current", "serde_full", "decode"] }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
log = { version = "0.4.14", default-features = false }
maybe-async = { version = "0.2.7" }
Expand Down
Binary file modified ksm_metadata_v14.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion node-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive", "bit-vec"], default-features = false }
derive_more = { version = "0.99.17" }
either = { version = "1.6.1", default-features = false }
frame-metadata = { version = "15.1", default-features = false, features = ["v14", "v15-unstable", "serde_full", "decode"] }
frame-metadata = { version = "16.0", default-features = false, features = ["current", "serde_full", "decode"] }
hex = { version = "0.4.3", default-features = false }
log = { version = "0.4.14", default-features = false }
scale-bits = { version = "0.4.0", default-features = false, features = ["scale-info", "serde"] }
Expand Down
4 changes: 2 additions & 2 deletions node-api/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use core::fmt::Debug;
use derive_more::From;

// Re-expose the errors we use from other crates here:
pub use crate::metadata::{InvalidMetadataError, MetadataError};
pub use crate::metadata::{MetadataConversionError, MetadataError};
pub use scale_decode::Error as DecodeError;
pub use scale_encode::Error as EncodeError;
pub use sp_core::crypto::SecretStringError;
Expand All @@ -34,7 +34,7 @@ pub enum Error {
/// Secret string error.
SecretString(SecretStringError),
/// Invalid metadata error
InvalidMetadata(InvalidMetadataError),
InvalidMetadata(MetadataConversionError),
/// Invalid metadata error
Metadata(MetadataError),
/// Runtime error.
Expand Down
10 changes: 7 additions & 3 deletions node-api/src/metadata/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,22 @@ pub enum MetadataError {
ConstantNotFound(&'static str),
/// Variant not found.
VariantIndexNotFound(u8),
/// Type is not in metadata.
TypeNotFound(u32),
/// Api is not in metadata.
RuntimeApiNotFound(String),
}

#[derive(Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Encode, Decode)]
pub enum InvalidMetadataError {
pub enum MetadataConversionError {
InvalidPrefix,
InvalidVersion,
/// Type is missing from type registry.
MissingType(u32),
/// Type was not variant/enum type.
TypeDefNotVariant(u32),
/// Type is not in metadata.
TypeNotFound(u32),
/// Type Name is not in metadata.
TypeNameNotFound(String),
// Path not found.
InvalidTypePath(String),
}
Loading