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

Bump frame-metadata v16 to 19.0.0 #7563

Merged
merged 9 commits into from
Feb 17, 2025
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
22 changes: 11 additions & 11 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ frame-benchmarking-pallet-pov = { default-features = false, path = "substrate/fr
frame-election-provider-solution-type = { path = "substrate/frame/election-provider-support/solution-type", default-features = false }
frame-election-provider-support = { path = "substrate/frame/election-provider-support", default-features = false }
frame-executive = { path = "substrate/frame/executive", default-features = false }
frame-metadata = { version = "18.0.0", default-features = false }
frame-metadata = { version = "19.0.0", default-features = false }
frame-metadata-hash-extension = { path = "substrate/frame/metadata-hash-extension", default-features = false }
frame-support = { path = "substrate/frame/support", default-features = false }
frame-support-procedural = { path = "substrate/frame/support/procedural", default-features = false }
Expand Down Expand Up @@ -858,7 +858,7 @@ macro_magic = { version = "0.5.1" }
maplit = { version = "1.0.2" }
memmap2 = { version = "0.9.3" }
memory-db = { version = "0.32.0", default-features = false }
merkleized-metadata = { version = "0.2.0" }
merkleized-metadata = { version = "0.3.0" }
merlin = { version = "3.0", default-features = false }
messages-relay = { path = "bridges/relays/messages" }
metered = { version = "0.6.1", default-features = false, package = "prioritized-metered-channel" }
Expand Down
14 changes: 14 additions & 0 deletions prdoc/pr_7563.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: Bump frame-metadata v16 to 19.0.0
doc:
- audience: Runtime Dev
description: Update to latest version of `frame-metadata` and `merkleized-metadata` in order to support pallet
view function metadata.
crates:
- name: sp-metadata-ir
bump: minor
- name: frame-support
bump: none
- name: substrate-wasm-builder
bump: minor
- name: pallet-example-view-functions
bump: minor
32 changes: 26 additions & 6 deletions substrate/primitives/metadata-ir/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
use crate::{
DeprecationInfoIR, DeprecationStatusIR, OuterEnumsIR, PalletAssociatedTypeMetadataIR,
PalletCallMetadataIR, PalletConstantMetadataIR, PalletErrorMetadataIR, PalletEventMetadataIR,
PalletStorageMetadataIR, StorageEntryMetadataIR,
PalletStorageMetadataIR, PalletViewFunctionMethodMetadataIR,
PalletViewFunctionMethodParamMetadataIR, StorageEntryMetadataIR,
};

use super::types::{
Expand All @@ -31,9 +32,10 @@ use super::types::{
use frame_metadata::v16::{
CustomMetadata, DeprecationInfo, DeprecationStatus, ExtrinsicMetadata, OuterEnums,
PalletAssociatedTypeMetadata, PalletCallMetadata, PalletConstantMetadata, PalletErrorMetadata,
PalletEventMetadata, PalletMetadata, PalletStorageMetadata, RuntimeApiMetadata,
RuntimeApiMethodMetadata, RuntimeApiMethodParamMetadata, RuntimeMetadataV16,
StorageEntryMetadata, TransactionExtensionMetadata,
PalletEventMetadata, PalletMetadata, PalletStorageMetadata, PalletViewFunctionMetadata,
PalletViewFunctionParamMetadata, RuntimeApiMetadata, RuntimeApiMethodMetadata,
RuntimeApiMethodParamMetadata, RuntimeMetadataV16, StorageEntryMetadata,
TransactionExtensionMetadata,
};

impl From<MetadataIR> for RuntimeMetadataV16 {
Expand Down Expand Up @@ -85,8 +87,7 @@ impl From<PalletMetadataIR> for PalletMetadata {
name: ir.name,
storage: ir.storage.map(Into::into),
calls: ir.calls.map(Into::into),
// TODO: add with the new v16 release of frame-metadata
// view_functions: ir.view_functions.into_iter().map(Into::into).collect(),
view_functions: ir.view_functions.into_iter().map(Into::into).collect(),
event: ir.event.map(Into::into),
constants: ir.constants.into_iter().map(Into::into).collect(),
error: ir.error.map(Into::into),
Expand Down Expand Up @@ -144,6 +145,25 @@ impl From<PalletCallMetadataIR> for PalletCallMetadata {
}
}

impl From<PalletViewFunctionMethodMetadataIR> for PalletViewFunctionMetadata {
fn from(ir: PalletViewFunctionMethodMetadataIR) -> Self {
PalletViewFunctionMetadata {
name: ir.name,
id: ir.id,
inputs: ir.inputs.into_iter().map(Into::into).collect(),
output: ir.output,
docs: ir.docs.into_iter().map(Into::into).collect(),
deprecation_info: ir.deprecation_info.into(),
}
}
}

impl From<PalletViewFunctionMethodParamMetadataIR> for PalletViewFunctionParamMetadata {
fn from(ir: PalletViewFunctionMethodParamMetadataIR) -> Self {
PalletViewFunctionParamMetadata { name: ir.name, ty: ir.ty }
}
}

impl From<PalletConstantMetadataIR> for PalletConstantMetadata {
fn from(ir: PalletConstantMetadataIR) -> Self {
PalletConstantMetadata {
Expand Down
Loading