diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 054cfdd4296..0330cebb3be 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -181,41 +181,29 @@ jobs: - name: Cargo check all targets. run: cargo check --all-targets - # Next, check subxt features. + # Next, check each subxt feature in isolation. # - `native` feature must always be enabled # - `web` feature is always ignored. - # - This means, don't check --no-default-features and don't try enabling --all-features; both will fail - name: Cargo hack; check each subxt feature - run: cargo hack -p subxt --each-feature check --exclude-no-default-features --exclude-all-features --exclude-features web --features native + run: cargo hack -p subxt --each-feature check --exclude-features web --features native + # Same with subxt-historic - name: Cargo hack; check each subxt feature - run: cargo hack -p subxt-historic --each-feature check --exclude-no-default-features --exclude-all-features --exclude-features web --features native + run: cargo hack -p subxt-historic --each-feature check --exclude-features web --features native - # Subxt-signer has the "subxt" features enabled in the "check all targets" test. Run it on its own to - # check it without. We can't enable subxt or web features here, so no cargo hack. - - name: Cargo check subxt-signer - run: | - cargo check -p subxt-signer - cargo check -p subxt-signer --no-default-features --features sr25519 - cargo check -p subxt-signer --no-default-features --features ecdsa - cargo check -p subxt-signer --no-default-features --features unstable-eth + # And with subxt-rpcs + - name: Cargo hack; check each subxt-rpcs feature + run: cargo hack -p subxt-rpcs --each-feature check --exclude-features web --features native - # Subxt-rpcs has a bunch of clients that can be exposed. Check that they all stand on their own. - - name: Cargo check subxt-rpcs - run: | - cargo check -p subxt-rpcs - cargo check -p subxt-rpcs --no-default-features --features native - cargo check -p subxt-rpcs --no-default-features --features native,subxt - cargo check -p subxt-rpcs --no-default-features --features native,jsonrpsee - cargo check -p subxt-rpcs --no-default-features --features native,reconnecting-rpc-client - cargo check -p subxt-rpcs --no-default-features --features native,mock-rpc-client - cargo check -p subxt-rpcs --no-default-features --features native,unstable-light-client - - # We can't enable web features here, so no cargo hack. + # And with subxt-signer (seems to work with a more basic check here; disable web if it becomes an issue). + - name: Cargo hack; check each subxt-signer feature + run: cargo hack -p subxt-signer --each-feature check + + # And for subxt-lightclient. - name: Cargo check subxt-lightclient - run: cargo check -p subxt-lightclient + run: cargo hack -p subxt-lightclient --each-feature check --exclude-features web --features native - # Next, check each other package in isolation. + # Next, check all other crates. - name: Cargo hack; check each feature/crate on its own run: cargo hack --exclude subxt --exclude subxt-historic --exclude subxt-signer --exclude subxt-lightclient --exclude subxt-rpcs --exclude-all-features --each-feature check --workspace diff --git a/Cargo.lock b/Cargo.lock index bea6017444e..354b785305d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1953,9 +1953,9 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.10.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641e3739fa708a278d35b008a05244008c221240abc3e1c27138466c13e999ed" +checksum = "0fb3bfa2988ef40247e0e0eecfb171a01ad6f4e399485503aad4c413a5f236f3" dependencies = [ "frame-metadata 23.0.0", "parity-scale-codec", @@ -4383,9 +4383,9 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +checksum = "8d6ed61699ad4d54101ab5a817169259b5b0efc08152f8632e61482d8a27ca3d" dependencies = [ "parity-scale-codec", "primitive-types", @@ -4398,9 +4398,9 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +checksum = "65cb245f7fdb489e7ba43a616cbd34427fe3ba6fe0edc1d0d250085e6c84f3ec" dependencies = [ "darling", "proc-macro2", @@ -4464,9 +4464,9 @@ dependencies = [ [[package]] name = "scale-info-legacy" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5da3f59983b08a37d8d979d2326bdc00e8cca57b3d28fb05bdc0f6d7c28600c" +checksum = "2500adfb429a0ffda37919df92c05d0c1359c10e0444c17253c84b84dfce542f" dependencies = [ "hashbrown 0.15.3", "scale-type-resolver", @@ -4500,6 +4500,19 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "scale-typegen" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642d2f13f3fc9a34ea2c1e36142984eba78cd2405a61632492f8b52993e98879" +dependencies = [ + "proc-macro2", + "quote", + "scale-info", + "syn 2.0.101", + "thiserror 2.0.12", +] + [[package]] name = "scale-typegen-description" version = "0.11.1" @@ -4513,16 +4526,16 @@ dependencies = [ "rand", "rand_chacha", "scale-info", - "scale-typegen", + "scale-typegen 0.11.1", "scale-value", "smallvec", ] [[package]] name = "scale-value" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca8b26b451ecb7fd7b62b259fa28add63d12ec49bbcac0e01fcb4b5ae0c09aa" +checksum = "884aab179aba344c67ddcd1d7dd8e3f8fee202f2e570d97ec34ec8688442a5b3" dependencies = [ "base58", "blake2", @@ -5645,6 +5658,7 @@ version = "0.44.0" dependencies = [ "clap", "color-eyre", + "frame-decode", "frame-metadata 23.0.0", "heck", "hex", @@ -5654,7 +5668,8 @@ dependencies = [ "pretty_assertions", "quote", "scale-info", - "scale-typegen", + "scale-info-legacy", + "scale-typegen 0.12.0", "scale-typegen-description", "scale-value", "serde", @@ -5682,7 +5697,7 @@ dependencies = [ "proc-macro2", "quote", "scale-info", - "scale-typegen", + "scale-typegen 0.12.0", "subxt-metadata", "syn 2.0.101", "thiserror 2.0.12", @@ -5724,7 +5739,7 @@ dependencies = [ [[package]] name = "subxt-historic" -version = "0.0.4" +version = "0.0.5" dependencies = [ "frame-decode", "frame-metadata 23.0.0", @@ -5779,7 +5794,7 @@ dependencies = [ "quote", "sc-executor", "sc-executor-common", - "scale-typegen", + "scale-typegen 0.12.0", "sp-io", "sp-maybe-compressed-blob", "sp-state-machine", @@ -5800,7 +5815,10 @@ dependencies = [ "hashbrown 0.14.5", "parity-scale-codec", "scale-info", + "scale-info-legacy", + "scale-type-resolver", "sp-crypto-hashing", + "subxt-codegen", "subxt-utils-stripmetadata", "thiserror 2.0.12", ] diff --git a/Cargo.toml b/Cargo.toml index 0442f0a8c4d..efb0b03d3bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,7 @@ darling = "0.20.10" derive-where = "1.2.7" either = { version = "1.13.0", default-features = false } finito = { version = "0.1.0", default-features = false } -frame-decode = { version = "0.10.0", default-features = false } +frame-decode = { version = "0.15.0", default-features = false } frame-metadata = { version = "23.0.0", default-features = false } futures = { version = "0.3.31", default-features = false, features = ["std"] } getrandom = { version = "0.2", default-features = false } @@ -98,13 +98,13 @@ proc-macro2 = "1.0.86" quote = "1.0.37" regex = { version = "1.11.0", default-features = false } scale-info = { version = "2.11.4", default-features = false } -scale-value = { version = "0.18.0", default-features = false } +scale-value = { version = "0.18.1", default-features = false } scale-bits = { version = "0.7.0", default-features = false } -scale-decode = { version = "0.16.0", default-features = false } +scale-decode = { version = "0.16.2", default-features = false } scale-encode = { version = "0.10.0", default-features = false } scale-type-resolver = { version = "0.2.0" } -scale-info-legacy = { version = "0.2.3" } -scale-typegen = "0.11.1" +scale-info-legacy = { version = "0.4.0", default-features = false } +scale-typegen = "0.12.0" scale-typegen-description = "0.11.0" serde = { version = "1.0.210", default-features = false, features = ["derive"] } serde_json = { version = "1.0.128", default-features = false } diff --git a/artifacts/kusama/metadata_v10_1038.scale b/artifacts/kusama/metadata_v10_1038.scale new file mode 100644 index 00000000000..1e7837da77a Binary files /dev/null and b/artifacts/kusama/metadata_v10_1038.scale differ diff --git a/artifacts/kusama/metadata_v11_1045.scale b/artifacts/kusama/metadata_v11_1045.scale new file mode 100644 index 00000000000..750c7c64798 Binary files /dev/null and b/artifacts/kusama/metadata_v11_1045.scale differ diff --git a/artifacts/kusama/metadata_v12_2025.scale b/artifacts/kusama/metadata_v12_2025.scale new file mode 100644 index 00000000000..a68b8f71175 Binary files /dev/null and b/artifacts/kusama/metadata_v12_2025.scale differ diff --git a/artifacts/kusama/metadata_v13_9030.scale b/artifacts/kusama/metadata_v13_9030.scale new file mode 100644 index 00000000000..92dfaaca105 Binary files /dev/null and b/artifacts/kusama/metadata_v13_9030.scale differ diff --git a/artifacts/kusama/metadata_v14_9111.scale b/artifacts/kusama/metadata_v14_9111.scale new file mode 100644 index 00000000000..ec79100675b Binary files /dev/null and b/artifacts/kusama/metadata_v14_9111.scale differ diff --git a/artifacts/kusama/metadata_v9_1021.scale b/artifacts/kusama/metadata_v9_1021.scale new file mode 100644 index 00000000000..b474022604a Binary files /dev/null and b/artifacts/kusama/metadata_v9_1021.scale differ diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 47e8ddccee3..63ae941585e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -30,16 +30,18 @@ subxt-codegen = { workspace = true } scale-typegen = { workspace = true } subxt-utils-fetchmetadata = { workspace = true, features = ["url"] } subxt-utils-stripmetadata = { workspace = true } -subxt-metadata = { workspace = true } +subxt-metadata = { workspace = true, features = ["legacy"] } subxt = { workspace = true, features = ["default"] } clap = { workspace = true } serde = { workspace = true, features = ["derive"] } color-eyre = { workspace = true } serde_json = { workspace = true } hex = { workspace = true } +frame-decode = { workspace = true, features = ["legacy-types"] } frame-metadata = { workspace = true } codec = { package = "parity-scale-codec", workspace = true } scale-info = { workspace = true } +scale-info-legacy = { workspace = true } scale-value = { workspace = true } syn = { workspace = true } quote = { workspace = true } diff --git a/cli/src/commands/codegen.rs b/cli/src/commands/codegen.rs index 10744aed767..95213077ed5 100644 --- a/cli/src/commands/codegen.rs +++ b/cli/src/commands/codegen.rs @@ -4,12 +4,12 @@ use crate::utils::{FileOrUrl, validate_url_security}; use clap::Parser as ClapParser; -use codec::Decode; use color_eyre::eyre::eyre; use scale_typegen_description::scale_typegen::typegen::{ settings::substitutes::path_segments, validation::{registry_contains_type_path, similar_type_paths_in_registry}, }; +use std::path::PathBuf; use subxt_codegen::CodegenBuilder; use subxt_metadata::Metadata; @@ -28,6 +28,12 @@ pub struct Opts { /// Additional attributes #[clap(long = "attribute")] attributes: Vec, + /// Path to legacy type definitions (required for metadatas pre-V14) + #[clap(long)] + legacy_types: Option, + /// The spec version of the legacy metadata (required for metadatas pre-V14) + #[clap(long)] + legacy_spec_version: Option, /// Additional derives for a given type. /// /// Example 1: `--derive-for-type my_module::my_type=serde::Serialize`. @@ -145,9 +151,20 @@ pub async fn run(opts: Opts, output: &mut impl std::io::Write) -> color_eyre::Re validate_url_security(opts.file_or_url.url.as_ref(), opts.allow_insecure)?; let bytes = opts.file_or_url.fetch().await?; + let legacy_types = opts + .legacy_types + .map(|path| { + let bytes = std::fs::read(path).map_err(|e| eyre!("Cannot read legacy_types: {e}"))?; + let types = frame_decode::legacy_types::from_bytes(&bytes) + .map_err(|e| eyre!("Cannot deserialize legacy_types: {e}"))?; + Ok::<_, color_eyre::eyre::Error>(types) + }) + .transpose()?; codegen( &bytes, + legacy_types, + opts.legacy_spec_version, opts.derives, opts.attributes, opts.derives_for_type, @@ -175,6 +192,8 @@ impl syn::parse::Parse for OuterAttribute { #[allow(clippy::too_many_arguments)] fn codegen( metadata_bytes: &[u8], + legacy_types: Option, + legacy_spec_version: Option, raw_derives: Vec, raw_attributes: Vec, derives_for_type: Vec, @@ -211,8 +230,79 @@ fn codegen( } let metadata = { - let mut metadata = subxt_metadata::Metadata::decode(&mut &*metadata_bytes) - .map_err(|e| eyre!("Cannot decode the provided metadata: {e}"))?; + let runtime_metadata = subxt_metadata::decode_runtime_metadata(metadata_bytes)?; + let mut metadata = match runtime_metadata { + // Too old to work with: + frame_metadata::RuntimeMetadata::V0(_) + | frame_metadata::RuntimeMetadata::V1(_) + | frame_metadata::RuntimeMetadata::V2(_) + | frame_metadata::RuntimeMetadata::V3(_) + | frame_metadata::RuntimeMetadata::V4(_) + | frame_metadata::RuntimeMetadata::V5(_) + | frame_metadata::RuntimeMetadata::V6(_) + | frame_metadata::RuntimeMetadata::V7(_) => { + Err(eyre!("Metadata V1-V7 cannot be decoded from")) + } + // Converting legacy metadatas: + frame_metadata::RuntimeMetadata::V8(md) => { + let legacy_types = legacy_types + .ok_or_else(|| eyre!("--legacy-types needed to load V8 metadata"))?; + let legacy_spec = legacy_spec_version + .ok_or_else(|| eyre!("--legacy-spec-version needed to load V8 metadata"))?; + Metadata::from_v8(&md, &legacy_types.for_spec_version(legacy_spec)) + .map_err(|e| eyre!("Cannot load V8 metadata: {e}")) + } + frame_metadata::RuntimeMetadata::V9(md) => { + let legacy_types = legacy_types + .ok_or_else(|| eyre!("--legacy-types needed to load V9 metadata"))?; + let legacy_spec = legacy_spec_version + .ok_or_else(|| eyre!("--legacy-spec-version needed to load V9 metadata"))?; + Metadata::from_v9(&md, &legacy_types.for_spec_version(legacy_spec)) + .map_err(|e| eyre!("Cannot load V9 metadata: {e}")) + } + frame_metadata::RuntimeMetadata::V10(md) => { + let legacy_types = legacy_types + .ok_or_else(|| eyre!("--legacy-types needed to load V10 metadata"))?; + let legacy_spec = legacy_spec_version + .ok_or_else(|| eyre!("--legacy-spec-version needed to load V10 metadata"))?; + Metadata::from_v10(&md, &legacy_types.for_spec_version(legacy_spec)) + .map_err(|e| eyre!("Cannot load V10 metadata: {e}")) + } + frame_metadata::RuntimeMetadata::V11(md) => { + let legacy_types = legacy_types + .ok_or_else(|| eyre!("--legacy-types needed to load V11 metadata"))?; + let legacy_spec = legacy_spec_version + .ok_or_else(|| eyre!("--legacy-spec-version needed to load V11 metadata"))?; + Metadata::from_v11(&md, &legacy_types.for_spec_version(legacy_spec)) + .map_err(|e| eyre!("Cannot load V11 metadata: {e}")) + } + frame_metadata::RuntimeMetadata::V12(md) => { + let legacy_types = legacy_types + .ok_or_else(|| eyre!("--legacy-types needed to load V12 metadata"))?; + let legacy_spec = legacy_spec_version + .ok_or_else(|| eyre!("--legacy-spec-version needed to load V12 metadata"))?; + Metadata::from_v12(&md, &legacy_types.for_spec_version(legacy_spec)) + .map_err(|e| eyre!("Cannot load V12 metadata: {e}")) + } + frame_metadata::RuntimeMetadata::V13(md) => { + let legacy_types = legacy_types + .ok_or_else(|| eyre!("--legacy-types needed to load V13 metadata"))?; + let legacy_spec = legacy_spec_version + .ok_or_else(|| eyre!("--legacy-spec-version needed to load V13 metadata"))?; + Metadata::from_v13(&md, &legacy_types.for_spec_version(legacy_spec)) + .map_err(|e| eyre!("Cannot load V13 metadata: {e}")) + } + // Converting modern metadatas: + frame_metadata::RuntimeMetadata::V14(md) => { + Metadata::from_v14(md).map_err(|e| eyre!("Cannot load V14 metadata: {e}")) + } + frame_metadata::RuntimeMetadata::V15(md) => { + Metadata::from_v15(md).map_err(|e| eyre!("Cannot load V15 metadata: {e}")) + } + frame_metadata::RuntimeMetadata::V16(md) => { + Metadata::from_v16(md).map_err(|e| eyre!("Cannot load V16 metadata: {e}")) + } + }?; // Run this first to ensure type paths are unique (which may result in 1,2,3 suffixes being added // to type paths), so that when we validate derives/substitutions below, they are allowed for such diff --git a/cli/src/commands/diff.rs b/cli/src/commands/diff.rs index a5f723f4dbf..03208b29fa0 100644 --- a/cli/src/commands/diff.rs +++ b/cli/src/commands/diff.rs @@ -215,7 +215,6 @@ struct StorageEntryDiff { key_different: bool, value_different: bool, default_different: bool, - modifier_different: bool, } impl StorageEntryDiff { @@ -225,41 +224,32 @@ impl StorageEntryDiff { metadata_1: &Metadata, metadata_2: &Metadata, ) -> Self { - let value_1_ty_id = storage_entry_1.entry_type().value_ty(); + let value_1_ty_id = storage_entry_1.value_ty(); let value_1_hash = metadata_1 .type_hash(value_1_ty_id) .expect("type is in metadata; qed"); - let value_2_ty_id = storage_entry_2.entry_type().value_ty(); + let value_2_ty_id = storage_entry_2.value_ty(); let value_2_hash = metadata_2 .type_hash(value_2_ty_id) .expect("type is in metadata; qed"); let value_different = value_1_hash != value_2_hash; - let key_1_hash = storage_entry_1 - .entry_type() - .key_ty() - .map(|key_ty| { - metadata_1 - .type_hash(key_ty) - .expect("type is in metadata; qed") - }) - .unwrap_or_default(); - let key_2_hash = storage_entry_2 - .entry_type() - .key_ty() - .map(|key_ty| { - metadata_2 - .type_hash(key_ty) - .expect("type is in metadata; qed") - }) - .unwrap_or_default(); - let key_different = key_1_hash != key_2_hash; + let key_parts_same = storage_entry_1.keys().len() == storage_entry_2.keys().len() + && storage_entry_1 + .keys() + .zip(storage_entry_2.keys()) + .all(|(a, b)| { + let a_hash = metadata_1.type_hash(a.key_id).expect("type is in metadata"); + let b_hash = metadata_2.type_hash(b.key_id).expect("type is in metadata"); + a.hasher == b.hasher && a_hash == b_hash + }); + + let key_different = !key_parts_same; StorageEntryDiff { key_different, value_different, - default_different: storage_entry_1.default_bytes() != storage_entry_2.default_bytes(), - modifier_different: storage_entry_1.modifier() != storage_entry_2.modifier(), + default_different: storage_entry_1.default_value() != storage_entry_2.default_value(), } } @@ -271,9 +261,6 @@ impl StorageEntryDiff { if self.value_different { strings.push("value type"); } - if self.modifier_different { - strings.push("modifier"); - } if self.default_different { strings.push("default value"); } diff --git a/cli/src/commands/explore/pallets/calls.rs b/cli/src/commands/explore/pallets/calls.rs index 573191511ec..11de1ac4eb4 100644 --- a/cli/src/commands/explore/pallets/calls.rs +++ b/cli/src/commands/explore/pallets/calls.rs @@ -12,7 +12,7 @@ use subxt::utils::H256; use subxt::{ OfflineClient, config::SubstrateConfig, - metadata::{Metadata, types::PalletMetadata}, + metadata::{Metadata, PalletMetadata}, }; use crate::utils::{ diff --git a/cli/src/commands/explore/pallets/constants.rs b/cli/src/commands/explore/pallets/constants.rs index 68325ceb0a4..e91240c02a4 100644 --- a/cli/src/commands/explore/pallets/constants.rs +++ b/cli/src/commands/explore/pallets/constants.rs @@ -2,7 +2,7 @@ use clap::Args; use color_eyre::eyre::eyre; use indoc::{formatdoc, writedoc}; use scale_typegen_description::type_description; -use subxt::metadata::{Metadata, types::PalletMetadata}; +use subxt::metadata::{Metadata, PalletMetadata}; use crate::utils::{Indent, SyntaxHighlight, first_paragraph_of_docs, format_scale_value}; diff --git a/cli/src/commands/explore/pallets/events.rs b/cli/src/commands/explore/pallets/events.rs index ed87b296019..6abb36a8e84 100644 --- a/cli/src/commands/explore/pallets/events.rs +++ b/cli/src/commands/explore/pallets/events.rs @@ -2,7 +2,7 @@ use clap::Args; use color_eyre::eyre::eyre; use indoc::{formatdoc, writedoc}; use scale_info::{Variant, form::PortableForm}; -use subxt::metadata::{Metadata, types::PalletMetadata}; +use subxt::metadata::{Metadata, PalletMetadata}; use crate::utils::{Indent, fields_description, first_paragraph_of_docs}; diff --git a/cli/src/commands/explore/pallets/storage.rs b/cli/src/commands/explore/pallets/storage.rs index 3536354296e..a62aa159682 100644 --- a/cli/src/commands/explore/pallets/storage.rs +++ b/cli/src/commands/explore/pallets/storage.rs @@ -1,17 +1,11 @@ use clap::Args; -use color_eyre::{ - eyre::{bail, eyre}, - owo_colors::OwoColorize, -}; +use color_eyre::{eyre::bail, owo_colors::OwoColorize}; use indoc::{formatdoc, writedoc}; use scale_typegen_description::type_description; use scale_value::Value; use std::fmt::Write; use std::write; -use subxt::metadata::{ - Metadata, - types::{PalletMetadata, StorageEntryType, StorageMetadata}, -}; +use subxt::metadata::{Metadata, PalletMetadata, StorageMetadata}; use crate::utils::{ FileOrUrl, Indent, SyntaxHighlight, create_client, first_paragraph_of_docs, @@ -75,12 +69,7 @@ pub async fn explore_storage( ); }; - let (return_ty_id, key_ty_id) = match storage.entry_type() { - StorageEntryType::Plain(value) => (*value, None), - StorageEntryType::Map { - value_ty, key_ty, .. - } => (*value_ty, Some(*key_ty)), - }; + let return_ty_id = storage.value_ty(); let key_value_placeholder = "".blue(); @@ -114,15 +103,30 @@ pub async fn explore_storage( "}?; // inform user about shape of the key if it can be provided: - if let Some(key_ty_id) = key_ty_id { - let key_ty_description = type_description(key_ty_id, metadata.types(), true) - .expect("No type Description") - .indent(4) - .highlight(); + let storage_keys = storage.keys().collect::>(); + if !storage_keys.is_empty() { + let key_ty_description = format!( + "({})", + storage_keys + .iter() + .map(|key| type_description(key.key_id, metadata.types(), true) + .expect("No type Description")) + .collect::>() + .join(", ") + ) + .indent(4) + .highlight(); - let key_ty_example = type_example(key_ty_id, metadata.types()) - .indent(4) - .highlight(); + let key_ty_example = format!( + "({})", + storage_keys + .iter() + .map(|key| type_example(key.key_id, metadata.types()).to_string()) + .collect::>() + .join(", ") + ) + .indent(4) + .highlight(); writedoc! {output, " @@ -144,7 +148,8 @@ pub async fn explore_storage( return Ok(()); } - let storage_entry_keys: Vec = match (!trailing_args.is_empty(), key_ty_id.is_some()) { + let storage_entry_keys: Vec = match (!trailing_args.is_empty(), !storage_keys.is_empty()) + { // keys provided, keys not needed. (true, false) => { let trailing_args_str = trailing_args.join(" "); @@ -190,18 +195,17 @@ pub async fn explore_storage( // construct the client: let client = create_client(&file_or_url).await?; - let storage_query = subxt::dynamic::storage(pallet_name, storage.name(), storage_entry_keys); - let decoded_value_thunk_or_none = client + // Fetch the value: + let storage_value = client .storage() .at_latest() .await? - .fetch(&storage_query) - .await?; + .fetch((pallet_name, storage.name()), storage_entry_keys) + .await? + .decode()?; - let decoded_value_thunk = - decoded_value_thunk_or_none.ok_or(eyre!("Value not found in storage."))?; + let value = storage_value.to_string().highlight(); - let value = decoded_value_thunk.to_value()?.to_string().highlight(); writedoc! {output, " The value of the storage entry is: diff --git a/cli/src/commands/explore/runtime_apis/mod.rs b/cli/src/commands/explore/runtime_apis/mod.rs index b291a2b95b2..04a609b7b6e 100644 --- a/cli/src/commands/explore/runtime_apis/mod.rs +++ b/cli/src/commands/explore/runtime_apis/mod.rs @@ -101,15 +101,13 @@ pub async fn run<'a>( return format!("The method does not require an {input_value_placeholder}"); } - let fields: Vec<(Option<&str>, u32)> = method - .inputs() - .map(|f| (Some(f.name.as_str()), f.ty)) - .collect(); + let fields: Vec<(Option<&str>, u32)> = + method.inputs().map(|f| (Some(&*f.name), f.id)).collect(); let fields_description = fields_description(&fields, method.name(), metadata.types()).indent(4); let fields_example = - fields_composite_example(method.inputs().map(|e| e.ty), metadata.types()) + fields_composite_example(method.inputs().map(|e| e.id), metadata.types()) .indent(4) .highlight(); @@ -164,13 +162,14 @@ pub async fn run<'a>( {value_str} "}?; // encode, then decode. This ensures that the scale value is of the correct shape for the param: - let bytes = value.encode_as_type(ty.ty, metadata.types())?; - let value = Value::decode_as_type(&mut &bytes[..], ty.ty, metadata.types())?; + let bytes = value.encode_as_type(ty.id, metadata.types())?; + let value = Value::decode_as_type(&mut &bytes[..], ty.id, metadata.types())?; Ok(value) }) .collect::>>()?; - let method_call = subxt::dynamic::runtime_api_call(api_name, method.name(), args_data); + let method_call = + subxt::dynamic::runtime_api_call::<_, Value>(api_name, method.name(), args_data); let client = create_client(&file_or_url).await?; let output_value = client .runtime_api() @@ -179,7 +178,7 @@ pub async fn run<'a>( .call(method_call) .await?; - let output_value = output_value.to_value()?.to_string().highlight(); + let output_value = output_value.to_string().highlight(); writedoc! {output, " Returned value: diff --git a/clippy.toml b/clippy.toml index 0a98f3a2e7f..db18751fb38 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,3 +1,3 @@ # result_large_err lint complains if error variant is 128 bytes or more by default. # Our error is. Let's up this limit a bit for now to avoid lots of warnings. -large-error-threshold = 256 \ No newline at end of file +large-error-threshold = 512 \ No newline at end of file diff --git a/codegen/src/api/custom_values.rs b/codegen/src/api/custom_values.rs index aa816c6534a..2501bbc145c 100644 --- a/codegen/src/api/custom_values.rs +++ b/codegen/src/api/custom_values.rs @@ -57,16 +57,17 @@ fn generate_custom_value_fn( .types() .resolve(custom_value.type_id()) .is_some(); + let (return_ty, decodable) = if type_is_valid { let return_ty = type_gen .resolve_type_path(custom_value.type_id()) .expect("type is in metadata; qed") .to_token_stream(type_gen.settings()); - let decodable = quote!(#crate_path::utils::Yes); + let decodable = quote!(#crate_path::utils::Maybe); (return_ty, decodable) } else { // if type registry does not contain the type, we can just return the Encoded scale bytes. - (quote!(()), quote!(())) + (quote!(()), quote!(#crate_path::utils::No)) }; Some(quote!( diff --git a/codegen/src/api/pallet_view_functions.rs b/codegen/src/api/pallet_view_functions.rs index 2a1b9932c9f..563a621de3f 100644 --- a/codegen/src/api/pallet_view_functions.rs +++ b/codegen/src/api/pallet_view_functions.rs @@ -12,7 +12,45 @@ use scale_typegen::typegen::ir::ToTokensWithSettings; use std::collections::HashSet; use subxt_metadata::{PalletMetadata, ViewFunctionMetadata}; +pub fn generate_pallet_view_functions( + type_gen: &TypeGenerator, + pallet: &PalletMetadata, + crate_path: &syn::Path, +) -> Result { + if !pallet.has_view_functions() { + // If there are no view functions in this pallet, we + // don't generate anything. + return Ok(quote! {}); + } + + let view_functions: Vec<_> = pallet + .view_functions() + .map(|vf| generate_pallet_view_function(pallet.name(), vf, type_gen, crate_path)) + .collect::>()?; + + let view_functions_types = view_functions.iter().map(|(apis, _)| apis); + let view_functions_methods = view_functions.iter().map(|(_, getters)| getters); + + let types_mod_ident = type_gen.types_mod_ident(); + + Ok(quote! { + pub mod view_functions { + use super::root_mod; + use super::#types_mod_ident; + + pub struct ViewFunctionsApi; + + impl ViewFunctionsApi { + #( #view_functions_methods )* + } + + #( #view_functions_types )* + } + }) +} + fn generate_pallet_view_function( + pallet_name: &str, view_function: ViewFunctionMetadata<'_>, type_gen: &TypeGenerator, crate_path: &syn::Path, @@ -20,9 +58,7 @@ fn generate_pallet_view_function( let types_mod_ident = type_gen.types_mod_ident(); let view_function_name_str = view_function.name(); - let view_function_name_ident = format_ident!("{}", view_function_name_str); - - let query_id = view_function.query_id(); + let view_function_name_ident = format_ident!("{view_function_name_str}"); let validation_hash = view_function.hash(); let docs = view_function.docs(); @@ -68,7 +104,7 @@ fn generate_pallet_view_function( // Path to the actual type we'll have generated for this input. let type_path = type_gen - .resolve_type_path(input.ty) + .resolve_type_path(input.id) .expect("view function input type is in metadata; qed") .to_token_stream(type_gen.settings()); @@ -81,12 +117,11 @@ fn generate_pallet_view_function( .collect() }; - let input_struct_params = view_function_inputs + let input_tuple_types = view_function_inputs .iter() .map(|i| { - let arg = &i.name; let ty = &i.type_alias; - quote!(pub #arg: #ty) + quote!(#view_function_name_ident::#ty) }) .collect::>(); @@ -111,19 +146,12 @@ fn generate_pallet_view_function( .resolve_type_path(view_function.output_ty())? .to_token_stream(type_gen.settings()); - let input_struct_derives = type_gen.settings().derives.default_derives(); - // Define the input and output type bits. - let view_function_def = quote!( + let view_function_types = quote!( pub mod #view_function_name_ident { use super::root_mod; use super::#types_mod_ident; - #input_struct_derives - pub struct Input { - #(#input_struct_params,)* - } - #(#input_type_aliases)* pub mod output { @@ -134,61 +162,23 @@ fn generate_pallet_view_function( ); // Define the getter method that will live on the `ViewFunctionApi` type. - let view_function_getter = quote!( + let view_function_method = quote!( #docs pub fn #view_function_name_ident( &self, #(#input_args),* ) -> #crate_path::view_functions::payload::StaticPayload< - #view_function_name_ident::Input, + (#(#input_tuple_types,)*), #view_function_name_ident::output::Output > { #crate_path::view_functions::payload::StaticPayload::new_static( - [#(#query_id,)*], - #view_function_name_ident::Input { - #(#input_param_names,)* - }, + #pallet_name, + #view_function_name_str, + (#(#input_param_names,)*), [#(#validation_hash,)*], ) } ); - Ok((view_function_def, view_function_getter)) -} - -pub fn generate_pallet_view_functions( - type_gen: &TypeGenerator, - pallet: &PalletMetadata, - crate_path: &syn::Path, -) -> Result { - if !pallet.has_view_functions() { - // If there are no view functions in this pallet, we - // don't generate anything. - return Ok(quote! {}); - } - - let view_functions: Vec<_> = pallet - .view_functions() - .map(|vf| generate_pallet_view_function(vf, type_gen, crate_path)) - .collect::>()?; - - let view_functions_defs = view_functions.iter().map(|(apis, _)| apis); - let view_functions_getters = view_functions.iter().map(|(_, getters)| getters); - - let types_mod_ident = type_gen.types_mod_ident(); - - Ok(quote! { - pub mod view_functions { - use super::root_mod; - use super::#types_mod_ident; - - pub struct ViewFunctionsApi; - - impl ViewFunctionsApi { - #( #view_functions_getters )* - } - - #( #view_functions_defs )* - } - }) + Ok((view_function_types, view_function_method)) } diff --git a/codegen/src/api/runtime_apis.rs b/codegen/src/api/runtime_apis.rs index d6693131654..4bfe1bff61e 100644 --- a/codegen/src/api/runtime_apis.rs +++ b/codegen/src/api/runtime_apis.rs @@ -16,16 +16,51 @@ use quote::{format_ident, quote}; use crate::CodegenError; +/// Generate the runtime APIs. +pub fn generate_runtime_apis( + metadata: &Metadata, + type_gen: &TypeGenerator, + types_mod_ident: &syn::Ident, + crate_path: &syn::Path, +) -> Result { + let runtime_fns: Vec<_> = metadata + .runtime_api_traits() + .map(|api| generate_runtime_api(api, type_gen, crate_path)) + .collect::>()?; + + let trait_defs = runtime_fns.iter().map(|(apis, _)| apis); + let trait_getters = runtime_fns.iter().map(|(_, getters)| getters); + + Ok(quote! { + pub mod runtime_apis { + use super::root_mod; + use super::#types_mod_ident; + + use #crate_path::ext::codec::Encode; + + pub struct RuntimeApi; + + impl RuntimeApi { + #( #trait_getters )* + } + + #( #trait_defs )* + } + }) +} + /// Generates runtime functions for the given API metadata. fn generate_runtime_api( api: RuntimeApiMetadata, type_gen: &TypeGenerator, crate_path: &syn::Path, ) -> Result<(TokenStream2, TokenStream2), CodegenError> { + let types_mod_ident = type_gen.types_mod_ident(); // Trait name must remain as is (upper case) to identify the runtime call. let trait_name_str = api.name(); // The snake case for the trait name. let trait_name_snake = format_ident!("{}", api.name().to_snake_case()); + let docs = api.docs(); let docs: TokenStream2 = type_gen .settings() @@ -33,11 +68,12 @@ fn generate_runtime_api( .then_some(quote! { #( #[doc = #docs ] )* }) .unwrap_or_default(); - let structs_and_methods = api + let types_and_methods = api .methods() .map(|method| { let method_name = format_ident!("{}", method.name()); let method_name_str = method.name(); + let validation_hash = method.hash(); let docs = method.docs(); let docs: TokenStream2 = type_gen @@ -46,111 +82,130 @@ fn generate_runtime_api( .then_some(quote! { #( #[doc = #docs ] )* }) .unwrap_or_default(); - let mut unique_names = HashSet::new(); - let mut unique_aliases = HashSet::new(); - - let inputs: Vec<_> = method - .inputs() - .enumerate() - .map(|(idx, input)| { - // These are method names, which can just be '_', but struct field names can't - // just be an underscore, so fix any such names we find to work in structs. - let mut name = input.name.trim_start_matches('_').to_string(); - if name.is_empty() { - name = format!("_{idx}"); - } - while !unique_names.insert(name.clone()) { - // Name is already used, append the index until it is unique. - name = format!("{name}_param{idx}"); - } - - let mut alias = name.to_upper_camel_case(); - // Note: name is not empty. - if alias.as_bytes()[0].is_ascii_digit() { - alias = format!("Param{alias}"); - } - while !unique_aliases.insert(alias.clone()) { - alias = format!("{alias}Param{idx}"); - } - - let (alias_name, name) = (format_ident!("{alias}"), format_ident!("{name}")); + struct Input { + name: syn::Ident, + type_alias: syn::Ident, + type_path: TokenStream2, + } - // Generate alias for runtime type. - let ty = type_gen - .resolve_type_path(input.ty) - .expect("runtime api input type is in metadata; qed") - .to_token_stream(type_gen.settings()); - let aliased_param = quote!( pub type #alias_name = #ty; ); + let runtime_api_inputs: Vec = { + let mut unique_names = HashSet::new(); + let mut unique_aliases = HashSet::new(); + + method + .inputs() + .enumerate() + .map(|(idx, input)| { + // The method argument name is either the input name or the + // index (eg _1, _2 etc) if one isn't provided. + // if we get unlucky we'll end up with param_param1 etc. + let mut name = input.name.trim_start_matches('_').to_string(); + if name.is_empty() { + name = format!("_{idx}"); + } + while !unique_names.insert(name.clone()) { + name = format!("{name}_param{idx}"); + } + + // The alias is either InputName if provided, or Param1, Param2 etc if not. + // If we get unlucky we may even end up with ParamParam1 etc. + let mut alias = name.trim_start_matches('_').to_upper_camel_case(); + // Note: name is not empty. + if alias.as_bytes()[0].is_ascii_digit() { + alias = format!("Param{alias}"); + } + while !unique_aliases.insert(alias.clone()) { + alias = format!("{alias}Param{idx}"); + } + + // Generate alias for runtime type. + let type_path = type_gen + .resolve_type_path(input.id) + .expect("runtime api input type is in metadata; qed") + .to_token_stream(type_gen.settings()); + + Input { + name: format_ident!("{name}"), + type_alias: format_ident!("{alias}"), + type_path, + } + }) + .collect() + }; + + let input_tuple_types = runtime_api_inputs + .iter() + .map(|i| { + let ty = &i.type_alias; + quote!(#method_name::#ty) + }) + .collect::>(); + + let input_args = runtime_api_inputs + .iter() + .map(|i| { + let arg = &i.name; + let ty = &i.type_alias; + quote!(#arg: #method_name::#ty) + }) + .collect::>(); - // Structures are placed on the same level as the alias module. - let struct_ty_path = quote!( #method_name::#alias_name ); - let struct_param = quote!(#name: #struct_ty_path); + let input_param_names = runtime_api_inputs.iter().map(|i| &i.name); - // Function parameters must be indented by `types`. - let fn_param = quote!(#name: types::#struct_ty_path); - (fn_param, struct_param, name, aliased_param) - }) - .collect(); + let input_type_aliases = runtime_api_inputs.iter().map(|i| { + let ty = &i.type_alias; + let path = &i.type_path; + quote!(pub type #ty = #path;) + }); - let fn_params = inputs.iter().map(|(fn_param, _, _, _)| fn_param); - let struct_params = inputs.iter().map(|(_, struct_param, _, _)| struct_param); - let param_names = inputs.iter().map(|(_, _, name, _)| name); - let type_aliases = inputs.iter().map(|(_, _, _, aliased_param)| aliased_param); - let types_mod_ident = type_gen.types_mod_ident(); + let output_type_path = type_gen + .resolve_type_path(method.output_ty())? + .to_token_stream(type_gen.settings()); - let output = type_gen.resolve_type_path(method.output_ty())?.to_token_stream(type_gen.settings()); - let aliased_module = quote!( + // Define the input and output type bits for the method. + let runtime_api_types = quote! { pub mod #method_name { + use super::root_mod; use super::#types_mod_ident; - #( #type_aliases )* + #(#input_type_aliases)* - // Guard the `Output` name against collisions by placing it in a dedicated module. pub mod output { use super::#types_mod_ident; - pub type Output = #output; + pub type Output = #output_type_path; } } - ); + }; - // From the method metadata generate a structure that holds - // all parameter types. This structure is used with metadata - // to encode parameters to the call via `encode_as_fields_to`. - let derives = type_gen.settings().derives.default_derives(); - let struct_name = format_ident!("{}", method.name().to_upper_camel_case()); - let struct_input = quote!( - #aliased_module - - #derives - pub struct #struct_name { - #( pub #struct_params, )* - } - ); - - let call_hash = method.hash(); - let method = quote!( + // Define the getter method that will live on the `ViewFunctionApi` type. + let runtime_api_method = quote!( #docs - pub fn #method_name(&self, #( #fn_params, )* ) -> #crate_path::runtime_api::payload::StaticPayload { + pub fn #method_name( + &self, + #(#input_args),* + ) -> #crate_path::runtime_api::payload::StaticPayload< + (#(#input_tuple_types,)*), + #method_name::output::Output + > { #crate_path::runtime_api::payload::StaticPayload::new_static( #trait_name_str, #method_name_str, - types::#struct_name { #( #param_names, )* }, - [#(#call_hash,)*], + (#(#input_param_names,)*), + [#(#validation_hash,)*], ) } ); - Ok((struct_input, method)) + Ok((runtime_api_types, runtime_api_method)) }) .collect::, CodegenError>>()?; let trait_name = format_ident!("{}", trait_name_str); + let types = types_and_methods.iter().map(|(types, _)| types); + let methods = types_and_methods.iter().map(|(_, methods)| methods); - let structs = structs_and_methods.iter().map(|(struct_, _)| struct_); - let methods = structs_and_methods.iter().map(|(_, method)| method); - let types_mod_ident = type_gen.types_mod_ident(); - - let runtime_api = quote!( + // The runtime API definition and types. + let trait_defs = quote!( pub mod #trait_name_snake { use super::root_mod; use super::#types_mod_ident; @@ -162,11 +217,7 @@ fn generate_runtime_api( #( #methods )* } - pub mod types { - use super::#types_mod_ident; - - #( #structs )* - } + #( #types )* } ); @@ -177,40 +228,7 @@ fn generate_runtime_api( } ); - Ok((runtime_api, trait_getter)) -} - -/// Generate the runtime APIs. -pub fn generate_runtime_apis( - metadata: &Metadata, - type_gen: &TypeGenerator, - types_mod_ident: &syn::Ident, - crate_path: &syn::Path, -) -> Result { - let runtime_fns: Vec<_> = metadata - .runtime_api_traits() - .map(|api| generate_runtime_api(api, type_gen, crate_path)) - .collect::>()?; - - let runtime_apis_def = runtime_fns.iter().map(|(apis, _)| apis); - let runtime_apis_getters = runtime_fns.iter().map(|(_, getters)| getters); - - Ok(quote! { - pub mod runtime_apis { - use super::root_mod; - use super::#types_mod_ident; - - use #crate_path::ext::codec::Encode; - - pub struct RuntimeApi; - - impl RuntimeApi { - #( #runtime_apis_getters )* - } - - #( #runtime_apis_def )* - } - }) + Ok((trait_defs, trait_getter)) } #[cfg(test)] @@ -295,14 +313,9 @@ mod tests { let code = generate_code(runtime_apis); - let structure = quote! { - pub struct Test { - pub foo: test::Foo, - pub bar: test::Bar, - } - }; let expected_alias = quote!( pub mod test { + use super::root_mod; use super::runtime_types; pub type Foo = ::core::primitive::bool; pub type Bar = ::core::primitive::bool; @@ -312,7 +325,7 @@ mod tests { } } ); - assert!(code.contains(&structure.to_string())); + assert!(code.contains(&expected_alias.to_string())); } @@ -345,15 +358,9 @@ mod tests { let code = generate_code(runtime_apis); - let structure = quote! { - pub struct Test { - pub a: test::A, - pub a_param1: test::AParam1, - pub a_param2: test::AParam2, - } - }; let expected_alias = quote!( pub mod test { + use super::root_mod; use super::runtime_types; pub type A = ::core::primitive::bool; pub type AParam1 = ::core::primitive::bool; @@ -365,7 +372,6 @@ mod tests { } ); - assert!(code.contains(&structure.to_string())); assert!(code.contains(&expected_alias.to_string())); } @@ -406,17 +412,9 @@ mod tests { let code = generate_code(runtime_apis); - let structure = quote! { - pub struct Test { - pub _0: test::Param0, - pub a: test::A, - pub param_0: test::Param0Param2, - pub _3: test::Param3, - pub param_0_param_2: test::Param0Param2Param4, - } - }; let expected_alias = quote!( pub mod test { + use super::root_mod; use super::runtime_types; pub type Param0 = ::core::primitive::bool; pub type A = ::core::primitive::bool; @@ -430,7 +428,6 @@ mod tests { } ); - assert!(code.contains(&structure.to_string())); assert!(code.contains(&expected_alias.to_string())); } } diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index 922aca7d7af..3ef3cd041a5 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -2,14 +2,11 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use heck::{ToSnakeCase as _, ToUpperCamelCase}; -use proc_macro2::{Ident, TokenStream as TokenStream2, TokenStream}; +use heck::ToSnakeCase as _; +use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; -use scale_info::TypeDef; use scale_typegen::TypeGenerator; -use subxt_metadata::{ - PalletMetadata, StorageEntryMetadata, StorageEntryModifier, StorageEntryType, StorageHasher, -}; +use subxt_metadata::{PalletMetadata, StorageEntryMetadata}; use super::CodegenError; @@ -29,33 +26,34 @@ pub fn generate_storage( crate_path: &syn::Path, ) -> Result { let Some(storage) = pallet.storage() else { + // If there are no storage entries in this pallet, we + // don't generate anything. return Ok(quote!()); }; - let (storage_fns, alias_modules): (Vec, Vec) = storage + let storage_entries = storage .entries() .iter() .map(|entry| generate_storage_entry_fns(type_gen, pallet, entry, crate_path)) - .collect::, CodegenError>>()? - .into_iter() - .unzip(); + .collect::, CodegenError>>()?; + + let storage_entry_types = storage_entries.iter().map(|(types, _)| types); + let storage_entry_methods = storage_entries.iter().map(|(_, method)| method); + let types_mod_ident = type_gen.types_mod_ident(); Ok(quote! { pub mod storage { + use super::root_mod; use super::#types_mod_ident; - pub mod types { - use super::#types_mod_ident; - - #( #alias_modules )* - } - pub struct StorageApi; impl StorageApi { - #( #storage_fns )* + #( #storage_entry_methods )* } + + #( #storage_entry_types )* } }) } @@ -67,239 +65,108 @@ fn generate_storage_entry_fns( storage_entry: &StorageEntryMetadata, crate_path: &syn::Path, ) -> Result<(TokenStream2, TokenStream2), CodegenError> { - let snake_case_name = storage_entry.name().to_snake_case(); - let storage_entry_ty = storage_entry.entry_type().value_ty(); - let storage_entry_value_ty = type_gen - .resolve_type_path(storage_entry_ty) - .expect("storage type is in metadata; qed") - .to_token_stream(type_gen.settings()); - - let alias_name = format_ident!("{}", storage_entry.name().to_upper_camel_case()); - let alias_module_name = format_ident!("{snake_case_name}"); - let alias_storage_path = quote!( types::#alias_module_name::#alias_name ); - - struct MapEntryKey { - arg_name: Ident, - alias_type_def: TokenStream, - alias_type_path: TokenStream, - hasher: StorageHasher, - } - - let map_entry_key = |idx, id, hasher| -> MapEntryKey { - let arg_name: Ident = format_ident!("_{}", idx); - let ty_path = type_gen - .resolve_type_path(id) - .expect("type is in metadata; qed"); - - let alias_name = format_ident!("Param{}", idx); - let alias_type = ty_path.to_token_stream(type_gen.settings()); - - let alias_type_def = quote!( pub type #alias_name = #alias_type; ); - let alias_type_path = quote!( types::#alias_module_name::#alias_name ); - - MapEntryKey { - arg_name, - alias_type_def, - alias_type_path, - hasher, - } - }; - - let keys: Vec = match storage_entry.entry_type() { - StorageEntryType::Plain(_) => vec![], - StorageEntryType::Map { - key_ty, hashers, .. - } => { - if hashers.len() == 1 { - // If there's exactly 1 hasher, then we have a plain StorageMap. We can't - // break the key down (even if it's a tuple) because the hasher applies to - // the whole key. - vec![map_entry_key(0, *key_ty, hashers[0])] - } else { - // If there are multiple hashers, then we have a StorageDoubleMap or StorageNMap. - // We expect the key type to be tuple, and we will return a MapEntryKey for each - // key in the tuple. - let hasher_count = hashers.len(); - let tuple = match &type_gen - .resolve_type(*key_ty) - .expect("key type should be present") - .type_def - { - TypeDef::Tuple(tuple) => tuple, - _ => { - return Err(CodegenError::InvalidStorageHasherCount { - storage_entry_name: storage_entry.name().to_owned(), - key_count: 1, - hasher_count, - }); - } - }; - - // We should have the same number of hashers and keys. - let key_count = tuple.fields.len(); - if hasher_count != key_count { - return Err(CodegenError::InvalidStorageHasherCount { - storage_entry_name: storage_entry.name().to_owned(), - key_count, - hasher_count, - }); - } - - // Collect them together. - tuple - .fields - .iter() - .zip(hashers) - .enumerate() - .map(|(idx, (field, hasher))| map_entry_key(idx, field.id, *hasher)) - .collect() - } - } - }; + let types_mod_ident = type_gen.types_mod_ident(); let pallet_name = pallet.name(); - let storage_name = storage_entry.name(); - let Some(storage_hash) = pallet.storage_hash(storage_name) else { + let storage_entry_name_str = storage_entry.name(); + let storage_entry_snake_case_name = storage_entry_name_str.to_snake_case(); + let storage_entry_snake_case_ident = format_ident!("{storage_entry_snake_case_name}"); + let Some(validation_hash) = pallet.storage_hash(storage_entry_name_str) else { return Err(CodegenError::MissingStorageMetadata( pallet_name.into(), - storage_name.into(), + storage_entry_name_str.into(), )); }; let docs = storage_entry.docs(); - let docs = type_gen + let docs: TokenStream2 = type_gen .settings() .should_gen_docs .then_some(quote! { #( #[doc = #docs ] )* }) .unwrap_or_default(); - let is_defaultable_type = match storage_entry.modifier() { - StorageEntryModifier::Default => quote!(#crate_path::utils::Yes), - StorageEntryModifier::Optional => quote!(()), - }; + struct Input { + type_alias: syn::Ident, + type_path: TokenStream2, + } - // Note: putting `#crate_path::storage::address::StaticStorageKey` into this variable is necessary - // to get the line width below a certain limit. If not done, rustfmt will refuse to format the following big expression. - // for more information see [this post](https://users.rust-lang.org/t/rustfmt-silently-fails-to-work/75485/4). - let static_storage_key: TokenStream = quote!(#crate_path::storage::address::StaticStorageKey); - let all_fns = (0..=keys.len()).map(|n_keys| { - let keys_slice = &keys[..n_keys]; - let (fn_name, is_fetchable, is_iterable) = if n_keys == keys.len() { - let fn_name = format_ident!("{snake_case_name}"); - (fn_name, true, false) - } else { - let fn_name = if n_keys == 0 { - format_ident!("{snake_case_name}_iter") - } else { - format_ident!("{snake_case_name}_iter{}", n_keys) - }; - (fn_name, false, true) - }; - let is_fetchable_type = is_fetchable - .then_some(quote!(#crate_path::utils::Yes)) - .unwrap_or(quote!(())); - let is_iterable_type = is_iterable - .then_some(quote!(#crate_path::utils::Yes)) - .unwrap_or(quote!(())); - - let (keys, keys_type) = match keys_slice.len() { - 0 => (quote!(()), quote!(())), - 1 => { - let key = &keys_slice[0]; - if key.hasher.ends_with_key() { - let arg = &key.arg_name; - let keys = quote!(#static_storage_key::new(#arg)); - let path = &key.alias_type_path; - let path = quote!(#static_storage_key<#path>); - (keys, path) - } else { - (quote!(()), quote!(())) - } - } - _ => { - let keys_iter = keys_slice.iter().map( - |MapEntryKey { - arg_name, hasher, .. - }| { - if hasher.ends_with_key() { - quote!( #static_storage_key::new(#arg_name) ) - } else { - quote!(()) - } - }, - ); - let keys = quote!( (#(#keys_iter,)*) ); - let paths_iter = keys_slice.iter().map( - |MapEntryKey { - alias_type_path, - hasher, - .. - }| { - if hasher.ends_with_key() { - quote!( #static_storage_key<#alias_type_path> ) - } else { - quote!(()) - } - }, - ); - let paths = quote!( (#(#paths_iter,)*) ); - (keys, paths) + let storage_key_types: Vec = storage_entry + .keys() + .enumerate() + .map(|(idx, key)| { + // Storage key aliases are just indexes; no names to use. + let type_alias = format_ident!("Param{}", idx); + + // Path to the actual type we'll have generated for this input. + let type_path = type_gen + .resolve_type_path(key.key_id) + .expect("view function input type is in metadata; qed") + .to_token_stream(type_gen.settings()); + + Input { + type_alias, + type_path, } - }; + }) + .collect(); - let key_args = keys_slice.iter().map( - |MapEntryKey { - arg_name, - alias_type_path, - .. - }| quote!( #arg_name: #alias_type_path ), - ); - - quote!( - #docs - pub fn #fn_name( - &self, - #(#key_args,)* - ) -> #crate_path::storage::address::StaticAddress::< - #keys_type, - #alias_storage_path, - #is_fetchable_type, - #is_defaultable_type, - #is_iterable_type - > { - #crate_path::storage::address::StaticAddress::new_static( - #pallet_name, - #storage_name, - #keys, - [#(#storage_hash,)*] - ) - } - ) - }); + let storage_key_tuple_types = storage_key_types + .iter() + .map(|i| { + let ty = &i.type_alias; + quote!(#storage_entry_snake_case_ident::#ty) + }) + .collect::>(); - let alias_types = keys + let storage_key_type_aliases = storage_key_types .iter() - .map(|MapEntryKey { alias_type_def, .. }| alias_type_def); + .map(|i| { + let ty = &i.type_alias; + let path = &i.type_path; + quote!(pub type #ty = #path;) + }) + .collect::>(); + + let storage_value_type_path = type_gen + .resolve_type_path(storage_entry.value_ty())? + .to_token_stream(type_gen.settings()); - let types_mod_ident = type_gen.types_mod_ident(); - // Generate type alias for the return type only, since - // the keys of the storage entry are not explicitly named. - let alias_module = quote! { - pub mod #alias_module_name { + let is_plain = if storage_entry.keys().len() == 0 { + quote!(#crate_path::utils::Yes) + } else { + quote!(#crate_path::utils::Maybe) + }; + + let storage_entry_types = quote!( + pub mod #storage_entry_snake_case_ident { + use super::root_mod; use super::#types_mod_ident; - pub type #alias_name = #storage_entry_value_ty; + #(#storage_key_type_aliases)* - #( #alias_types )* + pub mod output { + use super::#types_mod_ident; + pub type Output = #storage_value_type_path; + } } - }; + ); + + let storage_entry_method = quote!( + #docs + pub fn #storage_entry_snake_case_ident(&self) -> #crate_path::storage::address::StaticAddress< + (#(#storage_key_tuple_types,)*), + #storage_entry_snake_case_ident::output::Output, + #is_plain + > { + #crate_path::storage::address::StaticAddress::new_static( + #pallet_name, + #storage_entry_name_str, + [#(#validation_hash,)*], + ) + } + ); - Ok(( - quote! { - #( #all_fns )* - }, - alias_module, - )) + Ok((storage_entry_types, storage_entry_method)) } #[cfg(test)] diff --git a/core/Cargo.toml b/core/Cargo.toml index 8978c6322c4..f41477cc876 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -27,6 +27,8 @@ std = [ "tracing/std", "impl-serde/std", "primitive-types/std", + "sp-core/std", + "sp-keyring/std", "sp-crypto-hashing/std", ] diff --git a/core/src/blocks/extrinsic_transaction_extensions.rs b/core/src/blocks/extrinsic_transaction_extensions.rs index 12e0ca4fe63..12ef7fe1560 100644 --- a/core/src/blocks/extrinsic_transaction_extensions.rs +++ b/core/src/blocks/extrinsic_transaction_extensions.rs @@ -7,7 +7,9 @@ use crate::config::transaction_extensions::{ ChargeAssetTxPayment, ChargeTransactionPayment, CheckNonce, }; use crate::dynamic::Value; -use crate::{Metadata, config::Config, error::Error}; +use crate::error::ExtrinsicError; +use crate::{Metadata, config::Config}; +use alloc::borrow::ToOwned; use frame_decode::extrinsics::ExtrinsicExtensions; use scale_decode::DecodeAsType; @@ -50,7 +52,7 @@ impl<'a, T: Config> ExtrinsicTransactionExtensions<'a, T> { /// Searches through all signed extensions to find a specific one. /// If the Signed Extension is not found `Ok(None)` is returned. /// If the Signed Extension is found but decoding failed `Err(_)` is returned. - pub fn find>(&self) -> Result, Error> { + pub fn find>(&self) -> Result, ExtrinsicError> { for ext in self.iter() { match ext.as_signed_extension::() { // We found a match; return it: @@ -117,12 +119,16 @@ impl<'a, T: Config> ExtrinsicTransactionExtension<'a, T> { } /// Signed Extension as a [`scale_value::Value`] - pub fn value(&self) -> Result, Error> { + pub fn value(&self) -> Result, ExtrinsicError> { let value = scale_value::scale::decode_as_type( &mut &self.bytes[..], self.ty_id, self.metadata.types(), - )?; + ) + .map_err(|e| ExtrinsicError::CouldNotDecodeTransactionExtension { + name: self.identifier.to_owned(), + error: e.into(), + })?; Ok(value) } @@ -131,15 +137,19 @@ impl<'a, T: Config> ExtrinsicTransactionExtension<'a, T> { /// decode with. pub fn as_signed_extension>( &self, - ) -> Result, Error> { + ) -> Result, ExtrinsicError> { if !S::matches(self.identifier, self.ty_id, self.metadata.types()) { return Ok(None); } self.as_type::().map(Some) } - fn as_type(&self) -> Result { - let value = E::decode_as_type(&mut &self.bytes[..], self.ty_id, self.metadata.types())?; + fn as_type(&self) -> Result { + let value = E::decode_as_type(&mut &self.bytes[..], self.ty_id, self.metadata.types()) + .map_err(|e| ExtrinsicError::CouldNotDecodeTransactionExtension { + name: self.identifier.to_owned(), + error: e, + })?; Ok(value) } } diff --git a/core/src/blocks/extrinsics.rs b/core/src/blocks/extrinsics.rs index d58af734830..94de10ade37 100644 --- a/core/src/blocks/extrinsics.rs +++ b/core/src/blocks/extrinsics.rs @@ -2,19 +2,16 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use super::BlockError; use crate::blocks::extrinsic_transaction_extensions::ExtrinsicTransactionExtensions; use crate::{ Metadata, config::{Config, HashFor, Hasher}, - error::{Error, MetadataError}, + error::{ExtrinsicDecodeErrorAt, ExtrinsicDecodeErrorAtReason, ExtrinsicError}, }; use alloc::sync::Arc; use alloc::vec::Vec; -use core::ops::Deref; use frame_decode::extrinsics::Extrinsic; -use scale_decode::DecodeAsType; -use subxt_metadata::PalletMetadata; +use scale_decode::{DecodeAsFields, DecodeAsType}; pub use crate::blocks::StaticExtrinsic; @@ -30,7 +27,10 @@ impl Extrinsics { /// Instantiate a new [`Extrinsics`] object, given a vector containing /// each extrinsic hash (in the form of bytes) and some metadata that /// we'll use to decode them. - pub fn decode_from(extrinsics: Vec>, metadata: Metadata) -> Result { + pub fn decode_from( + extrinsics: Vec>, + metadata: Metadata, + ) -> Result { let hasher = T::Hasher::new(&metadata); let extrinsics = extrinsics .into_iter() @@ -39,29 +39,25 @@ impl Extrinsics { let cursor = &mut &*bytes; // Try to decode the extrinsic. - let decoded_info = frame_decode::extrinsics::decode_extrinsic( - cursor, - metadata.deref(), - metadata.types(), - ) - .map_err(|error| BlockError::ExtrinsicDecodeError { - extrinsic_index, - error, - })? - .into_owned(); + let decoded_info = + frame_decode::extrinsics::decode_extrinsic(cursor, &metadata, metadata.types()) + .map_err(|error| ExtrinsicDecodeErrorAt { + extrinsic_index, + error: ExtrinsicDecodeErrorAtReason::DecodeError(error), + })? + .into_owned(); // We didn't consume all bytes, so decoding probably failed. if !cursor.is_empty() { - return Err(BlockError::LeftoverBytes { + return Err(ExtrinsicDecodeErrorAt { extrinsic_index, - num_leftover_bytes: cursor.len(), - } - .into()); + error: ExtrinsicDecodeErrorAtReason::LeftoverBytes(cursor.to_vec()), + }); } Ok(Arc::new((decoded_info, bytes))) }) - .collect::>()?; + .collect::>()?; Ok(Self { extrinsics, @@ -106,7 +102,7 @@ impl Extrinsics { /// If an error occurs, all subsequent iterations return `None`. pub fn find( &self, - ) -> impl Iterator, Error>> { + ) -> impl Iterator, ExtrinsicError>> { self.iter().filter_map(|details| { match details.as_extrinsic::() { // Failed to decode extrinsic: @@ -120,18 +116,22 @@ impl Extrinsics { /// Iterate through the extrinsics using metadata to dynamically decode and skip /// them, and return the first extrinsic found which decodes to the provided `E` type. - pub fn find_first(&self) -> Result>, Error> { + pub fn find_first( + &self, + ) -> Result>, ExtrinsicError> { self.find::().next().transpose() } /// Iterate through the extrinsics using metadata to dynamically decode and skip /// them, and return the last extrinsic found which decodes to the provided `Ev` type. - pub fn find_last(&self) -> Result>, Error> { + pub fn find_last( + &self, + ) -> Result>, ExtrinsicError> { self.find::().last().transpose() } /// Find an extrinsics that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { + pub fn has(&self) -> Result { Ok(self.find::().next().transpose()?.is_some()) } } @@ -264,61 +264,63 @@ where } /// The index of the extrinsic variant that the extrinsic originated from. - pub fn variant_index(&self) -> u8 { + pub fn call_index(&self) -> u8 { self.decoded_info().call_index() } /// The name of the pallet from whence the extrinsic originated. - pub fn pallet_name(&self) -> Result<&str, Error> { - Ok(self.extrinsic_metadata()?.pallet.name()) + pub fn pallet_name(&self) -> &str { + self.decoded_info().pallet_name() } /// The name of the call (ie the name of the variant that it corresponds to). - pub fn variant_name(&self) -> Result<&str, Error> { - Ok(&self.extrinsic_metadata()?.variant.name) - } - - /// Fetch the metadata for this extrinsic. - pub fn extrinsic_metadata(&self) -> Result, Error> { - let pallet = self.metadata.pallet_by_index_err(self.pallet_index())?; - let variant = pallet - .call_variant_by_index(self.variant_index()) - .ok_or_else(|| MetadataError::VariantIndexNotFound(self.variant_index()))?; - - Ok(ExtrinsicMetadataDetails { pallet, variant }) + pub fn call_name(&self) -> &str { + self.decoded_info().call_name() } /// Decode and provide the extrinsic fields back in the form of a [`scale_value::Composite`] /// type which represents the named or unnamed fields that were present in the extrinsic. - pub fn field_values(&self) -> Result, Error> { + pub fn decode_as_fields(&self) -> Result { let bytes = &mut self.field_bytes(); - let extrinsic_metadata = self.extrinsic_metadata()?; - - let mut fields = extrinsic_metadata - .variant - .fields - .iter() - .map(|f| scale_decode::Field::new(f.ty.id, f.name.as_deref())); + let mut fields = self.decoded_info().call_data().map(|d| { + let name = if d.name().is_empty() { + None + } else { + Some(d.name()) + }; + scale_decode::Field::new(*d.ty(), name) + }); let decoded = - scale_value::scale::decode_as_fields(bytes, &mut fields, self.metadata.types())?; + E::decode_as_fields(bytes, &mut fields, self.metadata.types()).map_err(|e| { + ExtrinsicError::CannotDecodeFields { + extrinsic_index: self.index as usize, + error: e, + } + })?; Ok(decoded) } /// Attempt to decode these [`ExtrinsicDetails`] into a type representing the extrinsic fields. /// Such types are exposed in the codegen as `pallet_name::calls::types::CallName` types. - pub fn as_extrinsic(&self) -> Result, Error> { - let extrinsic_metadata = self.extrinsic_metadata()?; - if extrinsic_metadata.pallet.name() == E::PALLET - && extrinsic_metadata.variant.name == E::CALL + pub fn as_extrinsic(&self) -> Result, ExtrinsicError> { + if self.decoded_info().pallet_name() == E::PALLET + && self.decoded_info().call_name() == E::CALL { - let mut fields = extrinsic_metadata - .variant - .fields - .iter() - .map(|f| scale_decode::Field::new(f.ty.id, f.name.as_deref())); + let mut fields = self.decoded_info().call_data().map(|d| { + let name = if d.name().is_empty() { + None + } else { + Some(d.name()) + }; + scale_decode::Field::new(*d.ty(), name) + }); let decoded = - E::decode_as_fields(&mut self.field_bytes(), &mut fields, self.metadata.types())?; + E::decode_as_fields(&mut self.field_bytes(), &mut fields, self.metadata.types()) + .map_err(|e| ExtrinsicError::CannotDecodeFields { + extrinsic_index: self.index as usize, + error: e, + })?; Ok(Some(decoded)) } else { Ok(None) @@ -328,12 +330,16 @@ where /// Attempt to decode these [`ExtrinsicDetails`] into an outer call enum type (which includes /// the pallet and extrinsic enum variants as well as the extrinsic fields). A compatible /// type for this is exposed via static codegen as a root level `Call` type. - pub fn as_root_extrinsic(&self) -> Result { + pub fn as_root_extrinsic(&self) -> Result { let decoded = E::decode_as_type( &mut &self.call_bytes()[..], self.metadata.outer_enums().call_enum_ty(), self.metadata.types(), - )?; + ) + .map_err(|e| ExtrinsicError::CannotDecodeIntoRootExtrinsic { + extrinsic_index: self.index as usize, + error: e, + })?; Ok(decoded) } @@ -351,14 +357,6 @@ pub struct FoundExtrinsic { pub value: E, } -/// Details for the given extrinsic plucked from the metadata. -pub struct ExtrinsicMetadataDetails<'a> { - /// Metadata for the pallet that the extrinsic belongs to. - pub pallet: PalletMetadata<'a>, - /// Metadata for the variant which describes the pallet extrinsics. - pub variant: &'a scale_info::Variant, -} - #[cfg(test)] mod tests { use super::*; @@ -488,7 +486,7 @@ mod tests { let runtime_metadata: RuntimeMetadataPrefixed = meta.into(); let metadata: subxt_metadata::Metadata = runtime_metadata.try_into().unwrap(); - Metadata::from(metadata) + metadata } #[test] @@ -496,7 +494,7 @@ mod tests { let metadata = metadata(); // Except our metadata to contain the registered types. - let pallet = metadata.pallet_by_index(0).expect("pallet exists"); + let pallet = metadata.pallet_by_call_index(0).expect("pallet exists"); let extrinsic = pallet .call_variant_by_index(2) .expect("metadata contains the RuntimeCall enum with this pallet"); @@ -513,12 +511,10 @@ mod tests { let result = Extrinsics::::decode_from(vec![vec![]], metadata); assert_matches!( result.err(), - Some(crate::Error::Block( - crate::error::BlockError::ExtrinsicDecodeError { - extrinsic_index: 0, - error: _ - } - )) + Some(crate::error::ExtrinsicDecodeErrorAt { + extrinsic_index: 0, + error: _ + }) ); } @@ -533,12 +529,12 @@ mod tests { assert_matches!( result.err(), - Some(crate::Error::Block( - crate::error::BlockError::ExtrinsicDecodeError { - extrinsic_index: 0, - error: ExtrinsicDecodeError::VersionNotSupported(3), - } - )) + Some(crate::error::ExtrinsicDecodeErrorAt { + extrinsic_index: 0, + error: ExtrinsicDecodeErrorAtReason::DecodeError( + ExtrinsicDecodeError::VersionNotSupported(3) + ), + }) ); } @@ -611,20 +607,10 @@ mod tests { assert_eq!(extrinsic.index(), 0); assert_eq!(extrinsic.pallet_index(), 0); - assert_eq!( - extrinsic - .pallet_name() - .expect("Valid metadata contains pallet name"), - "Test" - ); + assert_eq!(extrinsic.pallet_name(), "Test"); - assert_eq!(extrinsic.variant_index(), 2); - assert_eq!( - extrinsic - .variant_name() - .expect("Valid metadata contains variant name"), - "TestCall" - ); + assert_eq!(extrinsic.call_index(), 2); + assert_eq!(extrinsic.call_name(), "TestCall"); // Decode the extrinsic to the root enum. let decoded_extrinsic = extrinsic diff --git a/core/src/blocks/mod.rs b/core/src/blocks/mod.rs index 3114bf05735..7ac90ff114d 100644 --- a/core/src/blocks/mod.rs +++ b/core/src/blocks/mod.rs @@ -15,7 +15,7 @@ //! //! use subxt_macro::subxt; //! use subxt_core::blocks; -//! use subxt_core::metadata; +//! use subxt_core::Metadata; //! use subxt_core::config::PolkadotConfig; //! use alloc::vec; //! @@ -28,7 +28,7 @@ //! //! // Some metadata we'd like to use to help us decode extrinsics: //! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = metadata::decode_from(&metadata_bytes[..]).unwrap(); +//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); //! //! // Some extrinsics we'd like to decode: //! let ext_bytes = vec![ @@ -45,14 +45,14 @@ //! //! // We can iterate over them and decode various details out of them. //! for ext in exts.iter() { -//! println!("Pallet: {}", ext.pallet_name().unwrap()); -//! println!("Call: {}", ext.variant_name().unwrap()); +//! println!("Pallet: {}", ext.pallet_name()); +//! println!("Call: {}", ext.call_name()); //! } //! //! # let ext_details: Vec<_> = exts.iter() //! # .map(|ext| { -//! # let pallet = ext.pallet_name().unwrap().to_string(); -//! # let call = ext.variant_name().unwrap().to_string(); +//! # let pallet = ext.pallet_name().to_string(); +//! # let call = ext.call_name().to_string(); //! # (pallet, call) //! # }) //! # .collect(); @@ -70,14 +70,13 @@ mod static_extrinsic; use crate::Metadata; use crate::config::Config; -use crate::error::Error; +use crate::error::ExtrinsicDecodeErrorAt; +pub use crate::error::ExtrinsicError; use alloc::vec::Vec; - -pub use crate::error::BlockError; pub use extrinsic_transaction_extensions::{ ExtrinsicTransactionExtension, ExtrinsicTransactionExtensions, }; -pub use extrinsics::{ExtrinsicDetails, ExtrinsicMetadataDetails, Extrinsics, FoundExtrinsic}; +pub use extrinsics::{ExtrinsicDetails, Extrinsics, FoundExtrinsic}; pub use static_extrinsic::StaticExtrinsic; /// Instantiate a new [`Extrinsics`] object, given a vector containing each extrinsic hash (in the @@ -87,6 +86,6 @@ pub use static_extrinsic::StaticExtrinsic; pub fn decode_from( extrinsics: Vec>, metadata: Metadata, -) -> Result, Error> { +) -> Result, ExtrinsicDecodeErrorAt> { Extrinsics::decode_from(extrinsics, metadata) } diff --git a/core/src/client.rs b/core/src/client.rs index e7396c883a0..cfc8de4fa10 100644 --- a/core/src/client.rs +++ b/core/src/client.rs @@ -5,8 +5,8 @@ //! A couple of client types that we use elsewhere. use crate::{ + Metadata, config::{Config, HashFor}, - metadata::Metadata, }; use derive_where::derive_where; diff --git a/core/src/constants/address.rs b/core/src/constants/address.rs index 4dd68fdbf2e..42f82dd5041 100644 --- a/core/src/constants/address.rs +++ b/core/src/constants/address.rs @@ -4,17 +4,16 @@ //! Construct addresses to access constants with. -use crate::dynamic::DecodedValueThunk; -use crate::metadata::DecodeWithMetadata; use alloc::borrow::Cow; use alloc::string::String; use derive_where::derive_where; +use scale_decode::DecodeAsType; /// This represents a constant address. Anything implementing this trait /// can be used to fetch constants. pub trait Address { /// The target type of the value that lives at this address. - type Target: DecodeWithMetadata; + type Target: DecodeAsType; /// The name of the pallet that the constant lives under. fn pallet_name(&self) -> &str; @@ -30,22 +29,54 @@ pub trait Address { } } +// Any reference to an address is a valid address. +impl Address for &'_ A { + type Target = A::Target; + + fn pallet_name(&self) -> &str { + A::pallet_name(*self) + } + + fn constant_name(&self) -> &str { + A::constant_name(*self) + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + A::validation_hash(*self) + } +} + +// (str, str) and similar are valid addresses. +impl, B: AsRef> Address for (A, B) { + type Target = scale_value::Value; + + fn pallet_name(&self) -> &str { + self.0.as_ref() + } + + fn constant_name(&self) -> &str { + self.1.as_ref() + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + None + } +} + /// This represents the address of a constant. #[derive_where(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)] -pub struct DefaultAddress { +pub struct StaticAddress { pallet_name: Cow<'static, str>, constant_name: Cow<'static, str>, constant_hash: Option<[u8; 32]>, _marker: core::marker::PhantomData, } -/// The type of address used by our static codegen. -pub type StaticAddress = DefaultAddress; -/// The type of address typically used to return dynamic constant values. -pub type DynamicAddress = DefaultAddress; +/// A dynamic lookup address to access a constant. +pub type DynamicAddress = StaticAddress; -impl DefaultAddress { - /// Create a new [`DefaultAddress`] to use to look up a constant. +impl StaticAddress { + /// Create a new [`StaticAddress`] to use to look up a constant. pub fn new(pallet_name: impl Into, constant_name: impl Into) -> Self { Self { pallet_name: Cow::Owned(pallet_name.into()), @@ -55,7 +86,7 @@ impl DefaultAddress { } } - /// Create a new [`DefaultAddress`] that will be validated + /// Create a new [`StaticAddress`] that will be validated /// against node metadata using the hash given. #[doc(hidden)] pub fn new_static( @@ -82,7 +113,7 @@ impl DefaultAddress { } } -impl Address for DefaultAddress { +impl Address for StaticAddress { type Target = ReturnTy; fn pallet_name(&self) -> &str { @@ -99,6 +130,9 @@ impl Address for DefaultAddress { } /// Construct a new dynamic constant lookup. -pub fn dynamic(pallet_name: impl Into, constant_name: impl Into) -> DynamicAddress { +pub fn dynamic( + pallet_name: impl Into, + constant_name: impl Into, +) -> DynamicAddress { DynamicAddress::new(pallet_name, constant_name) } diff --git a/core/src/constants/mod.rs b/core/src/constants/mod.rs index 39e0eefebaf..19ee7b8f106 100644 --- a/core/src/constants/mod.rs +++ b/core/src/constants/mod.rs @@ -12,7 +12,7 @@ //! ```rust //! use subxt_macro::subxt; //! use subxt_core::constants; -//! use subxt_core::metadata; +//! use subxt_core::Metadata; //! //! // If we generate types without `subxt`, we need to point to `::subxt_core`: //! #[subxt( @@ -23,7 +23,7 @@ //! //! // Some metadata we'd like to access constants in: //! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = metadata::decode_from(&metadata_bytes[..]).unwrap(); +//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); //! //! // We can use a static address to obtain some constant: //! let address = polkadot::constants().balances().existential_deposit(); @@ -40,26 +40,32 @@ pub mod address; +use crate::Metadata; +use crate::error::ConstantError; use address::Address; use alloc::borrow::ToOwned; - -use crate::{Error, Metadata, error::MetadataError, metadata::DecodeWithMetadata}; +use alloc::string::ToString; +use alloc::vec::Vec; +use frame_decode::constants::ConstantTypeInfo; +use scale_decode::IntoVisitor; /// When the provided `address` is statically generated via the `#[subxt]` macro, this validates /// that the shape of the constant value is the same as the shape expected by the static address. /// /// When the provided `address` is dynamic (and thus does not come with any expectation of the /// shape of the constant value), this just returns `Ok(())` -pub fn validate(address: &Addr, metadata: &Metadata) -> Result<(), Error> { +pub fn validate(address: Addr, metadata: &Metadata) -> Result<(), ConstantError> { if let Some(actual_hash) = address.validation_hash() { let expected_hash = metadata - .pallet_by_name_err(address.pallet_name())? + .pallet_by_name(address.pallet_name()) + .ok_or_else(|| ConstantError::PalletNameNotFound(address.pallet_name().to_string()))? .constant_hash(address.constant_name()) - .ok_or_else(|| { - MetadataError::ConstantNameNotFound(address.constant_name().to_owned()) + .ok_or_else(|| ConstantError::ConstantNameNotFound { + pallet_name: address.pallet_name().to_string(), + constant_name: address.constant_name().to_owned(), })?; if actual_hash != expected_hash { - return Err(MetadataError::IncompatibleCodegen.into()); + return Err(ConstantError::IncompatibleCodegen); } } Ok(()) @@ -67,19 +73,37 @@ pub fn validate(address: &Addr, metadata: &Metadata) -> Result<() /// Fetch a constant out of the metadata given a constant address. If the `address` has been /// statically generated, this will validate that the constant shape is as expected, too. -pub fn get(address: &Addr, metadata: &Metadata) -> Result { +pub fn get( + address: Addr, + metadata: &Metadata, +) -> Result { // 1. Validate constant shape if hash given: - validate(address, metadata)?; + validate(&address, metadata)?; // 2. Attempt to decode the constant into the type given: - let constant = metadata - .pallet_by_name_err(address.pallet_name())? - .constant_by_name(address.constant_name()) - .ok_or_else(|| MetadataError::ConstantNameNotFound(address.constant_name().to_owned()))?; - let value = ::decode_with_metadata( - &mut constant.value(), - constant.ty(), + let constant = frame_decode::constants::decode_constant( + address.pallet_name(), + address.constant_name(), metadata, - )?; - Ok(value) + metadata.types(), + Addr::Target::into_visitor(), + ) + .map_err(ConstantError::CouldNotDecodeConstant)?; + + Ok(constant) +} + +/// Access the bytes of a constant by the address it is registered under. +pub fn get_bytes( + address: Addr, + metadata: &Metadata, +) -> Result, ConstantError> { + // 1. Validate custom value shape if hash given: + validate(&address, metadata)?; + + // 2. Return the underlying bytes: + let constant = metadata + .constant_info(address.pallet_name(), address.constant_name()) + .map_err(|e| ConstantError::ConstantInfoError(e.into_owned()))?; + Ok(constant.bytes.to_vec()) } diff --git a/core/src/custom_values/address.rs b/core/src/custom_values/address.rs index 6bbacaed68e..1046b5dc49d 100644 --- a/core/src/custom_values/address.rs +++ b/core/src/custom_values/address.rs @@ -4,22 +4,23 @@ //! Construct addresses to access custom values with. -use crate::dynamic::DecodedValueThunk; -use crate::metadata::DecodeWithMetadata; +use alloc::borrow::Cow; +use alloc::string::String; use derive_where::derive_where; +use scale_decode::DecodeAsType; /// Use this with [`Address::IsDecodable`]. -pub use crate::utils::Yes; +pub use crate::utils::{Maybe, No, NoMaybe}; /// This represents the address of a custom value in the metadata. /// Anything that implements it can be used to fetch custom values from the metadata. /// The trait is implemented by [`str`] for dynamic lookup and [`StaticAddress`] for static queries. pub trait Address { /// The type of the custom value. - type Target: DecodeWithMetadata; + type Target: DecodeAsType; /// Should be set to `Yes` for Dynamic values and static values that have a valid type. - /// Should be `()` for custom values, that have an invalid type id. - type IsDecodable; + /// Should be `No` for custom values, that have an invalid type id. + type IsDecodable: NoMaybe; /// the name (key) by which the custom value can be accessed in the metadata. fn name(&self) -> &str; @@ -30,9 +31,24 @@ pub trait Address { } } +// Any reference to an address is a valid address +impl Address for &'_ A { + type Target = A::Target; + type IsDecodable = A::IsDecodable; + + fn name(&self) -> &str { + A::name(*self) + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + A::validation_hash(*self) + } +} + +// Support plain strings for looking up custom values. impl Address for str { - type Target = DecodedValueThunk; - type IsDecodable = Yes; + type Target = scale_value::Value; + type IsDecodable = Maybe; fn name(&self) -> &str { self @@ -42,19 +58,31 @@ impl Address for str { /// A static address to a custom value. #[derive_where(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)] pub struct StaticAddress { - name: &'static str, + name: Cow<'static, str>, hash: Option<[u8; 32]>, - phantom: core::marker::PhantomData<(ReturnTy, IsDecodable)>, + marker: core::marker::PhantomData<(ReturnTy, IsDecodable)>, } +/// A dynamic address to a custom value. +pub type DynamicAddress = StaticAddress; + impl StaticAddress { #[doc(hidden)] /// Creates a new StaticAddress. - pub fn new_static(name: &'static str, hash: [u8; 32]) -> StaticAddress { - StaticAddress:: { - name, + pub fn new_static(name: &'static str, hash: [u8; 32]) -> Self { + Self { + name: Cow::Borrowed(name), hash: Some(hash), - phantom: core::marker::PhantomData, + marker: core::marker::PhantomData, + } + } + + /// Create a new [`StaticAddress`] + pub fn new(name: impl Into) -> Self { + Self { + name: name.into().into(), + hash: None, + marker: core::marker::PhantomData, } } @@ -63,20 +91,27 @@ impl StaticAddress { Self { name: self.name, hash: None, - phantom: self.phantom, + marker: self.marker, } } } -impl Address for StaticAddress { - type Target = R; - type IsDecodable = Y; +impl Address for StaticAddress { + type Target = Target; + type IsDecodable = IsDecodable; fn name(&self) -> &str { - self.name + &self.name } fn validation_hash(&self) -> Option<[u8; 32]> { self.hash } } + +/// Construct a new dynamic custom value lookup. +pub fn dynamic( + custom_value_name: impl Into, +) -> DynamicAddress { + DynamicAddress::new(custom_value_name) +} diff --git a/core/src/custom_values/mod.rs b/core/src/custom_values/mod.rs index eae390a8564..5130ae64fa8 100644 --- a/core/src/custom_values/mod.rs +++ b/core/src/custom_values/mod.rs @@ -12,7 +12,7 @@ //! ```rust //! use subxt_macro::subxt; //! use subxt_core::custom_values; -//! use subxt_core::metadata; +//! use subxt_core::Metadata; //! //! // If we generate types without `subxt`, we need to point to `::subxt_core`: //! #[subxt( @@ -23,7 +23,7 @@ //! //! // Some metadata we'd like to access custom values in: //! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = metadata::decode_from(&metadata_bytes[..]).unwrap(); +//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); //! //! // At the moment, we don't expect to see any custom values in the metadata //! // for Polkadot, so this will return an error: @@ -32,61 +32,64 @@ pub mod address; -use crate::utils::Yes; -use crate::{Error, Metadata, error::MetadataError, metadata::DecodeWithMetadata}; +use crate::utils::Maybe; +use crate::{Metadata, error::CustomValueError}; use address::Address; use alloc::vec::Vec; +use frame_decode::custom_values::CustomValueTypeInfo; +use scale_decode::IntoVisitor; /// Run the validation logic against some custom value address you'd like to access. Returns `Ok(())` /// if the address is valid (or if it's not possible to check since the address has no validation hash). /// Returns an error if the address was not valid (wrong name, type or raw bytes) -pub fn validate(address: &Addr, metadata: &Metadata) -> Result<(), Error> { +pub fn validate(address: Addr, metadata: &Metadata) -> Result<(), CustomValueError> { if let Some(actual_hash) = address.validation_hash() { let custom = metadata.custom(); let custom_value = custom .get(address.name()) - .ok_or_else(|| MetadataError::CustomValueNameNotFound(address.name().into()))?; + .ok_or_else(|| CustomValueError::NotFound(address.name().into()))?; let expected_hash = custom_value.hash(); if actual_hash != expected_hash { - return Err(MetadataError::IncompatibleCodegen.into()); + return Err(CustomValueError::IncompatibleCodegen); } } - if metadata.custom().get(address.name()).is_none() { - return Err(MetadataError::IncompatibleCodegen.into()); - } Ok(()) } /// Access a custom value by the address it is registered under. This can be just a [str] to get back a dynamic value, /// or a static address from the generated static interface to get a value of a static type returned. -pub fn get + ?Sized>( - address: &Addr, +pub fn get>( + address: Addr, metadata: &Metadata, -) -> Result { +) -> Result { // 1. Validate custom value shape if hash given: - validate(address, metadata)?; + validate(&address, metadata)?; // 2. Attempt to decode custom value: - let custom_value = metadata.custom_value_by_name_err(address.name())?; - let value = ::decode_with_metadata( - &mut custom_value.bytes(), - custom_value.type_id(), + let value = frame_decode::custom_values::decode_custom_value( + address.name(), metadata, - )?; + metadata.types(), + Addr::Target::into_visitor(), + ) + .map_err(CustomValueError::CouldNotDecodeCustomValue)?; + Ok(value) } /// Access the bytes of a custom value by the address it is registered under. -pub fn get_bytes( - address: &Addr, +pub fn get_bytes( + address: Addr, metadata: &Metadata, -) -> Result, Error> { +) -> Result, CustomValueError> { // 1. Validate custom value shape if hash given: - validate(address, metadata)?; + validate(&address, metadata)?; // 2. Return the underlying bytes: - let custom_value = metadata.custom_value_by_name_err(address.name())?; - Ok(custom_value.bytes().to_vec()) + let custom_value = metadata + .custom_value_info(address.name()) + .map_err(|e| CustomValueError::NotFound(e.not_found))?; + Ok(custom_value.bytes.to_vec()) } #[cfg(test)] @@ -154,7 +157,7 @@ mod tests { }; let metadata: subxt_metadata::Metadata = frame_metadata.try_into().unwrap(); - Metadata::from(metadata) + metadata } #[test] @@ -162,8 +165,9 @@ mod tests { let metadata = mock_metadata(); assert!(custom_values::get("Invalid Address", &metadata).is_err()); - let person_decoded_value_thunk = custom_values::get("Mr. Robot", &metadata).unwrap(); - let person: Person = person_decoded_value_thunk.as_type().unwrap(); + + let person_addr = custom_values::address::dynamic::("Mr. Robot"); + let person = custom_values::get(&person_addr, &metadata).unwrap(); assert_eq!( person, Person { diff --git a/core/src/dynamic.rs b/core/src/dynamic.rs index 8f02b2d04c2..27819620f49 100644 --- a/core/src/dynamic.rs +++ b/core/src/dynamic.rs @@ -5,17 +5,8 @@ //! This module provides the entry points to create dynamic //! transactions, storage and constant lookups. -use crate::metadata::{DecodeWithMetadata, Metadata}; -use alloc::vec::Vec; -use scale_decode::DecodeAsType; pub use scale_value::{At, Value}; -/// A [`scale_value::Value`] type endowed with contextual information -/// regarding what type was used to decode each part of it. This implements -/// [`crate::metadata::DecodeWithMetadata`], and is used as a return type -/// for dynamic requests. -pub type DecodedValue = scale_value::Value; - // Submit dynamic transactions. pub use crate::tx::payload::dynamic as tx; @@ -31,56 +22,5 @@ pub use crate::runtime_api::payload::dynamic as runtime_api_call; // Execute View Function API function call dynamically. pub use crate::view_functions::payload::dynamic as view_function_call; -/// This is the result of making a dynamic request to a node. From this, -/// we can return the raw SCALE bytes that we were handed back, or we can -/// complete the decoding of the bytes into a [`DecodedValue`] type. -pub struct DecodedValueThunk { - type_id: u32, - metadata: Metadata, - scale_bytes: Vec, -} - -impl DecodeWithMetadata for DecodedValueThunk { - fn decode_with_metadata( - bytes: &mut &[u8], - type_id: u32, - metadata: &Metadata, - ) -> Result { - let mut v = Vec::with_capacity(bytes.len()); - v.extend_from_slice(bytes); - *bytes = &[]; - Ok(DecodedValueThunk { - type_id, - metadata: metadata.clone(), - scale_bytes: v, - }) - } -} - -impl DecodedValueThunk { - /// Return the SCALE encoded bytes handed back from the node. - pub fn into_encoded(self) -> Vec { - self.scale_bytes - } - /// Return the SCALE encoded bytes handed back from the node without taking ownership of them. - pub fn encoded(&self) -> &[u8] { - &self.scale_bytes - } - /// Decode the SCALE encoded storage entry into a dynamic [`DecodedValue`] type. - pub fn to_value(&self) -> Result { - let val = scale_value::scale::decode_as_type( - &mut &*self.scale_bytes, - self.type_id, - self.metadata.types(), - )?; - Ok(val) - } - /// decode the `DecodedValueThunk` into a concrete type. - pub fn as_type(&self) -> Result { - T::decode_as_type( - &mut &self.scale_bytes[..], - self.type_id, - self.metadata.types(), - ) - } -} +/// Obtain a custom value from the metadata. +pub use crate::custom_values::address::dynamic as custom_value; diff --git a/core/src/error.rs b/core/src/error.rs index 9517b30856a..a5b259f176d 100644 --- a/core/src/error.rs +++ b/core/src/error.rs @@ -6,196 +6,290 @@ use alloc::boxed::Box; use alloc::string::String; -use subxt_metadata::StorageHasher; +use alloc::vec::Vec; use thiserror::Error as DeriveError; /// The error emitted when something goes wrong. #[derive(Debug, DeriveError)] +#[allow(missing_docs)] pub enum Error { - /// Codec error. - #[error("Codec error: {0}")] - Codec(codec::Error), - /// Metadata error. #[error(transparent)] - Metadata(#[from] MetadataError), - /// Storage address error. + StorageError(#[from] StorageError), #[error(transparent)] - StorageAddress(#[from] StorageAddressError), - /// Error decoding to a [`crate::dynamic::Value`]. - #[error("Error decoding into dynamic value: {0}")] - Decode(#[from] scale_decode::Error), - /// Error encoding from a [`crate::dynamic::Value`]. - #[error("Error encoding from dynamic value: {0}")] - Encode(#[from] scale_encode::Error), - /// Error constructing an extrinsic. - #[error("Error constructing transaction: {0}")] Extrinsic(#[from] ExtrinsicError), - /// Block body error. - #[error("Error working with block_body: {0}")] - Block(#[from] BlockError), + #[error(transparent)] + Constant(#[from] ConstantError), + #[error(transparent)] + CustomValue(#[from] CustomValueError), + #[error(transparent)] + RuntimeApi(#[from] RuntimeApiError), + #[error(transparent)] + ViewFunction(#[from] ViewFunctionError), + #[error(transparent)] + Events(#[from] EventsError), } -impl From for Error { - fn from(err: scale_decode::visitor::DecodeError) -> Error { - Error::Decode(err.into()) - } +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum EventsError { + #[error("Can't decode event: can't decode phase: {0}")] + CannotDecodePhase(codec::Error), + #[error("Can't decode event: can't decode pallet index: {0}")] + CannotDecodePalletIndex(codec::Error), + #[error("Can't decode event: can't decode variant index: {0}")] + CannotDecodeVariantIndex(codec::Error), + #[error("Can't decode event: can't find pallet with index {0}")] + CannotFindPalletWithIndex(u8), + #[error( + "Can't decode event: can't find variant with index {variant_index} in pallet {pallet_name}" + )] + CannotFindVariantWithIndex { + pallet_name: String, + variant_index: u8, + }, + #[error("Can't decode field {field_name:?} in event {pallet_name}.{event_name}: {reason}")] + CannotDecodeFieldInEvent { + pallet_name: String, + event_name: String, + field_name: String, + reason: scale_decode::visitor::DecodeError, + }, + #[error("Can't decode event topics: {0}")] + CannotDecodeEventTopics(codec::Error), + #[error("Can't decode the fields of event {pallet_name}.{event_name}: {reason}")] + CannotDecodeEventFields { + pallet_name: String, + event_name: String, + reason: scale_decode::Error, + }, + #[error("Can't decode event {pallet_name}.{event_name} to Event enum: {reason}")] + CannotDecodeEventEnum { + pallet_name: String, + event_name: String, + reason: scale_decode::Error, + }, } -// TODO: when `codec::Error` implements `core::Error` -// remove this impl and replace it by thiserror #[from] -impl From for Error { - fn from(err: codec::Error) -> Error { - Error::Codec(err) - } +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum ViewFunctionError { + #[error("The static View Function address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Can't find View Function: pallet {0} not found")] + PalletNotFound(String), + #[error("Can't find View Function {function_name} in pallet {pallet_name}")] + ViewFunctionNotFound { + pallet_name: String, + function_name: String, + }, + #[error("Failed to encode View Function inputs: {0}")] + CouldNotEncodeInputs(frame_decode::view_functions::ViewFunctionInputsEncodeError), + #[error("Failed to decode View Function: {0}")] + CouldNotDecodeResponse(frame_decode::view_functions::ViewFunctionDecodeError), } -/// Block error #[derive(Debug, DeriveError)] -pub enum BlockError { - /// Leftover bytes found after decoding the extrinsic. - #[error( - "After decoding the extrinsic at index {extrinsic_index}, {num_leftover_bytes} bytes were left, suggesting that decoding may have failed" - )] - LeftoverBytes { - /// Index of the extrinsic that failed to decode. - extrinsic_index: usize, - /// Number of bytes leftover after decoding the extrinsic. - num_leftover_bytes: usize, - }, - /// Something went wrong decoding the extrinsic. - #[error("Failed to decode extrinsic at index {extrinsic_index}: {error}")] - ExtrinsicDecodeError { - /// Index of the extrinsic that failed to decode. - extrinsic_index: usize, - /// The decode error. - error: ExtrinsicDecodeError, +#[non_exhaustive] +#[allow(missing_docs)] +pub enum RuntimeApiError { + #[error("The static Runtime API address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Runtime API trait not found: {0}")] + TraitNotFound(String), + #[error("Runtime API method {method_name} not found in trait {trait_name}")] + MethodNotFound { + trait_name: String, + method_name: String, }, + #[error("Failed to encode Runtime API inputs: {0}")] + CouldNotEncodeInputs(frame_decode::runtime_apis::RuntimeApiInputsEncodeError), + #[error("Failed to decode Runtime API: {0}")] + CouldNotDecodeResponse(frame_decode::runtime_apis::RuntimeApiDecodeError), } -/// An alias for [`frame_decode::extrinsics::ExtrinsicDecodeError`]. -/// -pub type ExtrinsicDecodeError = frame_decode::extrinsics::ExtrinsicDecodeError; +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum CustomValueError { + #[error("The static custom value address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("The custom value '{0}' was not found")] + NotFound(String), + #[error("Failed to decode custom value: {0}")] + CouldNotDecodeCustomValue(frame_decode::custom_values::CustomValueDecodeError), +} -/// Something went wrong trying to access details in the metadata. -#[derive(Clone, Debug, PartialEq, DeriveError)] +/// Something went wrong working with a constant. +#[derive(Debug, DeriveError)] #[non_exhaustive] -pub enum MetadataError { - /// The DispatchError type isn't available in the metadata - #[error("The DispatchError type isn't available")] - DispatchErrorNotFound, - /// Type not found in metadata. - #[error("Type with ID {0} not found")] - TypeNotFound(u32), - /// Pallet not found (index). - #[error("Pallet with index {0} not found")] - PalletIndexNotFound(u8), - /// Pallet not found (name). - #[error("Pallet with name {0} not found")] - PalletNameNotFound(String), - /// Variant not found. - #[error("Variant with index {0} not found")] - VariantIndexNotFound(u8), - /// Constant not found. - #[error("Constant with name {0} not found")] - ConstantNameNotFound(String), - /// Call not found. - #[error("Call with name {0} not found")] - CallNameNotFound(String), - /// Runtime trait not found. - #[error("Runtime trait with name {0} not found")] - RuntimeTraitNotFound(String), - /// Runtime method not found. - #[error("Runtime method with name {0} not found")] - RuntimeMethodNotFound(String), - /// View Function not found. - #[error("View Function with query ID {} not found", hex::encode(.0))] - ViewFunctionNotFound([u8; 32]), - /// Call type not found in metadata. - #[error("Call type not found in pallet with index {0}")] - CallTypeNotFoundInPallet(u8), - /// Event type not found in metadata. - #[error("Event type not found in pallet with index {0}")] - EventTypeNotFoundInPallet(u8), - /// Storage details not found in metadata. - #[error("Storage details not found in pallet with name {0}")] - StorageNotFoundInPallet(String), - /// Storage entry not found. - #[error("Storage entry {0} not found")] - StorageEntryNotFound(String), - /// The generated interface used is not compatible with the node. - #[error("The generated code is not compatible with the node")] +#[allow(missing_docs)] +pub enum ConstantError { + #[error("The static constant address used is not compatible with the live chain")] IncompatibleCodegen, - /// Custom value not found. - #[error("Custom value with name {0} not found")] - CustomValueNameNotFound(String), + #[error("Can't find constant: pallet with name {0} not found")] + PalletNameNotFound(String), + #[error( + "Constant '{constant_name}' not found in pallet {pallet_name} in the live chain metadata" + )] + ConstantNameNotFound { + pallet_name: String, + constant_name: String, + }, + #[error("Failed to decode constant: {0}")] + CouldNotDecodeConstant(frame_decode::constants::ConstantDecodeError), + #[error("Cannot obtain constant information from metadata: {0}")] + ConstantInfoError(frame_decode::constants::ConstantInfoError<'static>), } /// Something went wrong trying to encode or decode a storage address. -#[derive(Clone, Debug, DeriveError)] +#[derive(Debug, DeriveError)] #[non_exhaustive] -pub enum StorageAddressError { - /// Storage lookup does not have the expected number of keys. - #[error("Storage lookup requires {expected} keys but more keys have been provided.")] - TooManyKeys { - /// The number of keys provided in the storage address. - expected: usize, - }, - /// This storage entry in the metadata does not have the correct number of hashers to fields. - #[error("Storage entry in metadata does not have the correct number of hashers to fields")] - WrongNumberOfHashers { - /// The number of hashers in the metadata for this storage entry. - hashers: usize, - /// The number of fields in the metadata for this storage entry. - fields: usize, - }, - /// We weren't given enough bytes to decode the storage address/key. - #[error("Not enough remaining bytes to decode the storage address/key")] - NotEnoughBytes, - /// We have leftover bytes after decoding the storage address. - #[error("We have leftover bytes after decoding the storage address")] - TooManyBytes, - /// The bytes of a storage address are not the expected address for decoding the storage keys of the address. +#[allow(missing_docs)] +pub enum StorageError { + #[error("The static storage address used is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Can't find storage value: pallet with name {0} not found")] + PalletNameNotFound(String), + #[error( + "Storage entry '{entry_name}' not found in pallet {pallet_name} in the live chain metadata" + )] + StorageEntryNotFound { + pallet_name: String, + entry_name: String, + }, + #[error("Cannot obtain storage information from metadata: {0}")] + StorageInfoError(frame_decode::storage::StorageInfoError<'static>), + #[error("Cannot encode storage key: {0}")] + StorageKeyEncodeError(frame_decode::storage::StorageKeyEncodeError), + #[error("Cannot create a key to iterate over a plain entry")] + CannotIterPlainEntry { + pallet_name: String, + entry_name: String, + }, #[error( - "Storage address bytes are not the expected format. Addresses need to be at least 16 bytes (pallet ++ entry) and follow a structure given by the hashers defined in the metadata" + "Wrong number of key parts provided to iterate a storage address. We expected at most {max_expected} key parts but got {got} key parts" )] - UnexpectedAddressBytes, - /// An invalid hasher was used to reconstruct a value from a chunk of bytes that is part of a storage address. Hashers where the hash does not contain the original value are invalid for this purpose. + WrongNumberOfKeyPartsProvidedForIterating { max_expected: usize, got: usize }, + #[error( + "Wrong number of key parts provided to fetch a storage address. We expected {expected} key parts but got {got} key parts" + )] + WrongNumberOfKeyPartsProvidedForFetching { expected: usize, got: usize }, +} + +#[derive(Debug, DeriveError)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum StorageKeyError { + #[error("Can't decode the storage key: {error}")] + StorageKeyDecodeError { + bytes: Vec, + error: frame_decode::storage::StorageKeyDecodeError, + }, + #[error("Can't decode the values from the storage key: {0}")] + CannotDecodeValuesInKey(frame_decode::storage::StorageKeyValueDecodeError), #[error( - "An invalid hasher was used to reconstruct a value with type ID {ty_id} from a hash formed by a {hasher:?} hasher. This is only possible for concat-style hashers or the identity hasher" + "Cannot decode storage key: there were leftover bytes, indicating that the decoding failed" )] - HasherCannotReconstructKey { - /// Type id of the key's type. - ty_id: u32, - /// The invalid hasher that caused this error. - hasher: StorageHasher, + LeftoverBytes { bytes: Vec }, + #[error("Can't decode a single value from the storage key part at index {index}: {error}")] + CannotDecodeValueInKey { + index: usize, + error: scale_decode::Error, }, } -/// An error that can be encountered when constructing a transaction. #[derive(Debug, DeriveError)] #[non_exhaustive] +#[allow(missing_docs)] +pub enum StorageValueError { + #[error("Cannot decode storage value: {0}")] + CannotDecode(frame_decode::storage::StorageValueDecodeError), + #[error( + "Cannot decode storage value: there were leftover bytes, indicating that the decoding failed" + )] + LeftoverBytes { bytes: Vec }, +} + +/// An error that can be encountered when constructing a transaction. +#[derive(Debug, DeriveError)] +#[allow(missing_docs)] pub enum ExtrinsicError { - /// Transaction version not supported by Subxt. + #[error("The extrinsic payload is not compatible with the live chain")] + IncompatibleCodegen, + #[error("Can't find extrinsic: pallet with name {0} not found")] + PalletNameNotFound(String), + #[error("Can't find extrinsic: call name {call_name} doesn't exist in pallet {pallet_name}")] + CallNameNotFound { + pallet_name: String, + call_name: String, + }, + #[error("Can't encode the extrinsic call data: {0}")] + CannotEncodeCallData(scale_encode::Error), #[error("Subxt does not support the extrinsic versions expected by the chain")] UnsupportedVersion, - /// Issue encoding transaction extensions. #[error("Cannot construct the required transaction extensions: {0}")] Params(#[from] ExtrinsicParamsError), + #[error("Cannot decode transaction extension '{name}': {error}")] + CouldNotDecodeTransactionExtension { + /// The extension name. + name: String, + /// The decode error. + error: scale_decode::Error, + }, + #[error( + "After decoding the extrinsic at index {extrinsic_index}, {num_leftover_bytes} bytes were left, suggesting that decoding may have failed" + )] + LeftoverBytes { + /// Index of the extrinsic that failed to decode. + extrinsic_index: usize, + /// Number of bytes leftover after decoding the extrinsic. + num_leftover_bytes: usize, + }, + #[error("{0}")] + ExtrinsicDecodeErrorAt(#[from] ExtrinsicDecodeErrorAt), + #[error("Failed to decode the fields of an extrinsic at index {extrinsic_index}: {error}")] + CannotDecodeFields { + /// Index of the extrinsic whose fields we could not decode + extrinsic_index: usize, + /// The decode error. + error: scale_decode::Error, + }, + #[error("Failed to decode the extrinsic at index {extrinsic_index} to a root enum: {error}")] + CannotDecodeIntoRootExtrinsic { + /// Index of the extrinsic that we failed to decode + extrinsic_index: usize, + /// The decode error. + error: scale_decode::Error, + }, } -impl From for Error { - fn from(value: ExtrinsicParamsError) -> Self { - Error::Extrinsic(value.into()) - } +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +#[error("Cannot decode extrinsic at index {extrinsic_index}: {error}")] +pub struct ExtrinsicDecodeErrorAt { + pub extrinsic_index: usize, + pub error: ExtrinsicDecodeErrorAtReason, +} + +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum ExtrinsicDecodeErrorAtReason { + #[error("{0}")] + DecodeError(frame_decode::extrinsics::ExtrinsicDecodeError), + #[error("Leftover bytes")] + LeftoverBytes(Vec), } /// An error that can be emitted when trying to construct an instance of [`crate::config::ExtrinsicParams`], /// encode data from the instance, or match on signed extensions. #[derive(Debug, DeriveError)] #[non_exhaustive] +#[allow(missing_docs)] pub enum ExtrinsicParamsError { - /// Cannot find a type id in the metadata. The context provides some additional - /// information about the source of the error (eg the signed extension name). #[error("Cannot find type id '{type_id} in the metadata (context: {context})")] MissingTypeId { /// Type ID. @@ -203,10 +297,8 @@ pub enum ExtrinsicParamsError { /// Some arbitrary context to help narrow the source of the error. context: &'static str, }, - /// A signed extension in use on some chain was not provided. #[error("The chain expects a signed extension with the name {0}, but we did not provide one")] UnknownTransactionExtension(String), - /// Some custom error. #[error("Error constructing extrinsic parameters: {0}")] Custom(Box), } diff --git a/core/src/events.rs b/core/src/events.rs index 192a7ebca5a..9d38517910a 100644 --- a/core/src/events.rs +++ b/core/src/events.rs @@ -10,7 +10,8 @@ //! use subxt_macro::subxt; //! use subxt_core::config::PolkadotConfig; //! use subxt_core::events; -//! use subxt_core::metadata; +//! use subxt_core::Metadata; +//! use subxt_core::dynamic::Value; //! //! // If we generate types without `subxt`, we need to point to `::subxt_core`: //! #[subxt( @@ -21,7 +22,7 @@ //! //! // Some metadata we'll use to work with storage entries: //! let metadata_bytes = include_bytes!("../../artifacts/polkadot_metadata_full.scale"); -//! let metadata = metadata::decode_from(&metadata_bytes[..]).unwrap(); +//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); //! //! // Some bytes representing events (located in System.Events storage): //! let event_bytes = hex::decode("1c00000000000000a2e9b53d5517020000000100000000000310c96d901d0102000000020000000408d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dbeea5a030000000000000000000000000000020000000402d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48102700000000000000000000000000000000020000000407be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25fbeea5a030000000000000000000000000000020000002100d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dbeea5a03000000000000000000000000000000000000000000000000000000000000020000000000426df03e00000000").unwrap(); @@ -34,10 +35,11 @@ //! let ev = ev.unwrap(); //! println!("Index: {}", ev.index()); //! println!("Name: {}.{}", ev.pallet_name(), ev.variant_name()); -//! println!("Fields: {:?}", ev.field_values().unwrap()); +//! println!("Fields: {:?}", ev.decode_as_fields::().unwrap()); //! } //! ``` +use alloc::string::ToString; use alloc::sync::Arc; use alloc::vec::Vec; use codec::{Compact, Decode, Encode}; @@ -46,9 +48,9 @@ use scale_decode::{DecodeAsFields, DecodeAsType}; use subxt_metadata::PalletMetadata; use crate::{ - Error, Metadata, + Metadata, config::{Config, HashFor}, - error::MetadataError, + error::EventsError, }; /// Create a new [`Events`] instance from the given bytes. @@ -148,7 +150,7 @@ impl Events { // use of it with our `FilterEvents` stuff. pub fn iter( &self, - ) -> impl Iterator, Error>> + Send + Sync + 'static { + ) -> impl Iterator, EventsError>> + Send + Sync + 'static { // The event bytes ignoring the compact encoded length on the front: let event_bytes = self.event_bytes.clone(); let metadata = self.metadata.clone(); @@ -184,25 +186,25 @@ impl Events { /// Iterate through the events using metadata to dynamically decode and skip /// them, and return only those which should decode to the provided `Ev` type. /// If an error occurs, all subsequent iterations return `None`. - pub fn find(&self) -> impl Iterator> { + pub fn find(&self) -> impl Iterator> { self.iter() .filter_map(|ev| ev.and_then(|ev| ev.as_event::()).transpose()) } /// Iterate through the events using metadata to dynamically decode and skip /// them, and return the first event found which decodes to the provided `Ev` type. - pub fn find_first(&self) -> Result, Error> { + pub fn find_first(&self) -> Result, EventsError> { self.find::().next().transpose() } /// Iterate through the events using metadata to dynamically decode and skip /// them, and return the last event found which decodes to the provided `Ev` type. - pub fn find_last(&self) -> Result, Error> { + pub fn find_last(&self) -> Result, EventsError> { self.find::().last().transpose() } /// Find an event that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { + pub fn has(&self) -> Result { Ok(self.find::().next().transpose()?.is_some()) } } @@ -246,23 +248,29 @@ impl EventDetails { all_bytes: Arc<[u8]>, start_idx: usize, index: u32, - ) -> Result, Error> { + ) -> Result, EventsError> { let input = &mut &all_bytes[start_idx..]; - let phase = Phase::decode(input)?; + let phase = Phase::decode(input).map_err(EventsError::CannotDecodePhase)?; let event_start_idx = all_bytes.len() - input.len(); - let pallet_index = u8::decode(input)?; - let variant_index = u8::decode(input)?; + let pallet_index = u8::decode(input).map_err(EventsError::CannotDecodePalletIndex)?; + let variant_index = u8::decode(input).map_err(EventsError::CannotDecodeVariantIndex)?; let event_fields_start_idx = all_bytes.len() - input.len(); // Get metadata for the event: - let event_pallet = metadata.pallet_by_index_err(pallet_index)?; + let event_pallet = metadata + .pallet_by_event_index(pallet_index) + .ok_or_else(|| EventsError::CannotFindPalletWithIndex(pallet_index))?; let event_variant = event_pallet .event_variant_by_index(variant_index) - .ok_or(MetadataError::VariantIndexNotFound(variant_index))?; + .ok_or_else(|| EventsError::CannotFindVariantWithIndex { + pallet_name: event_pallet.name().to_string(), + variant_index, + })?; + tracing::debug!( "Decoding Event '{}::{}'", event_pallet.name(), @@ -278,14 +286,23 @@ impl EventDetails { metadata.types(), scale_decode::visitor::IgnoreVisitor::new(), ) - .map_err(scale_decode::Error::from)?; + .map_err(|e| EventsError::CannotDecodeFieldInEvent { + pallet_name: event_pallet.name().to_string(), + event_name: event_variant.name.clone(), + field_name: field_metadata + .name + .clone() + .unwrap_or("".to_string()), + reason: e, + })?; } // the end of the field bytes. let event_fields_end_idx = all_bytes.len() - input.len(); // topics come after the event data in EventRecord. - let topics = Vec::>::decode(input)?; + let topics = + Vec::>::decode(input).map_err(EventsError::CannotDecodeEventTopics)?; // what bytes did we skip over in total, including topics. let end_idx = all_bytes.len() - input.len(); @@ -342,7 +359,7 @@ impl EventDetails { pub fn event_metadata(&self) -> EventMetadataDetails<'_> { let pallet = self .metadata - .pallet_by_index(self.pallet_index()) + .pallet_by_event_index(self.pallet_index()) .expect("event pallet to be found; we did this already during decoding"); let variant = pallet .event_variant_by_index(self.variant_index()) @@ -367,7 +384,7 @@ impl EventDetails { /// Decode and provide the event fields back in the form of a [`scale_value::Composite`] /// type which represents the named or unnamed fields that were present in the event. - pub fn field_values(&self) -> Result, Error> { + pub fn decode_as_fields(&self) -> Result { let bytes = &mut self.field_bytes(); let event_metadata = self.event_metadata(); @@ -378,14 +395,20 @@ impl EventDetails { .map(|f| scale_decode::Field::new(f.ty.id, f.name.as_deref())); let decoded = - scale_value::scale::decode_as_fields(bytes, &mut fields, self.metadata.types())?; + E::decode_as_fields(bytes, &mut fields, self.metadata.types()).map_err(|e| { + EventsError::CannotDecodeEventFields { + pallet_name: event_metadata.pallet.name().to_string(), + event_name: event_metadata.variant.name.clone(), + reason: e, + } + })?; Ok(decoded) } /// Attempt to decode these [`EventDetails`] into a type representing the event fields. /// Such types are exposed in the codegen as `pallet_name::events::EventName` types. - pub fn as_event(&self) -> Result, Error> { + pub fn as_event(&self) -> Result, EventsError> { let ev_metadata = self.event_metadata(); if ev_metadata.pallet.name() == E::PALLET && ev_metadata.variant.name == E::EVENT { let mut fields = ev_metadata @@ -394,7 +417,12 @@ impl EventDetails { .iter() .map(|f| scale_decode::Field::new(f.ty.id, f.name.as_deref())); let decoded = - E::decode_as_fields(&mut self.field_bytes(), &mut fields, self.metadata.types())?; + E::decode_as_fields(&mut self.field_bytes(), &mut fields, self.metadata.types()) + .map_err(|e| EventsError::CannotDecodeEventFields { + pallet_name: E::PALLET.to_string(), + event_name: E::EVENT.to_string(), + reason: e, + })?; Ok(Some(decoded)) } else { Ok(None) @@ -404,14 +432,22 @@ impl EventDetails { /// Attempt to decode these [`EventDetails`] into a root event type (which includes /// the pallet and event enum variants as well as the event fields). A compatible /// type for this is exposed via static codegen as a root level `Event` type. - pub fn as_root_event(&self) -> Result { + pub fn as_root_event(&self) -> Result { let bytes = &self.all_bytes[self.event_start_idx..self.event_fields_end_idx]; let decoded = E::decode_as_type( &mut &bytes[..], self.metadata.outer_enums().event_enum_ty(), self.metadata.types(), - )?; + ) + .map_err(|e| { + let md = self.event_metadata(); + EventsError::CannotDecodeEventEnum { + pallet_name: md.pallet.name().to_string(), + event_name: md.variant.name.clone(), + reason: e, + } + })?; Ok(decoded) } @@ -553,7 +589,7 @@ pub(crate) mod test_utils { let runtime_metadata: RuntimeMetadataPrefixed = meta.into(); let metadata: subxt_metadata::Metadata = runtime_metadata.try_into().unwrap(); - Metadata::from(metadata) + metadata } /// Build an `Events` object for test purposes, based on the details provided, @@ -623,7 +659,7 @@ mod tests { expected: TestRawEventDetails, ) { let actual_fields_no_context: Vec<_> = actual - .field_values() + .decode_as_fields::>() .expect("can decode field values (2)") .into_values() .map(|value| value.remove_context()) diff --git a/core/src/lib.rs b/core/src/lib.rs index a39d5e1899a..9dcecabf4ad 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -12,7 +12,6 @@ //! - [`blocks`]: decode and explore block bodies. //! - [`constants`]: access and validate the constant addresses in some metadata. //! - [`custom_values`]: access and validate the custom value addresses in some metadata. -//! - [`metadata`]: decode bytes into the metadata used throughout this library. //! - [`storage`]: construct storage request payloads and decode the results you'd get back. //! - [`tx`]: construct and sign transactions (extrinsics). //! - [`runtime_api`]: construct runtime API request payloads and decode the results you'd get back. @@ -31,7 +30,6 @@ pub mod custom_values; pub mod dynamic; pub mod error; pub mod events; -pub mod metadata; pub mod runtime_api; pub mod storage; pub mod tx; @@ -40,7 +38,7 @@ pub mod view_functions; pub use config::Config; pub use error::Error; -pub use metadata::Metadata; +pub use subxt_metadata::Metadata; /// Re-exports of some of the key external crates. pub mod ext { diff --git a/core/src/metadata/decode_encode_traits.rs b/core/src/metadata/decode_encode_traits.rs deleted file mode 100644 index b9f83f95954..00000000000 --- a/core/src/metadata/decode_encode_traits.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use super::Metadata; - -use alloc::vec::Vec; - -/// This trait is implemented for all types that also implement [`scale_decode::DecodeAsType`]. -pub trait DecodeWithMetadata: Sized { - /// Given some metadata and a type ID, attempt to SCALE decode the provided bytes into `Self`. - fn decode_with_metadata( - bytes: &mut &[u8], - type_id: u32, - metadata: &Metadata, - ) -> Result; -} - -impl DecodeWithMetadata for T { - fn decode_with_metadata( - bytes: &mut &[u8], - type_id: u32, - metadata: &Metadata, - ) -> Result { - let val = T::decode_as_type(bytes, type_id, metadata.types())?; - Ok(val) - } -} - -/// This trait is implemented for all types that also implement [`scale_encode::EncodeAsType`]. -pub trait EncodeWithMetadata { - /// SCALE encode this type to bytes, possibly with the help of metadata. - fn encode_with_metadata( - &self, - type_id: u32, - metadata: &Metadata, - bytes: &mut Vec, - ) -> Result<(), scale_encode::Error>; -} - -impl EncodeWithMetadata for T { - /// SCALE encode this type to bytes, possibly with the help of metadata. - fn encode_with_metadata( - &self, - type_id: u32, - metadata: &Metadata, - bytes: &mut Vec, - ) -> Result<(), scale_encode::Error> { - self.encode_as_type_to(type_id, metadata.types(), bytes)?; - Ok(()) - } -} diff --git a/core/src/metadata/metadata_type.rs b/core/src/metadata/metadata_type.rs deleted file mode 100644 index 4fe325a0350..00000000000 --- a/core/src/metadata/metadata_type.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::error::MetadataError; - -use alloc::borrow::ToOwned; -use alloc::sync::Arc; - -/// A cheaply clone-able representation of the runtime metadata received from a node. -#[derive(Clone, Debug)] -pub struct Metadata { - inner: Arc, -} - -impl core::ops::Deref for Metadata { - type Target = subxt_metadata::Metadata; - fn deref(&self) -> &Self::Target { - &self.inner - } -} - -impl Metadata { - /// Identical to `metadata.pallet_by_name()`, but returns an error if the pallet is not found. - pub fn pallet_by_name_err( - &self, - name: &str, - ) -> Result, MetadataError> { - self.pallet_by_name(name) - .ok_or_else(|| MetadataError::PalletNameNotFound(name.to_owned())) - } - - /// Identical to `metadata.pallet_by_index()`, but returns an error if the pallet is not found. - pub fn pallet_by_index_err( - &self, - index: u8, - ) -> Result, MetadataError> { - self.pallet_by_index(index) - .ok_or(MetadataError::PalletIndexNotFound(index)) - } - - /// Identical to `metadata.runtime_api_trait_by_name()`, but returns an error if the trait is not found. - pub fn runtime_api_trait_by_name_err( - &self, - name: &str, - ) -> Result, MetadataError> { - self.runtime_api_trait_by_name(name) - .ok_or_else(|| MetadataError::RuntimeTraitNotFound(name.to_owned())) - } - - /// Identical to `metadata.custom().get(name)`, but returns an error if the trait is not found. - pub fn custom_value_by_name_err( - &self, - name: &str, - ) -> Result, MetadataError> { - self.custom() - .get(name) - .ok_or_else(|| MetadataError::CustomValueNameNotFound(name.to_owned())) - } -} - -impl From for Metadata { - fn from(md: subxt_metadata::Metadata) -> Self { - Metadata { - inner: Arc::new(md), - } - } -} - -impl TryFrom for Metadata { - type Error = subxt_metadata::TryFromError; - fn try_from(value: frame_metadata::RuntimeMetadataPrefixed) -> Result { - subxt_metadata::Metadata::try_from(value).map(Metadata::from) - } -} - -impl codec::Decode for Metadata { - fn decode(input: &mut I) -> Result { - subxt_metadata::Metadata::decode(input).map(Metadata::from) - } -} diff --git a/core/src/metadata/mod.rs b/core/src/metadata/mod.rs deleted file mode 100644 index 480b434bfcf..00000000000 --- a/core/src/metadata/mod.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! A [`Metadata`] type, which is used through this crate. -//! -//! This can be decoded from the bytes handed back from a node when asking for metadata. -//! -//! # Examples -//! -//! ```rust -//! use subxt_core::metadata; -//! -//! // We need to fetch the bytes from somewhere, and then we can decode them: -//! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = metadata::decode_from(&metadata_bytes[..]).unwrap(); -//! ``` - -mod decode_encode_traits; -mod metadata_type; - -use codec::Decode; - -pub use decode_encode_traits::{DecodeWithMetadata, EncodeWithMetadata}; -pub use metadata_type::Metadata; - -/// Attempt to decode some bytes into [`Metadata`], returning an error -/// if decoding fails. -/// -/// This is a shortcut for importing [`codec::Decode`] and using the -/// implementation of that on [`Metadata`]. -pub fn decode_from(bytes: &[u8]) -> Result { - Metadata::decode(&mut &*bytes) -} diff --git a/core/src/runtime_api/mod.rs b/core/src/runtime_api/mod.rs index 9bdab6f50af..81390c2db4d 100644 --- a/core/src/runtime_api/mod.rs +++ b/core/src/runtime_api/mod.rs @@ -10,7 +10,7 @@ //! ```rust //! use subxt_macro::subxt; //! use subxt_core::runtime_api; -//! use subxt_core::metadata; +//! use subxt_core::Metadata; //! //! // If we generate types without `subxt`, we need to point to `::subxt_core`: //! #[subxt( @@ -21,7 +21,7 @@ //! //! // Some metadata we'll use to work with storage entries: //! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = metadata::decode_from(&metadata_bytes[..]).unwrap(); +//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); //! //! // Build a storage query to access account information. //! let payload = polkadot::apis().metadata().metadata_versions(); @@ -43,61 +43,78 @@ pub mod payload; -use crate::error::{Error, MetadataError}; -use crate::metadata::{DecodeWithMetadata, Metadata}; -use alloc::borrow::ToOwned; +use crate::Metadata; +use crate::error::RuntimeApiError; use alloc::format; -use alloc::string::String; +use alloc::string::{String, ToString}; use alloc::vec::Vec; use payload::Payload; +use scale_decode::IntoVisitor; /// Run the validation logic against some runtime API payload you'd like to use. Returns `Ok(())` /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). /// Return an error if the payload was not valid or something went wrong trying to validate it (ie /// the runtime API in question do not exist at all) -pub fn validate(payload: &P, metadata: &Metadata) -> Result<(), Error> { - let Some(static_hash) = payload.validation_hash() else { +pub fn validate(payload: P, metadata: &Metadata) -> Result<(), RuntimeApiError> { + let Some(hash) = payload.validation_hash() else { return Ok(()); }; - let api_trait = metadata.runtime_api_trait_by_name_err(payload.trait_name())?; - let Some(api_method) = api_trait.method_by_name(payload.method_name()) else { - return Err(MetadataError::IncompatibleCodegen.into()); - }; + let trait_name = payload.trait_name(); + let method_name = payload.method_name(); + + let api_trait = metadata + .runtime_api_trait_by_name(trait_name) + .ok_or_else(|| RuntimeApiError::TraitNotFound(trait_name.to_string()))?; + let api_method = + api_trait + .method_by_name(method_name) + .ok_or_else(|| RuntimeApiError::MethodNotFound { + trait_name: trait_name.to_string(), + method_name: method_name.to_string(), + })?; - let runtime_hash = api_method.hash(); - if static_hash != runtime_hash { - return Err(MetadataError::IncompatibleCodegen.into()); + if hash != api_method.hash() { + Err(RuntimeApiError::IncompatibleCodegen) + } else { + Ok(()) } - Ok(()) } /// Return the name of the runtime API call from the payload. -pub fn call_name(payload: &P) -> String { +pub fn call_name(payload: P) -> String { format!("{}_{}", payload.trait_name(), payload.method_name()) } /// Return the encoded call args given a runtime API payload. -pub fn call_args(payload: &P, metadata: &Metadata) -> Result, Error> { - payload.encode_args(metadata) +pub fn call_args(payload: P, metadata: &Metadata) -> Result, RuntimeApiError> { + let value = frame_decode::runtime_apis::encode_runtime_api_inputs( + payload.trait_name(), + payload.method_name(), + payload.args(), + metadata, + metadata.types(), + ) + .map_err(RuntimeApiError::CouldNotEncodeInputs)?; + + Ok(value) } /// Decode the value bytes at the location given by the provided runtime API payload. pub fn decode_value( bytes: &mut &[u8], - payload: &P, + payload: P, metadata: &Metadata, -) -> Result { - let api_method = metadata - .runtime_api_trait_by_name_err(payload.trait_name())? - .method_by_name(payload.method_name()) - .ok_or_else(|| MetadataError::RuntimeMethodNotFound(payload.method_name().to_owned()))?; - - let val = ::decode_with_metadata( - &mut &bytes[..], - api_method.output_ty(), +) -> Result { + let value = frame_decode::runtime_apis::decode_runtime_api_response( + payload.trait_name(), + payload.method_name(), + bytes, metadata, - )?; + metadata.types(), + P::ReturnType::into_visitor(), + ) + .map_err(RuntimeApiError::CouldNotDecodeResponse)?; - Ok(val) + Ok(value) } diff --git a/core/src/runtime_api/payload.rs b/core/src/runtime_api/payload.rs index ee3e32e6559..6a64fa5f807 100644 --- a/core/src/runtime_api/payload.rs +++ b/core/src/runtime_api/payload.rs @@ -6,45 +6,19 @@ //! runtime API calls that can be made. use alloc::borrow::Cow; -use alloc::borrow::ToOwned; use alloc::string::String; -use alloc::vec::Vec; use core::marker::PhantomData; use derive_where::derive_where; -use scale_encode::EncodeAsFields; -use scale_value::Composite; +use frame_decode::runtime_apis::IntoEncodableValues; +use scale_decode::DecodeAsType; -use crate::Error; -use crate::dynamic::DecodedValueThunk; -use crate::error::MetadataError; - -use crate::metadata::{DecodeWithMetadata, Metadata}; - -/// This represents a runtime API payload that can call into the runtime of node. -/// -/// # Components -/// -/// - associated return type -/// -/// Resulting bytes of the call are interpreted into this type. -/// -/// - runtime function name -/// -/// The function name of the runtime API call. This is obtained by concatenating -/// the runtime trait name with the trait's method. -/// -/// For example, the substrate runtime trait [Metadata](https://github.com/paritytech/substrate/blob/cb954820a8d8d765ce75021e244223a3b4d5722d/primitives/api/src/lib.rs#L745) -/// contains the `metadata_at_version` function. The corresponding runtime function -/// is `Metadata_metadata_at_version`. -/// -/// - encoded arguments -/// -/// Each argument of the runtime function must be scale-encoded. +/// This represents a runtime API payload that can be used to call a Runtime API on +/// a chain and decode the response. pub trait Payload { + /// Type of the arguments. + type ArgsType: IntoEncodableValues; /// The return type of the function call. - // Note: `DecodeWithMetadata` is needed to decode the function call result - // with the `subxt::Metadata. - type ReturnType: DecodeWithMetadata; + type ReturnType: DecodeAsType; /// The runtime API trait name. fn trait_name(&self) -> &str; @@ -52,16 +26,8 @@ pub trait Payload { /// The runtime API method name. fn method_name(&self) -> &str; - /// Scale encode the arguments data. - fn encode_args_to(&self, metadata: &Metadata, out: &mut Vec) -> Result<(), Error>; - - /// Encode arguments data and return the output. This is a convenience - /// wrapper around [`Payload::encode_args_to`]. - fn encode_args(&self, metadata: &Metadata) -> Result, Error> { - let mut v = Vec::new(); - self.encode_args_to(metadata, &mut v)?; - Ok(v) - } + /// The input arguments. + fn args(&self) -> &Self::ArgsType; /// Returns the statically generated validation hash. fn validation_hash(&self) -> Option<[u8; 32]> { @@ -69,29 +35,50 @@ pub trait Payload { } } +// Any reference to a payload is a valid payload. +impl Payload for &'_ P { + type ArgsType = P::ArgsType; + type ReturnType = P::ReturnType; + + fn trait_name(&self) -> &str { + P::trait_name(*self) + } + + fn method_name(&self) -> &str { + P::method_name(*self) + } + + fn args(&self) -> &Self::ArgsType { + P::args(*self) + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + P::validation_hash(*self) + } +} + /// A runtime API payload containing the generic argument data /// and interpreting the result of the call as `ReturnTy`. /// /// This can be created from static values (ie those generated /// via the `subxt` macro) or dynamic values via [`dynamic`]. -#[derive_where(Clone, Debug, Eq, Ord, PartialEq, PartialOrd; ArgsData)] -pub struct DefaultPayload { +#[derive_where(Clone, Debug, Eq, Ord, PartialEq, PartialOrd; ArgsType)] +pub struct StaticPayload { trait_name: Cow<'static, str>, method_name: Cow<'static, str>, - args_data: ArgsData, + args: ArgsType, validation_hash: Option<[u8; 32]>, - _marker: PhantomData, + _marker: PhantomData, } -/// A statically generated runtime API payload. -pub type StaticPayload = DefaultPayload; /// A dynamic runtime API payload. -pub type DynamicPayload = DefaultPayload, DecodedValueThunk>; +pub type DynamicPayload = StaticPayload; -impl Payload - for DefaultPayload +impl Payload + for StaticPayload { - type ReturnType = ReturnTy; + type ArgsType = ArgsType; + type ReturnType = ReturnType; fn trait_name(&self) -> &str { &self.trait_name @@ -101,18 +88,8 @@ impl Payload &self.method_name } - fn encode_args_to(&self, metadata: &Metadata, out: &mut Vec) -> Result<(), Error> { - let api_method = metadata - .runtime_api_trait_by_name_err(&self.trait_name)? - .method_by_name(&self.method_name) - .ok_or_else(|| MetadataError::RuntimeMethodNotFound((*self.method_name).to_owned()))?; - let mut fields = api_method - .inputs() - .map(|input| scale_encode::Field::named(input.ty, &input.name)); - - self.args_data - .encode_as_fields_to(&mut fields, metadata.types(), out)?; - Ok(()) + fn args(&self) -> &Self::ArgsType { + &self.args } fn validation_hash(&self) -> Option<[u8; 32]> { @@ -120,23 +97,23 @@ impl Payload } } -impl DefaultPayload { - /// Create a new [`DefaultPayload`]. +impl StaticPayload { + /// Create a new [`StaticPayload`]. pub fn new( trait_name: impl Into, method_name: impl Into, - args_data: ArgsData, + args: ArgsType, ) -> Self { - DefaultPayload { - trait_name: Cow::Owned(trait_name.into()), - method_name: Cow::Owned(method_name.into()), - args_data, + StaticPayload { + trait_name: trait_name.into().into(), + method_name: method_name.into().into(), + args, validation_hash: None, _marker: PhantomData, } } - /// Create a new static [`DefaultPayload`] using static function name + /// Create a new static [`StaticPayload`] using static function name /// and scale-encoded argument data. /// /// This is only expected to be used from codegen. @@ -144,13 +121,13 @@ impl DefaultPayload { pub fn new_static( trait_name: &'static str, method_name: &'static str, - args_data: ArgsData, + args: ArgsType, hash: [u8; 32], - ) -> DefaultPayload { - DefaultPayload { + ) -> StaticPayload { + StaticPayload { trait_name: Cow::Borrowed(trait_name), method_name: Cow::Borrowed(method_name), - args_data, + args, validation_hash: Some(hash), _marker: core::marker::PhantomData, } @@ -173,18 +150,13 @@ impl DefaultPayload { pub fn method_name(&self) -> &str { &self.method_name } - - /// Returns the arguments data. - pub fn args_data(&self) -> &ArgsData { - &self.args_data - } } /// Create a new [`DynamicPayload`]. -pub fn dynamic( +pub fn dynamic( trait_name: impl Into, method_name: impl Into, - args_data: impl Into>, -) -> DynamicPayload { - DefaultPayload::new(trait_name, method_name, args_data.into()) + args_data: ArgsType, +) -> DynamicPayload { + DynamicPayload::new(trait_name, method_name, args_data) } diff --git a/core/src/storage/address.rs b/core/src/storage/address.rs index d17157a3706..fe91d8321f6 100644 --- a/core/src/storage/address.rs +++ b/core/src/storage/address.rs @@ -4,143 +4,125 @@ //! Construct addresses to access storage entries with. -use crate::{ - dynamic::DecodedValueThunk, - error::{Error, MetadataError}, - metadata::{DecodeWithMetadata, Metadata}, - utils::Yes, -}; -use derive_where::derive_where; - -use alloc::borrow::{Cow, ToOwned}; +use crate::utils::{Maybe, YesMaybe}; +use alloc::borrow::Cow; use alloc::string::String; use alloc::vec::Vec; +use frame_decode::storage::{IntoDecodableValues, IntoEncodableValues}; +use scale_decode::DecodeAsType; -// Re-export types used here: -pub use super::storage_key::{StaticStorageKey, StorageHashers, StorageHashersIter, StorageKey}; - -/// This represents a storage address. Anything implementing this trait -/// can be used to fetch and iterate over storage entries. +/// A storage address. This allows access to a given storage entry, which can then +/// be iterated over or fetched from by providing the relevant set of keys, or +/// otherwise inspected. pub trait Address { - /// The target type of the value that lives at this address. - type Target: DecodeWithMetadata; - /// The keys type used to construct this address. - type Keys: StorageKey; - /// Can an entry be fetched from this address? - /// Set this type to [`Yes`] to enable the corresponding calls to be made. - type IsFetchable; - /// Can a default entry be obtained from this address? - /// Set this type to [`Yes`] to enable the corresponding calls to be made. - type IsDefaultable; - /// Can this address be iterated over? - /// Set this type to [`Yes`] to enable the corresponding calls to be made. - type IsIterable; - - /// The name of the pallet that the entry lives under. + /// All of the keys required to get to an individual value at this address. + /// Keys must always impl [`IntoEncodableValues`], and for iteration must + /// also impl [`frame_decode::storage::IntoDecodableValues`]. + type KeyParts: IntoEncodableValues + IntoDecodableValues; + /// Type of the storage value at this location. + type Value: DecodeAsType; + /// Does the address point to a plain value (as opposed to a map)? + /// Set to [`crate::utils::Yes`] to enable APIs which require a map, + /// or [`crate::utils::Maybe`] to enable APIs which allow a map. + type IsPlain: YesMaybe; + + /// The pallet containing this storage entry. fn pallet_name(&self) -> &str; - /// The name of the entry in a given pallet that the item is at. + /// The name of the storage entry. fn entry_name(&self) -> &str; - /// Output the non-prefix bytes; that is, any additional bytes that need - /// to be appended to the key to dig into maps. - fn append_entry_bytes(&self, metadata: &Metadata, bytes: &mut Vec) -> Result<(), Error>; + /// Return a unique hash for this address which can be used to validate it against metadata. + fn validation_hash(&self) -> Option<[u8; 32]>; +} + +// Any reference to an address is a valid address. +impl Address for &'_ A { + type KeyParts = A::KeyParts; + type Value = A::Value; + type IsPlain = A::IsPlain; + + fn pallet_name(&self) -> &str { + A::pallet_name(*self) + } + + fn entry_name(&self) -> &str { + A::entry_name(*self) + } - /// An optional hash which, if present, will be checked against - /// the node metadata to confirm that the return type matches what - /// we are expecting. fn validation_hash(&self) -> Option<[u8; 32]> { - None + A::validation_hash(*self) } } -/// A concrete storage address. This can be created from static values (ie those generated -/// via the `subxt` macro) or dynamic values via [`dynamic`]. -#[derive_where(Clone, Debug, Eq, Ord, PartialEq, PartialOrd; Keys)] -pub struct DefaultAddress { +/// An address which is generated by the static APIs. +pub struct StaticAddress { pallet_name: Cow<'static, str>, entry_name: Cow<'static, str>, - keys: Keys, validation_hash: Option<[u8; 32]>, - _marker: core::marker::PhantomData<(ReturnTy, Fetchable, Defaultable, Iterable)>, + marker: core::marker::PhantomData<(KeyParts, Value, IsPlain)>, } -/// A storage address constructed by the static codegen. -pub type StaticAddress = - DefaultAddress; -/// A typical storage address constructed at runtime rather than via the `subxt` macro; this -/// has no restriction on what it can be used for (since we don't statically know). -pub type DynamicAddress = DefaultAddress; - -impl DynamicAddress { - /// Creates a new dynamic address. As `Keys` you can use a `Vec` - pub fn new(pallet_name: impl Into, entry_name: impl Into, keys: Keys) -> Self { +impl Clone for StaticAddress { + fn clone(&self) -> Self { Self { - pallet_name: Cow::Owned(pallet_name.into()), - entry_name: Cow::Owned(entry_name.into()), - keys, - validation_hash: None, - _marker: core::marker::PhantomData, + pallet_name: self.pallet_name.clone(), + entry_name: self.entry_name.clone(), + validation_hash: self.validation_hash, + marker: self.marker, } } } -impl - DefaultAddress -where - Keys: StorageKey, - ReturnTy: DecodeWithMetadata, -{ - /// Create a new [`Address`] using static strings for the pallet and call name. +impl core::fmt::Debug for StaticAddress { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.debug_struct("StaticAddress") + .field("pallet_name", &self.pallet_name) + .field("entry_name", &self.entry_name) + .field("validation_hash", &self.validation_hash) + .finish() + } +} + +impl StaticAddress { + /// Create a new [`StaticAddress`] using static strings for the pallet and call name. /// This is only expected to be used from codegen. #[doc(hidden)] - pub fn new_static( - pallet_name: &'static str, - entry_name: &'static str, - keys: Keys, - hash: [u8; 32], - ) -> Self { + pub fn new_static(pallet_name: &'static str, entry_name: &'static str, hash: [u8; 32]) -> Self { Self { pallet_name: Cow::Borrowed(pallet_name), entry_name: Cow::Borrowed(entry_name), - keys, validation_hash: Some(hash), - _marker: core::marker::PhantomData, + marker: core::marker::PhantomData, } } -} -impl - DefaultAddress -where - Keys: StorageKey, - ReturnTy: DecodeWithMetadata, -{ - /// Do not validate this storage entry prior to accessing it. - pub fn unvalidated(self) -> Self { + /// Create a new address. + pub fn new(pallet_name: impl Into, entry_name: impl Into) -> Self { Self { + pallet_name: pallet_name.into().into(), + entry_name: entry_name.into().into(), validation_hash: None, - ..self + marker: core::marker::PhantomData, } } - /// Return bytes representing the root of this storage entry (a hash of the pallet and entry name). - pub fn to_root_bytes(&self) -> Vec { - super::get_address_root_bytes(self) + /// Do not validate this storage entry prior to accessing it. + pub fn unvalidated(mut self) -> Self { + self.validation_hash = None; + self } } -impl Address - for DefaultAddress +impl Address for StaticAddress where - Keys: StorageKey, - ReturnTy: DecodeWithMetadata, + KeyParts: IntoEncodableValues + IntoDecodableValues, + Value: DecodeAsType, + IsPlain: YesMaybe, { - type Target = ReturnTy; - type Keys = Keys; - type IsFetchable = Fetchable; - type IsDefaultable = Defaultable; - type IsIterable = Iterable; + type KeyParts = KeyParts; + type Value = Value; + type IsPlain = IsPlain; fn pallet_name(&self) -> &str { &self.pallet_name @@ -150,31 +132,40 @@ where &self.entry_name } - fn append_entry_bytes(&self, metadata: &Metadata, bytes: &mut Vec) -> Result<(), Error> { - let pallet = metadata.pallet_by_name_err(self.pallet_name())?; - let storage = pallet - .storage() - .ok_or_else(|| MetadataError::StorageNotFoundInPallet(self.pallet_name().to_owned()))?; - let entry = storage - .entry_by_name(self.entry_name()) - .ok_or_else(|| MetadataError::StorageEntryNotFound(self.entry_name().to_owned()))?; - - let hashers = StorageHashers::new(entry.entry_type(), metadata.types())?; - self.keys - .encode_storage_key(bytes, &mut hashers.iter(), metadata.types())?; - Ok(()) + fn validation_hash(&self) -> Option<[u8; 32]> { + self.validation_hash + } +} + +impl, B: AsRef> Address for (A, B) { + type KeyParts = Vec; + type Value = scale_value::Value; + type IsPlain = Maybe; + + fn pallet_name(&self) -> &str { + self.0.as_ref() + } + + fn entry_name(&self) -> &str { + self.1.as_ref() } fn validation_hash(&self) -> Option<[u8; 32]> { - self.validation_hash + None } } -/// Construct a new dynamic storage lookup. -pub fn dynamic( +/// A dynamic address is simply a [`StaticAddress`] which asserts that the +/// entry *might* be a map and *might* have a default value. +pub type DynamicAddress, Value = scale_value::Value> = + StaticAddress; + +/// Construct a new dynamic storage address. You can define the type of the +/// storage keys and value yourself here, but have no guarantee that they will +/// be correct. +pub fn dynamic( pallet_name: impl Into, entry_name: impl Into, - storage_entry_keys: Keys, -) -> DynamicAddress { - DynamicAddress::new(pallet_name, entry_name, storage_entry_keys) +) -> DynamicAddress { + DynamicAddress::::new(pallet_name.into(), entry_name.into()) } diff --git a/core/src/storage/mod.rs b/core/src/storage/mod.rs index e276bbb4700..c694d113582 100644 --- a/core/src/storage/mod.rs +++ b/core/src/storage/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. +// Copyright 2019-2025 Parity Technologies (UK) Ltd. // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. @@ -10,7 +10,7 @@ //! use subxt_signer::sr25519::dev; //! use subxt_macro::subxt; //! use subxt_core::storage; -//! use subxt_core::metadata; +//! use subxt_core::Metadata; //! //! // If we generate types without `subxt`, we need to point to `::subxt_core`: //! #[subxt( @@ -21,45 +21,54 @@ //! //! // Some metadata we'll use to work with storage entries: //! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! let metadata = metadata::decode_from(&metadata_bytes[..]).unwrap(); +//! let metadata = Metadata::decode_from(&metadata_bytes[..]).unwrap(); //! //! // Build a storage query to access account information. -//! let account = dev::alice().public_key().into(); -//! let address = polkadot::storage().system().account(account); +//! let address = polkadot::storage().system().account(); //! //! // We can validate that the address is compatible with the given metadata. //! storage::validate(&address, &metadata).unwrap(); //! -//! // Encode the address to bytes. These can be sent to a node to query the value. -//! storage::get_address_bytes(&address, &metadata).unwrap(); +//! // We can fetch details about the storage entry associated with this address: +//! let entry = storage::entry(address, &metadata).unwrap(); //! -//! // If we were to obtain a value back from the node at that address, we could -//! // then decode it using the same address and metadata like so: +//! // .. including generating a key to fetch the entry with: +//! let fetch_key = entry.fetch_key((dev::alice().public_key().into(),)).unwrap(); +//! +//! // .. or generating a key to iterate over entries with at a given depth: +//! let iter_key = entry.iter_key(()).unwrap(); +//! +//! // Given a value, we can decode it: //! let value_bytes = hex::decode("00000000000000000100000000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080").unwrap(); -//! let value = storage::decode_value(&mut &*value_bytes, &address, &metadata).unwrap(); +//! let value = entry.value(value_bytes).decode().unwrap(); //! //! println!("Alice's account info: {value:?}"); //! ``` +mod prefix_of; +mod storage_entry; mod storage_key; -mod utils; +mod storage_key_value; +mod storage_value; pub mod address; -use crate::{Error, Metadata, error::MetadataError, metadata::DecodeWithMetadata}; +use crate::{Metadata, error::StorageError}; use address::Address; -use alloc::vec::Vec; +use alloc::string::ToString; -// This isn't a part of the public API, but expose here because it's useful in Subxt. -#[doc(hidden)] -pub use utils::lookup_storage_entry_details; +pub use prefix_of::{EqualOrPrefixOf, PrefixOf}; +pub use storage_entry::{StorageEntry, entry}; +pub use storage_key::{StorageHasher, StorageKey, StorageKeyPart}; +pub use storage_key_value::StorageKeyValue; +pub use storage_value::StorageValue; /// When the provided `address` is statically generated via the `#[subxt]` macro, this validates /// that the shape of the storage value is the same as the shape expected by the static address. /// /// When the provided `address` is dynamic (and thus does not come with any expectation of the /// shape of the constant value), this just returns `Ok(())` -pub fn validate(address: &Addr, metadata: &Metadata) -> Result<(), Error> { +pub fn validate(address: Addr, metadata: &Metadata) -> Result<(), StorageError> { let Some(hash) = address.validation_hash() else { return Ok(()); }; @@ -67,76 +76,19 @@ pub fn validate(address: &Addr, metadata: &Metadata) -> Result<() let pallet_name = address.pallet_name(); let entry_name = address.entry_name(); - let pallet_metadata = metadata.pallet_by_name_err(pallet_name)?; - - let Some(expected_hash) = pallet_metadata.storage_hash(entry_name) else { - return Err(MetadataError::IncompatibleCodegen.into()); - }; - if expected_hash != hash { - return Err(MetadataError::IncompatibleCodegen.into()); + let pallet_metadata = metadata + .pallet_by_name(pallet_name) + .ok_or_else(|| StorageError::PalletNameNotFound(pallet_name.to_string()))?; + let storage_hash = pallet_metadata.storage_hash(entry_name).ok_or_else(|| { + StorageError::StorageEntryNotFound { + pallet_name: pallet_name.to_string(), + entry_name: entry_name.to_string(), + } + })?; + + if storage_hash != hash { + Err(StorageError::IncompatibleCodegen) + } else { + Ok(()) } - Ok(()) -} - -/// Given a storage address and some metadata, this encodes the address into bytes which can be -/// handed to a node to retrieve the corresponding value. -pub fn get_address_bytes( - address: &Addr, - metadata: &Metadata, -) -> Result, Error> { - let mut bytes = Vec::new(); - utils::write_storage_address_root_bytes(address, &mut bytes); - address.append_entry_bytes(metadata, &mut bytes)?; - Ok(bytes) -} - -/// Given a storage address and some metadata, this encodes the root of the address (ie the pallet -/// and storage entry part) into bytes. If the entry being addressed is inside a map, this returns -/// the bytes needed to iterate over all of the entries within it. -pub fn get_address_root_bytes(address: &Addr) -> Vec { - let mut bytes = Vec::new(); - utils::write_storage_address_root_bytes(address, &mut bytes); - bytes -} - -/// Given some storage value that we've retrieved from a node, the address used to retrieve it, and -/// metadata from the node, this function attempts to decode the bytes into the target value specified -/// by the address. -pub fn decode_value( - bytes: &mut &[u8], - address: &Addr, - metadata: &Metadata, -) -> Result { - let pallet_name = address.pallet_name(); - let entry_name = address.entry_name(); - - let (_, entry_metadata) = - utils::lookup_storage_entry_details(pallet_name, entry_name, metadata)?; - let value_ty_id = match entry_metadata.entry_type() { - subxt_metadata::StorageEntryType::Plain(ty) => *ty, - subxt_metadata::StorageEntryType::Map { value_ty, .. } => *value_ty, - }; - - let val = Addr::Target::decode_with_metadata(bytes, value_ty_id, metadata)?; - Ok(val) -} - -/// Return the default value at a given storage address if one is available, or an error otherwise. -pub fn default_value( - address: &Addr, - metadata: &Metadata, -) -> Result { - let pallet_name = address.pallet_name(); - let entry_name = address.entry_name(); - - let (_, entry_metadata) = - utils::lookup_storage_entry_details(pallet_name, entry_name, metadata)?; - let value_ty_id = match entry_metadata.entry_type() { - subxt_metadata::StorageEntryType::Plain(ty) => *ty, - subxt_metadata::StorageEntryType::Map { value_ty, .. } => *value_ty, - }; - - let default_bytes = entry_metadata.default_bytes(); - let val = Addr::Target::decode_with_metadata(&mut &*default_bytes, value_ty_id, metadata)?; - Ok(val) } diff --git a/core/src/storage/prefix_of.rs b/core/src/storage/prefix_of.rs new file mode 100644 index 00000000000..170eb6f784b --- /dev/null +++ b/core/src/storage/prefix_of.rs @@ -0,0 +1,195 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use alloc::vec::Vec; +use frame_decode::helpers::IntoEncodableValues; +use scale_encode::EncodeAsType; + +/// For a given set of values that can be used as keys for a storage entry, +/// this is implemented for any prefixes of that set. ie if the keys `(A,B,C)` +/// would access a storage value, then `PrefixOf<(A,B,C)>` is implemented for +/// `(A,B)`, `(A,)` and `()`. +pub trait PrefixOf: IntoEncodableValues {} + +// If T impls PrefixOf, &T impls PrefixOf. +impl> PrefixOf for &T {} + +// Impls for tuples up to length 6 (storage maps rarely require more than 2 entries +// so it's very unlikely we'll ever need to go this deep). +impl PrefixOf<(A,)> for () {} + +impl PrefixOf<(A, B)> for () {} +impl PrefixOf<(A, B)> for (A,) where (A,): IntoEncodableValues {} + +impl PrefixOf<(A, B, C)> for () {} +impl PrefixOf<(A, B, C)> for (A,) where (A,): IntoEncodableValues {} +impl PrefixOf<(A, B, C)> for (A, B) where (A, B): IntoEncodableValues {} + +impl PrefixOf<(A, B, C, D)> for () {} +impl PrefixOf<(A, B, C, D)> for (A,) where (A,): IntoEncodableValues {} +impl PrefixOf<(A, B, C, D)> for (A, B) where (A, B): IntoEncodableValues {} +impl PrefixOf<(A, B, C, D)> for (A, B, C) where (A, B, C): IntoEncodableValues {} + +impl PrefixOf<(A, B, C, D, E)> for () {} +impl PrefixOf<(A, B, C, D, E)> for (A,) where (A,): IntoEncodableValues {} +impl PrefixOf<(A, B, C, D, E)> for (A, B) where (A, B): IntoEncodableValues {} +impl PrefixOf<(A, B, C, D, E)> for (A, B, C) where (A, B, C): IntoEncodableValues {} +impl PrefixOf<(A, B, C, D, E)> for (A, B, C, D) where + (A, B, C, D): IntoEncodableValues +{ +} + +impl PrefixOf<(A, B, C, D, E, F)> for () {} +impl PrefixOf<(A, B, C, D, E, F)> for (A,) where (A,): IntoEncodableValues {} +impl PrefixOf<(A, B, C, D, E, F)> for (A, B) where (A, B): IntoEncodableValues {} +impl PrefixOf<(A, B, C, D, E, F)> for (A, B, C) where + (A, B, C): IntoEncodableValues +{ +} +impl PrefixOf<(A, B, C, D, E, F)> for (A, B, C, D) where + (A, B, C, D): IntoEncodableValues +{ +} +impl PrefixOf<(A, B, C, D, E, F)> for (A, B, C, D, E) where + (A, B, C, D, E): IntoEncodableValues +{ +} + +// Vecs are prefixes of vecs. The length is not statically known and so +// these would be given dynamically only, leaving the correct length to the user. +impl PrefixOf> for Vec {} + +// We don't use arrays in Subxt for storage entry access, but `IntoEncodableValues` +// supports them so let's allow impls which do use them to benefit too. +macro_rules! array_impl { + ($n:literal: $($p:literal)+) => { + $( + impl PrefixOf<[T; $n]> for [T; $p] {} + )+ + } +} + +array_impl!(1: 0); +array_impl!(2: 1 0); +array_impl!(3: 2 1 0); +array_impl!(4: 3 2 1 0); +array_impl!(5: 4 3 2 1 0); +array_impl!(6: 5 4 3 2 1 0); + +/// This is much like [`PrefixOf`] except that it also includes `Self` as an allowed type, +/// where `Self` must impl [`IntoEncodableValues`] just as every [`PrefixOf`] does. +pub trait EqualOrPrefixOf: IntoEncodableValues {} + +// Tuples +macro_rules! tuple_impl_eq { + ($($t:ident)+) => { + // Any T that is a PrefixOf impls EqualOrPrefixOf too + impl <$($t,)+ T: PrefixOf<($($t,)+)>> EqualOrPrefixOf<($($t,)+)> for T {} + // Keys impls EqualOrPrefixOf + impl <$($t),+> EqualOrPrefixOf<($($t,)+)> for ($($t,)+) where ($($t,)+): IntoEncodableValues {} + // &'a Keys impls EqualOrPrefixOf + impl <'a, $($t),+> EqualOrPrefixOf<($($t,)+)> for &'a ($($t,)+) where ($($t,)+): IntoEncodableValues {} + } +} + +tuple_impl_eq!(A); +tuple_impl_eq!(A B); +tuple_impl_eq!(A B C); +tuple_impl_eq!(A B C D); +tuple_impl_eq!(A B C D E); +tuple_impl_eq!(A B C D E F); + +// Vec +impl EqualOrPrefixOf> for Vec {} +impl EqualOrPrefixOf> for &Vec {} + +// Arrays +macro_rules! array_impl_eq { + ($($n:literal)+) => { + $( + impl EqualOrPrefixOf<[A; $n]> for [A; $n] {} + impl <'a, A: EncodeAsType> EqualOrPrefixOf<[A; $n]> for &'a [A; $n] {} + )+ + } +} + +impl EqualOrPrefixOf<[A; N]> for T where T: PrefixOf<[A; N]> {} +array_impl_eq!(1 2 3 4 5 6); + +#[cfg(test)] +mod test { + use super::*; + + struct Test(core::marker::PhantomData); + + impl Test { + fn new() -> Self { + Test(core::marker::PhantomData) + } + fn accepts_prefix_of>(&self, keys: P) { + let _encoder = keys.into_encodable_values(); + } + fn accepts_eq_or_prefix_of>(&self, keys: P) { + let _encoder = keys.into_encodable_values(); + } + } + + #[test] + fn test_prefix_of() { + // In real life we'd have a struct a bit like this: + let t = Test::<(bool, String, u64)>::new(); + + // And we'd want to be able to call some method like this: + //// This shouldn't work: + // t.accepts_prefix_of((true, String::from("hi"), 0)); + t.accepts_prefix_of(&(true, String::from("hi"))); + t.accepts_prefix_of((true, String::from("hi"))); + t.accepts_prefix_of((true,)); + t.accepts_prefix_of(()); + + let t = Test::<[u64; 5]>::new(); + + //// This shouldn't work: + // t.accepts_prefix_of([0,1,2,3,4]); + t.accepts_prefix_of([0, 1, 2, 3]); + t.accepts_prefix_of([0, 1, 2, 3]); + t.accepts_prefix_of([0, 1, 2]); + t.accepts_prefix_of([0, 1]); + t.accepts_prefix_of([0]); + t.accepts_prefix_of([]); + } + + #[test] + fn test_eq_or_prefix_of() { + // In real life we'd have a struct a bit like this: + let t = Test::<(bool, String, u64)>::new(); + + // And we'd want to be able to call some method like this: + t.accepts_eq_or_prefix_of(&(true, String::from("hi"), 0)); + t.accepts_eq_or_prefix_of(&(true, String::from("hi"))); + t.accepts_eq_or_prefix_of((true,)); + t.accepts_eq_or_prefix_of(()); + + t.accepts_eq_or_prefix_of((true, String::from("hi"), 0)); + t.accepts_eq_or_prefix_of((true, String::from("hi"))); + t.accepts_eq_or_prefix_of((true,)); + t.accepts_eq_or_prefix_of(()); + + let t = Test::<[u64; 5]>::new(); + + t.accepts_eq_or_prefix_of([0, 1, 2, 3, 4]); + t.accepts_eq_or_prefix_of([0, 1, 2, 3]); + t.accepts_eq_or_prefix_of([0, 1, 2]); + t.accepts_eq_or_prefix_of([0, 1]); + t.accepts_eq_or_prefix_of([0]); + t.accepts_eq_or_prefix_of([]); + + t.accepts_eq_or_prefix_of([0, 1, 2, 3, 4]); + t.accepts_eq_or_prefix_of([0, 1, 2, 3]); + t.accepts_eq_or_prefix_of([0, 1, 2]); + t.accepts_eq_or_prefix_of([0, 1]); + t.accepts_eq_or_prefix_of([0]); + t.accepts_eq_or_prefix_of([]); + } +} diff --git a/core/src/storage/storage_entry.rs b/core/src/storage/storage_entry.rs new file mode 100644 index 00000000000..0f7efaf6b58 --- /dev/null +++ b/core/src/storage/storage_entry.rs @@ -0,0 +1,155 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::{PrefixOf, StorageKeyValue, StorageValue, address::Address}; +use crate::error::StorageError; +use crate::utils::YesMaybe; +use alloc::sync::Arc; +use alloc::vec::Vec; +use frame_decode::storage::{IntoEncodableValues, StorageInfo}; +use scale_info::PortableRegistry; +use subxt_metadata::Metadata; + +/// Create a [`StorageEntry`] to work with a given storage entry. +pub fn entry<'info, Addr: Address>( + address: Addr, + metadata: &'info Metadata, +) -> Result, StorageError> { + super::validate(&address, metadata)?; + + use frame_decode::storage::StorageTypeInfo; + let types = metadata.types(); + let info = metadata + .storage_info(address.pallet_name(), address.entry_name()) + .map_err(|e| StorageError::StorageInfoError(e.into_owned()))?; + + Ok(StorageEntry(Arc::new(StorageEntryInner { + address, + info: Arc::new(info), + types, + }))) +} + +/// This represents a single storage entry (be it a plain value or map). +pub struct StorageEntry<'info, Addr>(Arc>); + +impl<'info, Addr> Clone for StorageEntry<'info, Addr> { + fn clone(&self) -> Self { + Self(self.0.clone()) + } +} + +struct StorageEntryInner<'info, Addr> { + address: Addr, + info: Arc>, + types: &'info PortableRegistry, +} + +impl<'info, Addr: Address> StorageEntry<'info, Addr> { + /// Name of the pallet containing this storage entry. + pub fn pallet_name(&self) -> &str { + self.0.address.pallet_name() + } + + /// Name of the storage entry. + pub fn entry_name(&self) -> &str { + self.0.address.entry_name() + } + + /// Is the storage entry a plain value? + pub fn is_plain(&self) -> bool { + self.0.info.keys.is_empty() + } + + /// Is the storage entry a map? + pub fn is_map(&self) -> bool { + !self.is_plain() + } + + /// Instantiate a [`StorageKeyValue`] for this entry. + /// + /// It is expected that the bytes are obtained by iterating key/value pairs at this address. + pub fn key_value( + &self, + key_bytes: impl Into>, + value_bytes: Vec, + ) -> StorageKeyValue<'info, Addr> { + StorageKeyValue::new( + self.0.info.clone(), + self.0.types, + key_bytes.into(), + value_bytes, + ) + } + + /// Instantiate a [`StorageValue`] for this entry. + /// + /// It is expected that the bytes are obtained by fetching a value at this address. + pub fn value(&self, bytes: Vec) -> StorageValue<'info, Addr::Value> { + StorageValue::new(self.0.info.clone(), self.0.types, bytes) + } + + /// Return the default [`StorageValue`] for this storage entry, if there is one. + pub fn default_value(&self) -> Option> { + self.0.info.default_value.as_deref().map(|default_bytes| { + StorageValue::new(self.0.info.clone(), self.0.types, default_bytes.to_vec()) + }) + } + + /// The keys for plain storage values are always 32 byte hashes. + pub fn key_prefix(&self) -> [u8; 32] { + frame_decode::storage::encode_storage_key_prefix( + self.0.address.pallet_name(), + self.0.address.entry_name(), + ) + } + + // This has a less "strict" type signature and so is just used under the hood. + fn key(&self, key_parts: Keys) -> Result, StorageError> { + let key = frame_decode::storage::encode_storage_key_with_info( + self.0.address.pallet_name(), + self.0.address.entry_name(), + key_parts, + &self.0.info, + self.0.types, + ) + .map_err(StorageError::StorageKeyEncodeError)?; + + Ok(key) + } + + /// This constructs a key suitable for fetching a value at the given map storage address. This will error + /// if we can see that the wrong number of key parts are provided. + pub fn fetch_key(&self, key_parts: Addr::KeyParts) -> Result, StorageError> { + if key_parts.num_encodable_values() != self.0.info.keys.len() { + Err(StorageError::WrongNumberOfKeyPartsProvidedForFetching { + expected: self.0.info.keys.len(), + got: key_parts.num_encodable_values(), + }) + } else { + self.key(key_parts) + } + } + + /// This constructs a key suitable for iterating at the given storage address. This will error + /// if we can see that too many key parts are provided. + pub fn iter_key>( + &self, + key_parts: Keys, + ) -> Result, StorageError> { + if Addr::IsPlain::is_yes() { + Err(StorageError::CannotIterPlainEntry { + pallet_name: self.0.address.pallet_name().into(), + entry_name: self.0.address.entry_name().into(), + }) + } else if key_parts.num_encodable_values() >= self.0.info.keys.len() { + Err(StorageError::WrongNumberOfKeyPartsProvidedForIterating { + max_expected: self.0.info.keys.len() - 1, + got: key_parts.num_encodable_values(), + }) + } else { + self.key(key_parts) + } + } +} diff --git a/core/src/storage/storage_key.rs b/core/src/storage/storage_key.rs index bac737c66ff..1880bef6184 100644 --- a/core/src/storage/storage_key.rs +++ b/core/src/storage/storage_key.rs @@ -1,471 +1,138 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. +// Copyright 2019-2025 Parity Technologies (UK) Ltd. // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use super::utils::hash_bytes; -use crate::error::{Error, MetadataError, StorageAddressError}; -use alloc::vec; -use alloc::vec::Vec; -use scale_decode::{DecodeAsType, visitor::IgnoreVisitor}; -use scale_encode::EncodeAsType; -use scale_info::{PortableRegistry, TypeDef}; -use scale_value::Value; -use subxt_metadata::{StorageEntryType, StorageHasher}; - -/// A collection of storage hashers paired with the type ids of the types they should hash. -/// Can be created for each storage entry in the metadata via [`StorageHashers::new()`]. -#[derive(Debug)] -pub struct StorageHashers { - hashers_and_ty_ids: Vec<(StorageHasher, u32)>, -} - -impl StorageHashers { - /// Creates new [`StorageHashers`] from a storage entry. Looks at the [`StorageEntryType`] and - /// assigns a hasher to each type id that makes up the key. - pub fn new(storage_entry: &StorageEntryType, types: &PortableRegistry) -> Result { - let mut hashers_and_ty_ids = vec![]; - if let StorageEntryType::Map { - hashers, key_ty, .. - } = storage_entry - { - let ty = types - .resolve(*key_ty) - .ok_or(MetadataError::TypeNotFound(*key_ty))?; - - if hashers.len() == 1 { - // If there's exactly 1 hasher, then we have a plain StorageMap. We can't - // break the key down (even if it's a tuple) because the hasher applies to - // the whole key. - hashers_and_ty_ids = vec![(hashers[0], *key_ty)]; - } else { - // If there are multiple hashers, then we have a StorageDoubleMap or StorageNMap. - // We expect the key type to be tuple, and we will return a MapEntryKey for each - // key in the tuple. - let hasher_count = hashers.len(); - let tuple = match &ty.type_def { - TypeDef::Tuple(tuple) => tuple, - _ => { - return Err(StorageAddressError::WrongNumberOfHashers { - hashers: hasher_count, - fields: 1, - } - .into()); - } - }; - - // We should have the same number of hashers and keys. - let key_count = tuple.fields.len(); - if hasher_count != key_count { - return Err(StorageAddressError::WrongNumberOfHashers { - hashers: hasher_count, - fields: key_count, - } - .into()); - } - - // Collect them together. - hashers_and_ty_ids = tuple - .fields - .iter() - .zip(hashers) - .map(|(field, hasher)| (*hasher, field.id)) - .collect(); - } +use crate::error::StorageKeyError; +use alloc::sync::Arc; +use core::marker::PhantomData; +use frame_decode::storage::{IntoDecodableValues, StorageInfo, StorageKey as StorageKeyPartInfo}; +use scale_info::PortableRegistry; + +pub use frame_decode::storage::StorageHasher; + +/// This represents the different parts of a storage key. +pub struct StorageKey<'info, KeyParts> { + info: Arc>, + types: &'info PortableRegistry, + bytes: Arc<[u8]>, + marker: PhantomData, +} + +impl<'info, KeyParts: IntoDecodableValues> StorageKey<'info, KeyParts> { + pub(crate) fn new( + info: &StorageInfo<'info, u32>, + types: &'info PortableRegistry, + bytes: Arc<[u8]>, + ) -> Result { + let cursor = &mut &*bytes; + let storage_key_info = frame_decode::storage::decode_storage_key_with_info( + cursor, info, types, + ) + .map_err(|e| StorageKeyError::StorageKeyDecodeError { + bytes: bytes.to_vec(), + error: e, + })?; + + if !cursor.is_empty() { + return Err(StorageKeyError::LeftoverBytes { + bytes: cursor.to_vec(), + }); } - Ok(Self { hashers_and_ty_ids }) - } - - /// Creates an iterator over the storage hashers and type ids. - pub fn iter(&self) -> StorageHashersIter<'_> { - StorageHashersIter { - hashers: self, - idx: 0, - } - } -} - -/// An iterator over all type ids of the key and the respective hashers. -/// See [`StorageHashers::iter()`]. -#[derive(Debug)] -pub struct StorageHashersIter<'a> { - hashers: &'a StorageHashers, - idx: usize, -} - -impl StorageHashersIter<'_> { - fn next_or_err(&mut self) -> Result<(StorageHasher, u32), Error> { - self.next().ok_or_else(|| { - StorageAddressError::TooManyKeys { - expected: self.hashers.hashers_and_ty_ids.len(), - } - .into() + Ok(StorageKey { + info: Arc::new(storage_key_info), + types, + bytes, + marker: PhantomData, }) } -} - -impl Iterator for StorageHashersIter<'_> { - type Item = (StorageHasher, u32); - - fn next(&mut self) -> Option { - let item = self.hashers.hashers_and_ty_ids.get(self.idx).copied()?; - self.idx += 1; - Some(item) - } -} - -impl ExactSizeIterator for StorageHashersIter<'_> { - fn len(&self) -> usize { - self.hashers.hashers_and_ty_ids.len() - self.idx - } -} - -/// This trait should be implemented by anything that can be used as one or multiple storage keys. -pub trait StorageKey { - /// Encodes the storage key into some bytes - fn encode_storage_key( - &self, - bytes: &mut Vec, - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result<(), Error>; - - /// Attempts to decode the StorageKey given some bytes and a set of hashers and type IDs that they are meant to represent. - /// The bytes passed to `decode` should start with: - /// - 1. some fixed size hash (for all hashers except `Identity`) - /// - 2. the plain key value itself (for `Identity`, `Blake2_128Concat` and `Twox64Concat` hashers) - fn decode_storage_key( - bytes: &mut &[u8], - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result - where - Self: Sized + 'static; -} - -/// Implement `StorageKey` for `()` which can be used for keyless storage entries, -/// or to otherwise just ignore some entry. -impl StorageKey for () { - fn encode_storage_key( - &self, - _bytes: &mut Vec, - hashers: &mut StorageHashersIter, - _types: &PortableRegistry, - ) -> Result<(), Error> { - _ = hashers.next_or_err(); - Ok(()) - } - - fn decode_storage_key( - bytes: &mut &[u8], - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result { - let (hasher, ty_id) = match hashers.next_or_err() { - Ok((hasher, ty_id)) => (hasher, ty_id), - Err(_) if bytes.is_empty() => return Ok(()), - Err(err) => return Err(err), - }; - consume_hash_returning_key_bytes(bytes, hasher, ty_id, types)?; - Ok(()) - } -} - -/// A storage key used as part of the static codegen. -#[derive(Clone, Debug, PartialOrd, PartialEq, Eq)] -pub struct StaticStorageKey { - key: K, -} - -impl StaticStorageKey { - /// Creates a new static storage key. - pub fn new(key: K) -> Self { - StaticStorageKey { key } - } -} - -impl StaticStorageKey { - /// Returns the decoded storage key. - pub fn into_key(self) -> K { - self.key - } -} - -impl StorageKey for StaticStorageKey { - fn encode_storage_key( - &self, - bytes: &mut Vec, - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result<(), Error> { - let (hasher, ty_id) = hashers.next_or_err()?; - let encoded_value = self.key.encode_as_type(ty_id, types)?; - hash_bytes(&encoded_value, hasher, bytes); - Ok(()) - } - - fn decode_storage_key( - bytes: &mut &[u8], - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result - where - Self: Sized + 'static, - { - let (hasher, ty_id) = hashers.next_or_err()?; - let key_bytes = consume_hash_returning_key_bytes(bytes, hasher, ty_id, types)?; - // if the hasher had no key appended, we can't decode it into a `StaticStorageKey`. - let Some(key_bytes) = key_bytes else { - return Err(StorageAddressError::HasherCannotReconstructKey { ty_id, hasher }.into()); - }; + /// Attempt to decode the values contained within this storage key. The target type is + /// given by the storage address used to access this entry. To decode into a custom type, + /// use [`Self::parts()`] or [`Self::part()`] and decode each part. + pub fn decode(&self) -> Result { + let values = + frame_decode::storage::decode_storage_key_values(&self.bytes, &self.info, self.types) + .map_err(StorageKeyError::CannotDecodeValuesInKey)?; - // Decode and return the key. - let key = K::decode_as_type(&mut &*key_bytes, ty_id, types)?; - let key = StaticStorageKey { key }; - Ok(key) + Ok(values) } -} -impl StorageKey for Vec { - fn encode_storage_key( - &self, - bytes: &mut Vec, - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result<(), Error> { - for value in self.iter() { - let (hasher, ty_id) = hashers.next_or_err()?; - let encoded_value = value.encode_as_type(ty_id, types)?; - hash_bytes(&encoded_value, hasher, bytes); - } - Ok(()) + /// Iterate over the parts of this storage key. Each part of a storage key corresponds to a + /// single value that has been hashed. + pub fn parts(&self) -> impl ExactSizeIterator> { + let parts_len = self.info.parts().len(); + (0..parts_len).map(move |index| StorageKeyPart { + index, + info: self.info.clone(), + types: self.types, + bytes: self.bytes.clone(), + }) } - fn decode_storage_key( - bytes: &mut &[u8], - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result - where - Self: Sized + 'static, - { - let mut result: Vec = vec![]; - for (hasher, ty_id) in hashers.by_ref() { - match consume_hash_returning_key_bytes(bytes, hasher, ty_id, types)? { - Some(value_bytes) => { - let value = - scale_value::scale::decode_as_type(&mut &*value_bytes, ty_id, types)?; - - result.push(value.remove_context()); - } - None => { - result.push(Value::unnamed_composite([])); - } - } + /// Return the part of the storage key at the provided index, or `None` if the index is out of bounds. + pub fn part(&self, index: usize) -> Option> { + if index < self.parts().len() { + Some(StorageKeyPart { + index, + info: self.info.clone(), + types: self.types, + bytes: self.bytes.clone(), + }) + } else { + None } - - // We've consumed all of the hashers, so we expect to also consume all of the bytes: - if !bytes.is_empty() { - return Err(StorageAddressError::TooManyBytes.into()); - } - - Ok(result) } } -// Skip over the hash bytes (including any key at the end), returning bytes -// representing the key if one exists, or None if the hasher has no key appended. -fn consume_hash_returning_key_bytes<'a>( - bytes: &mut &'a [u8], - hasher: StorageHasher, - ty_id: u32, - types: &PortableRegistry, -) -> Result, Error> { - // Strip the bytes off for the actual hash, consuming them. - let bytes_to_strip = hasher.len_excluding_key(); - if bytes.len() < bytes_to_strip { - return Err(StorageAddressError::NotEnoughBytes.into()); - } - *bytes = &bytes[bytes_to_strip..]; - - // Now, find the bytes representing the key, consuming them. - let before_key = *bytes; - if hasher.ends_with_key() { - scale_decode::visitor::decode_with_visitor( - bytes, - ty_id, - types, - IgnoreVisitor::::new(), - ) - .map_err(|err| Error::Decode(err.into()))?; - // Return the key bytes, having advanced the input cursor past them. - let key_bytes = &before_key[..before_key.len() - bytes.len()]; - - Ok(Some(key_bytes)) - } else { - // There are no key bytes, so return None. - Ok(None) - } -} - -/// Generates StorageKey implementations for tuples -macro_rules! impl_tuples { - ($($ty:ident $n:tt),+) => {{ - impl<$($ty: StorageKey),+> StorageKey for ($( $ty ),+) { - fn encode_storage_key( - &self, - bytes: &mut Vec, - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result<(), Error> { - $( self.$n.encode_storage_key(bytes, hashers, types)?; )+ - Ok(()) - } - - fn decode_storage_key( - bytes: &mut &[u8], - hashers: &mut StorageHashersIter, - types: &PortableRegistry, - ) -> Result - where - Self: Sized + 'static, - { - Ok( ( $( $ty::decode_storage_key(bytes, hashers, types)?, )+ ) ) - } - } - }}; +/// This represents a part of a storage key. +pub struct StorageKeyPart<'info> { + index: usize, + info: Arc>, + types: &'info PortableRegistry, + bytes: Arc<[u8]>, } -#[rustfmt::skip] -const _: () = { - impl_tuples!(A 0, B 1); - impl_tuples!(A 0, B 1, C 2); - impl_tuples!(A 0, B 1, C 2, D 3); - impl_tuples!(A 0, B 1, C 2, D 3, E 4); - impl_tuples!(A 0, B 1, C 2, D 3, E 4, F 5); - impl_tuples!(A 0, B 1, C 2, D 3, E 4, F 5, G 6); - impl_tuples!(A 0, B 1, C 2, D 3, E 4, F 5, G 6, H 7); -}; - -#[cfg(test)] -mod tests { - - use codec::Encode; - use scale_info::{PortableRegistry, Registry, TypeInfo, meta_type}; - use subxt_metadata::StorageHasher; - - use crate::utils::Era; - - use alloc::string::String; - use alloc::vec; - use alloc::vec::Vec; - - use super::{StaticStorageKey, StorageKey}; - - struct KeyBuilder { - registry: Registry, - bytes: Vec, - hashers_and_ty_ids: Vec<(StorageHasher, u32)>, +impl<'info> StorageKeyPart<'info> { + /// Get the raw bytes for this part of the storage key. + pub fn bytes(&self) -> &[u8] { + let part = &self.info[self.index]; + let hash_range = part.hash_range(); + let value_range = part.value().map(|v| v.range()).unwrap_or(core::ops::Range { + start: hash_range.end, + end: hash_range.end, + }); + let combined_range = core::ops::Range { + start: hash_range.start, + end: value_range.end, + }; + &self.bytes[combined_range] } - impl KeyBuilder { - fn new() -> KeyBuilder { - KeyBuilder { - registry: Registry::new(), - bytes: vec![], - hashers_and_ty_ids: vec![], - } - } - - fn add(mut self, value: T, hasher: StorageHasher) -> Self { - let id = self.registry.register_type(&meta_type::()).id; - - self.hashers_and_ty_ids.push((hasher, id)); - for _i in 0..hasher.len_excluding_key() { - self.bytes.push(0); - } - value.encode_to(&mut self.bytes); - self - } - - fn build(self) -> (PortableRegistry, Vec, Vec<(StorageHasher, u32)>) { - (self.registry.into(), self.bytes, self.hashers_and_ty_ids) - } + /// Get the hasher that was used to construct this part of the storage key. + pub fn hasher(&self) -> StorageHasher { + self.info[self.index].hasher() } - #[test] - fn storage_key_decoding_fuzz() { - let hashers = [ - StorageHasher::Blake2_128, - StorageHasher::Blake2_128Concat, - StorageHasher::Blake2_256, - StorageHasher::Identity, - StorageHasher::Twox128, - StorageHasher::Twox256, - StorageHasher::Twox64Concat, - ]; - - let key_preserving_hashers = [ - StorageHasher::Blake2_128Concat, - StorageHasher::Identity, - StorageHasher::Twox64Concat, - ]; - - type T4A = ( - (), - StaticStorageKey, - StaticStorageKey, - StaticStorageKey, - ); - type T4B = ( - (), - (StaticStorageKey, StaticStorageKey), - StaticStorageKey, - ); - type T4C = ( - ((), StaticStorageKey), - (StaticStorageKey, StaticStorageKey), - ); - - let era = Era::Immortal; - for h0 in hashers { - for h1 in key_preserving_hashers { - for h2 in key_preserving_hashers { - for h3 in key_preserving_hashers { - let (types, bytes, hashers_and_ty_ids) = KeyBuilder::new() - .add((), h0) - .add(13u32, h1) - .add("Hello", h2) - .add(era, h3) - .build(); - - let hashers = super::StorageHashers { hashers_and_ty_ids }; - let keys_a = - T4A::decode_storage_key(&mut &bytes[..], &mut hashers.iter(), &types) - .unwrap(); - - let keys_b = - T4B::decode_storage_key(&mut &bytes[..], &mut hashers.iter(), &types) - .unwrap(); + /// For keys that were produced using "concat" or "identity" hashers, the value + /// is available as a part of the key hash, allowing us to decode it into anything + /// implementing [`scale_decode::DecodeAsType`]. If the key was produced using a + /// different hasher, this will return `None`. + pub fn decode_as(&self) -> Result, StorageKeyError> { + let part_info = &self.info[self.index]; + let Some(value_info) = part_info.value() else { + return Ok(None); + }; - let keys_c = - T4C::decode_storage_key(&mut &bytes[..], &mut hashers.iter(), &types) - .unwrap(); + let value_bytes = &self.bytes[value_info.range()]; + let value_ty = *value_info.ty(); - assert_eq!(keys_a.1.into_key(), 13); - assert_eq!(keys_b.1.0.into_key(), 13); - assert_eq!(keys_c.0.1.into_key(), 13); + let decoded_key_part = T::decode_as_type(&mut &*value_bytes, value_ty, self.types) + .map_err(|e| StorageKeyError::CannotDecodeValueInKey { + index: self.index, + error: e, + })?; - assert_eq!(keys_a.2.into_key(), "Hello"); - assert_eq!(keys_b.1.1.into_key(), "Hello"); - assert_eq!(keys_c.1.0.into_key(), "Hello"); - assert_eq!(keys_a.3.into_key(), era); - assert_eq!(keys_b.2.into_key(), era); - assert_eq!(keys_c.1.1.into_key(), era); - } - } - } - } + Ok(Some(decoded_key_part)) } } diff --git a/core/src/storage/storage_key_value.rs b/core/src/storage/storage_key_value.rs new file mode 100644 index 00000000000..74d81b1f1f3 --- /dev/null +++ b/core/src/storage/storage_key_value.rs @@ -0,0 +1,49 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use super::{Address, StorageKey, StorageValue}; +use crate::error::StorageKeyError; +use alloc::sync::Arc; +use alloc::vec::Vec; +use frame_decode::storage::StorageInfo; +use scale_info::PortableRegistry; + +/// This represents a storage key/value pair, which is typically returned from +/// iterating over values in some storage map. +#[derive(Debug)] +pub struct StorageKeyValue<'info, Addr: Address> { + key: Arc<[u8]>, + // This contains the storage information already: + value: StorageValue<'info, Addr::Value>, +} + +impl<'info, Addr: Address> StorageKeyValue<'info, Addr> { + pub(crate) fn new( + info: Arc>, + types: &'info PortableRegistry, + key_bytes: Arc<[u8]>, + value_bytes: Vec, + ) -> Self { + StorageKeyValue { + key: key_bytes, + value: StorageValue::new(info, types, value_bytes), + } + } + + /// Get the raw bytes for this storage entry's key. + pub fn key_bytes(&self) -> &[u8] { + &self.key + } + + /// Decode the key for this storage entry. This gives back a type from which we can + /// decode specific parts of the key hash (where applicable). + pub fn key(&'_ self) -> Result, StorageKeyError> { + StorageKey::new(&self.value.info, self.value.types, self.key.clone()) + } + + /// Return the storage value. + pub fn value(&self) -> &StorageValue<'info, Addr::Value> { + &self.value + } +} diff --git a/core/src/storage/storage_value.rs b/core/src/storage/storage_value.rs new file mode 100644 index 00000000000..8cd50238a7d --- /dev/null +++ b/core/src/storage/storage_value.rs @@ -0,0 +1,71 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use crate::error::StorageValueError; +use alloc::sync::Arc; +use alloc::vec::Vec; +use core::marker::PhantomData; +use frame_decode::storage::StorageInfo; +use scale_decode::DecodeAsType; +use scale_info::PortableRegistry; + +/// This represents a storage value. +#[derive(Debug)] +pub struct StorageValue<'info, Value> { + pub(crate) info: Arc>, + pub(crate) types: &'info PortableRegistry, + bytes: Vec, + marker: PhantomData, +} + +impl<'info, Value: DecodeAsType> StorageValue<'info, Value> { + pub(crate) fn new( + info: Arc>, + types: &'info PortableRegistry, + bytes: Vec, + ) -> StorageValue<'info, Value> { + StorageValue { + info, + types, + bytes, + marker: PhantomData, + } + } + + /// Get the raw bytes for this storage value. + pub fn bytes(&self) -> &[u8] { + &self.bytes + } + + /// Consume this storage value and return the raw bytes. + pub fn into_bytes(self) -> Vec { + self.bytes.to_vec() + } + + /// Decode this storage value into the provided response type. + pub fn decode(&self) -> Result { + self.decode_as::() + } + + /// Decode this storage value into an arbitrary type. + pub fn decode_as(&self) -> Result { + let cursor = &mut &*self.bytes; + + let value = frame_decode::storage::decode_storage_value_with_info( + cursor, + &self.info, + self.types, + T::into_visitor(), + ) + .map_err(StorageValueError::CannotDecode)?; + + if !cursor.is_empty() { + return Err(StorageValueError::LeftoverBytes { + bytes: cursor.to_vec(), + }); + } + + Ok(value) + } +} diff --git a/core/src/storage/utils.rs b/core/src/storage/utils.rs deleted file mode 100644 index dc5d10ace44..00000000000 --- a/core/src/storage/utils.rs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2019-2024 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! these utility methods complement the [`Address`] trait, but -//! aren't things that should ever be overridden, and so don't exist on -//! the trait itself. - -use super::address::Address; -use crate::error::{Error, MetadataError}; -use crate::metadata::Metadata; -use alloc::borrow::ToOwned; -use alloc::vec::Vec; -use subxt_metadata::{PalletMetadata, StorageEntryMetadata, StorageHasher}; - -/// Return the root of a given [`Address`]: hash the pallet name and entry name -/// and append those bytes to the output. -pub fn write_storage_address_root_bytes(addr: &Addr, out: &mut Vec) { - out.extend(sp_crypto_hashing::twox_128(addr.pallet_name().as_bytes())); - out.extend(sp_crypto_hashing::twox_128(addr.entry_name().as_bytes())); -} - -/// Take some SCALE encoded bytes and a [`StorageHasher`] and hash the bytes accordingly. -pub fn hash_bytes(input: &[u8], hasher: StorageHasher, bytes: &mut Vec) { - match hasher { - StorageHasher::Identity => bytes.extend(input), - StorageHasher::Blake2_128 => bytes.extend(sp_crypto_hashing::blake2_128(input)), - StorageHasher::Blake2_128Concat => { - bytes.extend(sp_crypto_hashing::blake2_128(input)); - bytes.extend(input); - } - StorageHasher::Blake2_256 => bytes.extend(sp_crypto_hashing::blake2_256(input)), - StorageHasher::Twox128 => bytes.extend(sp_crypto_hashing::twox_128(input)), - StorageHasher::Twox256 => bytes.extend(sp_crypto_hashing::twox_256(input)), - StorageHasher::Twox64Concat => { - bytes.extend(sp_crypto_hashing::twox_64(input)); - bytes.extend(input); - } - } -} - -/// Return details about the given storage entry. -pub fn lookup_storage_entry_details<'a>( - pallet_name: &str, - entry_name: &str, - metadata: &'a Metadata, -) -> Result<(PalletMetadata<'a>, &'a StorageEntryMetadata), Error> { - let pallet_metadata = metadata.pallet_by_name_err(pallet_name)?; - let storage_metadata = pallet_metadata - .storage() - .ok_or_else(|| MetadataError::StorageNotFoundInPallet(pallet_name.to_owned()))?; - let storage_entry = storage_metadata - .entry_by_name(entry_name) - .ok_or_else(|| MetadataError::StorageEntryNotFound(entry_name.to_owned()))?; - Ok((pallet_metadata, storage_entry)) -} diff --git a/core/src/tx/mod.rs b/core/src/tx/mod.rs index 5a1c590deb8..3eb6a29617b 100644 --- a/core/src/tx/mod.rs +++ b/core/src/tx/mod.rs @@ -13,7 +13,7 @@ //! use subxt_core::config::DefaultExtrinsicParamsBuilder as Params; //! use subxt_core::tx; //! use subxt_core::utils::H256; -//! use subxt_core::metadata; +//! use subxt_core::Metadata; //! //! // If we generate types without `subxt`, we need to point to `::subxt_core`: //! #[subxt( @@ -26,7 +26,7 @@ //! let state = tx::ClientState:: { //! metadata: { //! let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale"); -//! metadata::decode_from(&metadata_bytes[..]).unwrap() +//! Metadata::decode_from(&metadata_bytes[..]).unwrap() //! }, //! genesis_hash: { //! let h = "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"; @@ -59,11 +59,12 @@ pub mod payload; pub mod signer; +use crate::Metadata; use crate::config::{Config, ExtrinsicParams, ExtrinsicParamsEncoder, HashFor, Hasher}; -use crate::error::{Error, ExtrinsicError, MetadataError}; -use crate::metadata::Metadata; +use crate::error::ExtrinsicError; use crate::utils::Encoded; -use alloc::borrow::{Cow, ToOwned}; +use alloc::borrow::Cow; +use alloc::string::ToString; use alloc::vec::Vec; use codec::{Compact, Encode}; use payload::Payload; @@ -77,18 +78,28 @@ pub use crate::client::{ClientState, RuntimeVersion}; /// if the call is valid (or if it's not possible to check since the call has no validation hash). /// Return an error if the call was not valid or something went wrong trying to validate it (ie /// the pallet or call in question do not exist at all). -pub fn validate(call: &Call, metadata: &Metadata) -> Result<(), Error> { - if let Some(details) = call.validation_details() { - let expected_hash = metadata - .pallet_by_name_err(details.pallet_name)? - .call_hash(details.call_name) - .ok_or_else(|| MetadataError::CallNameNotFound(details.call_name.to_owned()))?; - - if details.hash != expected_hash { - return Err(MetadataError::IncompatibleCodegen.into()); - } +pub fn validate(call: &Call, metadata: &Metadata) -> Result<(), ExtrinsicError> { + let Some(details) = call.validation_details() else { + return Ok(()); + }; + + let pallet_name = details.pallet_name; + let call_name = details.call_name; + + let expected_hash = metadata + .pallet_by_name(pallet_name) + .ok_or_else(|| ExtrinsicError::PalletNameNotFound(pallet_name.to_string()))? + .call_hash(call_name) + .ok_or_else(|| ExtrinsicError::CallNameNotFound { + pallet_name: pallet_name.to_string(), + call_name: call_name.to_string(), + })?; + + if details.hash != expected_hash { + Err(ExtrinsicError::IncompatibleCodegen) + } else { + Ok(()) } - Ok(()) } /// Returns the suggested transaction versions to build for a given chain, or an error @@ -96,7 +107,7 @@ pub fn validate(call: &Call, metadata: &Metadata) -> Result<(), E /// /// If the result is [`TransactionVersion::V4`], use the `v4` methods in this module. If it's /// [`TransactionVersion::V5`], use the `v5` ones. -pub fn suggested_version(metadata: &Metadata) -> Result { +pub fn suggested_version(metadata: &Metadata) -> Result { let versions = metadata.extrinsic().supported_versions(); if versions.contains(&4) { @@ -104,7 +115,7 @@ pub fn suggested_version(metadata: &Metadata) -> Result(call: &Call, metadata: &Metadata) -> Result, Error> { +pub fn call_data( + call: &Call, + metadata: &Metadata, +) -> Result, ExtrinsicError> { let mut bytes = Vec::new(); call.encode_call_data_to(metadata, &mut bytes)?; Ok(bytes) @@ -128,7 +142,7 @@ pub fn call_data(call: &Call, metadata: &Metadata) -> Result( call: &Call, metadata: &Metadata, -) -> Result, Error> { +) -> Result, ExtrinsicError> { create_unsigned_at_version(call, 4, metadata) } @@ -136,7 +150,7 @@ pub fn create_v4_unsigned( pub fn create_v5_bare( call: &Call, metadata: &Metadata, -) -> Result, Error> { +) -> Result, ExtrinsicError> { create_unsigned_at_version(call, 5, metadata) } @@ -145,7 +159,7 @@ fn create_unsigned_at_version( call: &Call, tx_version: u8, metadata: &Metadata, -) -> Result, Error> { +) -> Result, ExtrinsicError> { // 1. Validate this call against the current node metadata if the call comes // with a hash allowing us to do so. validate(call, metadata)?; @@ -176,7 +190,7 @@ pub fn create_v4_signed( call: &Call, client_state: &ClientState, params: >::Params, -) -> Result, Error> { +) -> Result, ExtrinsicError> { // 1. Validate this call against the current node metadata if the call comes // with a hash allowing us to do so. validate(call, &client_state.metadata)?; @@ -200,7 +214,7 @@ pub fn create_v5_general( call: &Call, client_state: &ClientState, params: >::Params, -) -> Result, Error> { +) -> Result, ExtrinsicError> { // 1. Validate this call against the current node metadata if the call comes // with a hash allowing us to do so. validate(call, &client_state.metadata)?; diff --git a/core/src/tx/payload.rs b/core/src/tx/payload.rs index a3842cf03b4..e87c38a98f1 100644 --- a/core/src/tx/payload.rs +++ b/core/src/tx/payload.rs @@ -5,12 +5,11 @@ //! This module contains the trait and types used to represent //! transactions that can be submitted. -use crate::Error; -use crate::error::MetadataError; -use crate::metadata::Metadata; -use alloc::borrow::{Cow, ToOwned}; +use crate::Metadata; +use crate::error::ExtrinsicError; +use alloc::borrow::Cow; use alloc::boxed::Box; -use alloc::string::String; +use alloc::string::{String, ToString}; use alloc::vec::Vec; use codec::Encode; @@ -21,11 +20,15 @@ use scale_value::{Composite, Value, ValueDef, Variant}; /// to a node. pub trait Payload { /// Encode call data to the provided output. - fn encode_call_data_to(&self, metadata: &Metadata, out: &mut Vec) -> Result<(), Error>; + fn encode_call_data_to( + &self, + metadata: &Metadata, + out: &mut Vec, + ) -> Result<(), ExtrinsicError>; /// Encode call data and return the output. This is a convenience /// wrapper around [`Payload::encode_call_data_to`]. - fn encode_call_data(&self, metadata: &Metadata) -> Result, Error> { + fn encode_call_data(&self, metadata: &Metadata) -> Result, ExtrinsicError> { let mut v = Vec::new(); self.encode_call_data_to(metadata, &mut v)?; Ok(v) @@ -46,10 +49,10 @@ macro_rules! boxed_payload { &self, metadata: &Metadata, out: &mut Vec, - ) -> Result<(), Error> { + ) -> Result<(), ExtrinsicError> { self.as_ref().encode_call_data_to(metadata, out) } - fn encode_call_data(&self, metadata: &Metadata) -> Result, Error> { + fn encode_call_data(&self, metadata: &Metadata) -> Result, ExtrinsicError> { self.as_ref().encode_call_data(metadata) } fn validation_details(&self) -> Option> { @@ -164,13 +167,22 @@ impl DefaultPayload> { } impl Payload for DefaultPayload { - fn encode_call_data_to(&self, metadata: &Metadata, out: &mut Vec) -> Result<(), Error> { - let pallet = metadata.pallet_by_name_err(&self.pallet_name)?; + fn encode_call_data_to( + &self, + metadata: &Metadata, + out: &mut Vec, + ) -> Result<(), ExtrinsicError> { + let pallet = metadata + .pallet_by_name(&self.pallet_name) + .ok_or_else(|| ExtrinsicError::PalletNameNotFound(self.pallet_name.to_string()))?; let call = pallet .call_variant_by_name(&self.call_name) - .ok_or_else(|| MetadataError::CallNameNotFound((*self.call_name).to_owned()))?; + .ok_or_else(|| ExtrinsicError::CallNameNotFound { + pallet_name: pallet.name().to_string(), + call_name: self.call_name.to_string(), + })?; - let pallet_index = pallet.index(); + let pallet_index = pallet.call_index(); let call_index = call.index; pallet_index.encode_to(out); @@ -182,7 +194,8 @@ impl Payload for DefaultPayload { .map(|f| scale_encode::Field::new(f.ty.id, f.name.as_deref())); self.call_data - .encode_as_fields_to(&mut fields, metadata.types(), out)?; + .encode_as_fields_to(&mut fields, metadata.types(), out) + .map_err(ExtrinsicError::CannotEncodeCallData)?; Ok(()) } @@ -208,7 +221,7 @@ pub fn dynamic( #[cfg(test)] mod tests { use super::*; - use crate::metadata::Metadata; + use crate::Metadata; use codec::Decode; use scale_value::Composite; diff --git a/core/src/utils/mod.rs b/core/src/utils/mod.rs index 42c499f85c4..e739f9f6c0f 100644 --- a/core/src/utils/mod.rs +++ b/core/src/utils/mod.rs @@ -13,6 +13,7 @@ mod multi_signature; mod static_type; mod unchecked_extrinsic; mod wrapper_opaque; +mod yesnomaybe; use alloc::borrow::ToOwned; use alloc::format; @@ -30,6 +31,7 @@ pub use primitive_types::{H160, H256, H512}; pub use static_type::Static; pub use unchecked_extrinsic::UncheckedExtrinsic; pub use wrapper_opaque::WrapperKeepOpaque; +pub use yesnomaybe::{Maybe, No, NoMaybe, Yes, YesMaybe, YesNo}; /// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of /// the transaction payload @@ -73,9 +75,6 @@ unsafe impl Sync for PhantomDataSendSync {} /// as `BTreeMap` which allows us to easily swap the two during codegen. pub type KeyedVec = Vec<(K, V)>; -/// A unit marker struct. -pub struct Yes; - /// A quick helper to encode some bytes to hex. pub fn to_hex(bytes: impl AsRef<[u8]>) -> String { format!("0x{}", hex::encode(bytes.as_ref())) diff --git a/core/src/utils/yesnomaybe.rs b/core/src/utils/yesnomaybe.rs new file mode 100644 index 00000000000..18a878d9423 --- /dev/null +++ b/core/src/utils/yesnomaybe.rs @@ -0,0 +1,82 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +/// A unit marker enum. +pub enum Yes {} +/// A unit marker enum. +pub enum Maybe {} +/// A unit marker enum. +pub enum No {} + +/// This is implemented for [`Yes`] and [`No`] and +/// allows us to check at runtime which of these types is present. +pub trait YesNo { + /// [`Yes`] + fn is_yes() -> bool { + false + } + /// [`No`] + fn is_no() -> bool { + false + } +} + +impl YesNo for Yes { + fn is_yes() -> bool { + true + } +} +impl YesNo for No { + fn is_no() -> bool { + true + } +} + +/// This is implemented for [`Yes`] and [`Maybe`] and +/// allows us to check at runtime which of these types is present. +pub trait YesMaybe { + /// [`Yes`] + fn is_yes() -> bool { + false + } + /// [`Maybe`] + fn is_maybe() -> bool { + false + } +} + +impl YesMaybe for Yes { + fn is_yes() -> bool { + true + } +} +impl YesMaybe for Maybe { + fn is_maybe() -> bool { + true + } +} + +/// This is implemented for [`No`] and [`Maybe`] and +/// allows us to check at runtime which of these types is present. +pub trait NoMaybe { + /// [`No`] + fn is_no() -> bool { + false + } + /// [`Maybe`] + fn is_maybe() -> bool { + false + } +} + +impl NoMaybe for No { + fn is_no() -> bool { + true + } +} +impl NoMaybe for Maybe { + fn is_maybe() -> bool { + true + } +} diff --git a/core/src/view_functions/mod.rs b/core/src/view_functions/mod.rs index 3d422804fba..9238331320f 100644 --- a/core/src/view_functions/mod.rs +++ b/core/src/view_functions/mod.rs @@ -7,28 +7,39 @@ pub mod payload; -use crate::error::{Error, MetadataError}; -use crate::metadata::{DecodeWithMetadata, Metadata}; +use crate::Metadata; +use crate::error::ViewFunctionError; +use alloc::string::ToString; use alloc::vec::Vec; use payload::Payload; +use scale_decode::IntoVisitor; /// Run the validation logic against some View Function payload you'd like to use. Returns `Ok(())` /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). /// Return an error if the payload was not valid or something went wrong trying to validate it (ie /// the View Function in question do not exist at all) -pub fn validate(payload: &P, metadata: &Metadata) -> Result<(), Error> { - let Some(static_hash) = payload.validation_hash() else { +pub fn validate(payload: P, metadata: &Metadata) -> Result<(), ViewFunctionError> { + let Some(hash) = payload.validation_hash() else { return Ok(()); }; + let pallet_name = payload.pallet_name(); + let function_name = payload.function_name(); + let view_function = metadata - .view_function_by_query_id(payload.query_id()) - .ok_or_else(|| MetadataError::ViewFunctionNotFound(*payload.query_id()))?; - if static_hash != view_function.hash() { - return Err(MetadataError::IncompatibleCodegen.into()); - } + .pallet_by_name(pallet_name) + .ok_or_else(|| ViewFunctionError::PalletNotFound(pallet_name.to_string()))? + .view_function_by_name(function_name) + .ok_or_else(|| ViewFunctionError::ViewFunctionNotFound { + pallet_name: pallet_name.to_string(), + function_name: function_name.to_string(), + })?; - Ok(()) + if hash != view_function.hash() { + Err(ViewFunctionError::IncompatibleCodegen) + } else { + Ok(()) + } } /// The name of the Runtime API call which can execute @@ -36,34 +47,37 @@ pub const CALL_NAME: &str = "RuntimeViewFunction_execute_view_function"; /// Encode the bytes that will be passed to the "execute_view_function" Runtime API call, /// to execute the View Function represented by the given payload. -pub fn call_args(payload: &P, metadata: &Metadata) -> Result, Error> { - let mut call_args = Vec::with_capacity(32); - call_args.extend_from_slice(payload.query_id()); - - let mut call_arg_params = Vec::new(); - payload.encode_args_to(metadata, &mut call_arg_params)?; - - use codec::Encode; - call_arg_params.encode_to(&mut call_args); +pub fn call_args( + payload: P, + metadata: &Metadata, +) -> Result, ViewFunctionError> { + let inputs = frame_decode::view_functions::encode_view_function_inputs( + payload.pallet_name(), + payload.function_name(), + payload.args(), + metadata, + metadata.types(), + ) + .map_err(ViewFunctionError::CouldNotEncodeInputs)?; - Ok(call_args) + Ok(inputs) } /// Decode the value bytes at the location given by the provided View Function payload. pub fn decode_value( bytes: &mut &[u8], - payload: &P, + payload: P, metadata: &Metadata, -) -> Result { - let view_function = metadata - .view_function_by_query_id(payload.query_id()) - .ok_or_else(|| MetadataError::ViewFunctionNotFound(*payload.query_id()))?; - - let val = ::decode_with_metadata( - &mut &bytes[..], - view_function.output_ty(), +) -> Result { + let value = frame_decode::view_functions::decode_view_function_response( + payload.pallet_name(), + payload.function_name(), + bytes, metadata, - )?; + metadata.types(), + P::ReturnType::into_visitor(), + ) + .map_err(ViewFunctionError::CouldNotDecodeResponse)?; - Ok(val) + Ok(value) } diff --git a/core/src/view_functions/payload.rs b/core/src/view_functions/payload.rs index a231d519c09..dba753dca2b 100644 --- a/core/src/view_functions/payload.rs +++ b/core/src/view_functions/payload.rs @@ -5,17 +5,12 @@ //! This module contains the trait and types used to represent //! View Function calls that can be made. -use alloc::vec::Vec; +use alloc::borrow::Cow; +use alloc::string::String; use core::marker::PhantomData; use derive_where::derive_where; -use scale_encode::EncodeAsFields; -use scale_value::Composite; - -use crate::Error; -use crate::dynamic::DecodedValueThunk; -use crate::error::MetadataError; - -use crate::metadata::{DecodeWithMetadata, Metadata}; +use frame_decode::view_functions::IntoEncodableValues; +use scale_decode::DecodeAsType; /// This represents a View Function payload that can call into the runtime of node. /// @@ -33,24 +28,19 @@ use crate::metadata::{DecodeWithMetadata, Metadata}; /// /// Each argument of the View Function must be scale-encoded. pub trait Payload { + /// Type of the arguments for this call. + type ArgsType: IntoEncodableValues; /// The return type of the function call. - // Note: `DecodeWithMetadata` is needed to decode the function call result - // with the `subxt::Metadata. - type ReturnType: DecodeWithMetadata; - - /// The payload target. - fn query_id(&self) -> &[u8; 32]; - - /// Scale encode the arguments data. - fn encode_args_to(&self, metadata: &Metadata, out: &mut Vec) -> Result<(), Error>; - - /// Encode arguments data and return the output. This is a convenience - /// wrapper around [`Payload::encode_args_to`]. - fn encode_args(&self, metadata: &Metadata) -> Result, Error> { - let mut v = Vec::new(); - self.encode_args_to(metadata, &mut v)?; - Ok(v) - } + type ReturnType: DecodeAsType; + + /// The View Function pallet name. + fn pallet_name(&self) -> &str; + + /// The View Function function name. + fn function_name(&self) -> &str; + + /// The arguments. + fn args(&self) -> &Self::ArgsType; /// Returns the statically generated validation hash. fn validation_hash(&self) -> Option<[u8; 32]> { @@ -58,45 +48,61 @@ pub trait Payload { } } +// A reference to a payload is a valid payload. +impl Payload for &'_ P { + type ArgsType = P::ArgsType; + type ReturnType = P::ReturnType; + + fn pallet_name(&self) -> &str { + P::pallet_name(*self) + } + + fn function_name(&self) -> &str { + P::function_name(*self) + } + + fn args(&self) -> &Self::ArgsType { + P::args(*self) + } + + fn validation_hash(&self) -> Option<[u8; 32]> { + P::validation_hash(*self) + } +} + /// A View Function payload containing the generic argument data -/// and interpreting the result of the call as `ReturnTy`. +/// and interpreting the result of the call as `ReturnType`. /// /// This can be created from static values (ie those generated /// via the `subxt` macro) or dynamic values via [`dynamic`]. -#[derive_where(Clone, Debug, Eq, Ord, PartialEq, PartialOrd; ArgsData)] -pub struct DefaultPayload { - query_id: [u8; 32], - args_data: ArgsData, +#[derive_where(Clone, Debug, Eq, Ord, PartialEq, PartialOrd; ArgsType)] +pub struct StaticPayload { + pallet_name: Cow<'static, str>, + function_name: Cow<'static, str>, + args: ArgsType, validation_hash: Option<[u8; 32]>, - _marker: PhantomData, + _marker: PhantomData, } -/// A statically generated View Function payload. -pub type StaticPayload = DefaultPayload; /// A dynamic View Function payload. -pub type DynamicPayload = DefaultPayload, DecodedValueThunk>; +pub type DynamicPayload = StaticPayload; -impl Payload - for DefaultPayload +impl Payload + for StaticPayload { - type ReturnType = ReturnTy; + type ArgsType = ArgsType; + type ReturnType = ReturnType; - fn query_id(&self) -> &[u8; 32] { - &self.query_id + fn pallet_name(&self) -> &str { + &self.pallet_name } - fn encode_args_to(&self, metadata: &Metadata, out: &mut Vec) -> Result<(), Error> { - let view_function = metadata - .view_function_by_query_id(&self.query_id) - .ok_or(MetadataError::ViewFunctionNotFound(self.query_id))?; - let mut fields = view_function - .inputs() - .map(|input| scale_encode::Field::named(input.ty, &input.name)); - - self.args_data - .encode_as_fields_to(&mut fields, metadata.types(), out)?; + fn function_name(&self) -> &str { + &self.function_name + } - Ok(()) + fn args(&self) -> &Self::ArgsType { + &self.args } fn validation_hash(&self) -> Option<[u8; 32]> { @@ -104,30 +110,37 @@ impl Payload } } -impl DefaultPayload { - /// Create a new [`DefaultPayload`] for a View Function call. - pub fn new(query_id: [u8; 32], args_data: ArgsData) -> Self { - DefaultPayload { - query_id, - args_data, +impl StaticPayload { + /// Create a new [`StaticPayload`] for a View Function call. + pub fn new( + pallet_name: impl Into, + function_name: impl Into, + args: ArgsType, + ) -> Self { + StaticPayload { + pallet_name: pallet_name.into().into(), + function_name: function_name.into().into(), + args, validation_hash: None, _marker: PhantomData, } } - /// Create a new static [`DefaultPayload`] for a View Function call + /// Create a new static [`StaticPayload`] for a View Function call /// using static function name and scale-encoded argument data. /// /// This is only expected to be used from codegen. #[doc(hidden)] pub fn new_static( - query_id: [u8; 32], - args_data: ArgsData, + pallet_name: &'static str, + function_name: &'static str, + args: ArgsType, hash: [u8; 32], - ) -> DefaultPayload { - DefaultPayload { - query_id, - args_data, + ) -> StaticPayload { + StaticPayload { + pallet_name: Cow::Borrowed(pallet_name), + function_name: Cow::Borrowed(function_name), + args, validation_hash: Some(hash), _marker: core::marker::PhantomData, } @@ -140,14 +153,13 @@ impl DefaultPayload { ..self } } - - /// Returns the arguments data. - pub fn args_data(&self) -> &ArgsData { - &self.args_data - } } /// Create a new [`DynamicPayload`] to call a View Function. -pub fn dynamic(query_id: [u8; 32], args_data: impl Into>) -> DynamicPayload { - DefaultPayload::new(query_id, args_data.into()) +pub fn dynamic( + pallet_name: impl Into, + function_name: impl Into, + args: ArgsType, +) -> DynamicPayload { + DynamicPayload::new(pallet_name, function_name, args) } diff --git a/examples/ffi-example/Cargo.lock b/examples/ffi-example/Cargo.lock index 41b8fb19517..af3fd250d26 100644 --- a/examples/ffi-example/Cargo.lock +++ b/examples/ffi-example/Cargo.lock @@ -475,6 +475,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_format" version = "0.2.34" @@ -660,6 +666,17 @@ dependencies = [ "syn", ] +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "derive-where" version = "1.5.0" @@ -756,21 +773,23 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ + "pkcs8", "signature", ] [[package]] name = "ed25519-zebra" -version = "4.0.3" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" dependencies = [ "curve25519-dalek", "ed25519", - "hashbrown 0.14.5", - "hex", + "hashbrown 0.15.4", + "pkcs8", "rand_core", "sha2 0.10.9", + "subtle", "zeroize", ] @@ -864,9 +883,9 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c470df86cf28818dd3cd2fc4667b80dbefe2236c722c3dc1d09e7c6c82d6dfcd" +checksum = "a0acacffe60911b0d57a55c0b323fc08ccd88659dc52056bb39dfeb5cedafb59" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -1751,6 +1770,15 @@ dependencies = [ "password-hash", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1800,6 +1828,16 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "polling" version = "3.8.0" @@ -2262,9 +2300,9 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca8b26b451ecb7fd7b62b259fa28add63d12ec49bbcac0e01fcb4b5ae0c09aa" +checksum = "884aab179aba344c67ddcd1d7dd8e3f8fee202f2e570d97ec34ec8688442a5b3" dependencies = [ "base58", "blake2", @@ -2527,9 +2565,9 @@ dependencies = [ [[package]] name = "smoldot" -version = "0.19.4" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16e5723359f0048bf64bfdfba64e5732a56847d42c4fd3fe56f18280c813413" +checksum = "724ab10d6485cccb4bab080ce436c0b361295274aec7847d7ba84ab1a79a5132" dependencies = [ "arrayvec 0.7.6", "async-lock", @@ -2581,9 +2619,9 @@ dependencies = [ [[package]] name = "smoldot-light" -version = "0.17.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bba9e591716567d704a8252feeb2f1261a286e1e2cbdd4e49e9197c34a14e2" +checksum = "e8b4d4971f06f2471f4e57a662dbe8047fa0cc020957764a6211f3fad371f7bd" dependencies = [ "async-channel", "async-lock", @@ -2660,6 +2698,16 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" diff --git a/examples/ffi-example/src/lib.rs b/examples/ffi-example/src/lib.rs index 928300c9a7e..8c63a42312b 100644 --- a/examples/ffi-example/src/lib.rs +++ b/examples/ffi-example/src/lib.rs @@ -53,12 +53,13 @@ pub extern "C" fn do_transfer(dest_hex: *const c_char, amount: u64) -> i32 { ); // Submit and wait for finalize - let res: Result<_, subxt::Error> = tokio_rt().block_on(async { + let res: Result<(), subxt::Error> = tokio_rt().block_on(async { let progress = client .tx() .sign_and_submit_then_watch_default(&tx, &signer) .await?; - progress.wait_for_finalized_success().await + progress.wait_for_finalized_success().await?; + Ok(()) }); // Return code diff --git a/examples/parachain-example/Cargo.lock b/examples/parachain-example/Cargo.lock index 28345324389..d133fde63b1 100644 --- a/examples/parachain-example/Cargo.lock +++ b/examples/parachain-example/Cargo.lock @@ -504,6 +504,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_format" version = "0.2.34" @@ -689,6 +695,17 @@ dependencies = [ "syn", ] +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "derive-where" version = "1.2.7" @@ -785,21 +802,23 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ + "pkcs8", "signature", ] [[package]] name = "ed25519-zebra" -version = "4.0.3" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" dependencies = [ "curve25519-dalek", "ed25519", - "hashbrown 0.14.5", - "hex", + "hashbrown 0.15.2", + "pkcs8", "rand_core", "sha2 0.10.8", + "subtle", "zeroize", ] @@ -903,6 +922,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -914,9 +939,9 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c470df86cf28818dd3cd2fc4667b80dbefe2236c722c3dc1d09e7c6c82d6dfcd" +checksum = "a0acacffe60911b0d57a55c0b323fc08ccd88659dc52056bb39dfeb5cedafb59" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -1096,6 +1121,9 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", "serde", ] @@ -1823,6 +1851,15 @@ dependencies = [ "password-hash", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1872,6 +1909,16 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "polling" version = "3.3.2" @@ -2329,9 +2376,9 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca8b26b451ecb7fd7b62b259fa28add63d12ec49bbcac0e01fcb4b5ae0c09aa" +checksum = "884aab179aba344c67ddcd1d7dd8e3f8fee202f2e570d97ec34ec8688442a5b3" dependencies = [ "base58", "blake2", @@ -2598,9 +2645,9 @@ dependencies = [ [[package]] name = "smoldot" -version = "0.19.4" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16e5723359f0048bf64bfdfba64e5732a56847d42c4fd3fe56f18280c813413" +checksum = "724ab10d6485cccb4bab080ce436c0b361295274aec7847d7ba84ab1a79a5132" dependencies = [ "arrayvec 0.7.6", "async-lock 3.3.0", @@ -2652,9 +2699,9 @@ dependencies = [ [[package]] name = "smoldot-light" -version = "0.17.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bba9e591716567d704a8252feeb2f1261a286e1e2cbdd4e49e9197c34a14e2" +checksum = "e8b4d4971f06f2471f4e57a662dbe8047fa0cc020957764a6211f3fad371f7bd" dependencies = [ "async-channel", "async-lock 3.3.0", @@ -2731,6 +2778,16 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2751,9 +2808,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" @@ -3711,9 +3768,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] diff --git a/examples/parachain-example/src/main.rs b/examples/parachain-example/src/main.rs index 71c774bed89..ade5d520904 100644 --- a/examples/parachain-example/src/main.rs +++ b/examples/parachain-example/src/main.rs @@ -63,14 +63,14 @@ async fn run() -> Result<(), Box> { println!("NFT created."); // check in storage, that alice is the official owner of the NFT: - let nft_owner_storage_query = statemint::storage().uniques().asset(COLLECTION_ID, NTF_ID); + let nft_owner_storage_query = statemint::storage().uniques().asset(); let nft_storage_details = api .storage() .at_latest() .await? - .fetch(&nft_owner_storage_query) + .fetch(nft_owner_storage_query, (COLLECTION_ID, NTF_ID)) .await? - .ok_or("The NFT should have an owner (alice)")?; + .decode()?; // make sure that alice is the owner of the NFT: assert_eq!(nft_storage_details.owner, dev::alice().public_key().into()); diff --git a/examples/wasm-example/Cargo.lock b/examples/wasm-example/Cargo.lock index 66d40d1ada9..93db045d7f0 100644 --- a/examples/wasm-example/Cargo.lock +++ b/examples/wasm-example/Cargo.lock @@ -667,9 +667,9 @@ dependencies = [ [[package]] name = "frame-decode" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c470df86cf28818dd3cd2fc4667b80dbefe2236c722c3dc1d09e7c6c82d6dfcd" +checksum = "a0acacffe60911b0d57a55c0b323fc08ccd88659dc52056bb39dfeb5cedafb59" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -2114,9 +2114,9 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca8b26b451ecb7fd7b62b259fa28add63d12ec49bbcac0e01fcb4b5ae0c09aa" +checksum = "884aab179aba344c67ddcd1d7dd8e3f8fee202f2e570d97ec34ec8688442a5b3" dependencies = [ "base58", "blake2", diff --git a/examples/wasm-example/src/services.rs b/examples/wasm-example/src/services.rs index ad9b82298dc..6836ee16cff 100644 --- a/examples/wasm-example/src/services.rs +++ b/examples/wasm-example/src/services.rs @@ -28,7 +28,7 @@ pub(crate) async fn fetch_events_dynamically() -> Result, subxt::Err let event = event?; let pallet = event.pallet_name(); let variant = event.variant_name(); - let field_values = event.field_values()?; + let field_values = event.decode_as_fields::()?; event_strings.push(format!("{pallet}::{variant}: {field_values}")); } Ok(event_strings) @@ -66,7 +66,7 @@ pub(crate) async fn subscribe_to_finalized_blocks( let pallet_name = evt.pallet_name(); let event_name = evt.variant_name(); - let event_values = evt.field_values()?; + let event_values = evt.decode_as_fields::()?; writeln!(output, " {pallet_name}_{event_name}").ok(); writeln!(output, " {}", event_values).ok(); diff --git a/historic/CHANGELOG.md b/historic/CHANGELOG.md new file mode 100644 index 00000000000..5e878f5946b --- /dev/null +++ b/historic/CHANGELOG.md @@ -0,0 +1,11 @@ +# subxt-historic changelog + +This is separate from the Subxt changelog as subxt-historic is currently releasaed separately. + +Eventually this project will merge with Subxt and no longer exist, but until then it's being maintained and updated where needed. + +## 0.0.5 (2025-11-21) + +- Rename some fields for consistency. +- Update versions of underlying libraries being used. +- Add `.visit()` methods to extrinsic fields and storage values, and examples of using this to our examples. diff --git a/historic/Cargo.toml b/historic/Cargo.toml index b458e3cae3c..d0a93ca487f 100644 --- a/historic/Cargo.toml +++ b/historic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subxt-historic" -version = "0.0.4" +version = "0.0.5" authors.workspace = true edition.workspace = true rust-version.workspace = true @@ -45,7 +45,7 @@ jsonrpsee = [ subxt-rpcs = { workspace = true } frame-decode = { workspace = true, features = ["legacy", "legacy-types"] } frame-metadata = { workspace = true, features = ["std", "legacy"] } -scale-type-resolver = { workspace = true } +scale-type-resolver = { workspace = true, features = ["scale-info"] } codec = { workspace = true } primitive-types = { workspace = true } scale-info = { workspace = true } @@ -60,4 +60,4 @@ futures = { workspace = true } tokio = { workspace = true, features = ["full"] } scale-value = { workspace = true } scale-decode = { workspace = true, features = ["derive"] } -hex = { workspace = true } \ No newline at end of file +hex = { workspace = true } diff --git a/historic/examples/extrinsics.rs b/historic/examples/extrinsics.rs index 019b33c6508..13dc2631aa0 100644 --- a/historic/examples/extrinsics.rs +++ b/historic/examples/extrinsics.rs @@ -1,8 +1,8 @@ #![allow(missing_docs)] -use subxt_historic::{Error, OnlineClient, PolkadotConfig}; +use subxt_historic::{OnlineClient, PolkadotConfig}; #[tokio::main] -async fn main() -> Result<(), Error> { +async fn main() -> Result<(), Box> { // Configuration for the Polkadot relay chain. let config = PolkadotConfig::new(); @@ -10,7 +10,7 @@ async fn main() -> Result<(), Error> { let client = OnlineClient::from_url(config, "wss://rpc.polkadot.io").await?; // Iterate through some randomly selected old blocks to show how to fetch and decode extrinsics. - for block_number in 123456.. { + for block_number in 1234567.. { println!("=== Block {block_number} ==="); // Point the client at a specific block number. By default this will download and cache @@ -40,10 +40,26 @@ async fn main() -> Result<(), Error> { // scale_value::Value type, which can represent any SCALE encoded data, but if you // have an idea of the type then you can try to decode into that type instead): for field in extrinsic.call().fields().iter() { + // We can visit fields, which gives us the ability to inspect and decode information + // from them selectively, returning whatever we like from it. Here we demo our + // type name visitor which is defined below: + let tn = field + .visit(type_name::GetTypeName::new())? + .unwrap_or_default(); + + // When visiting fields we can also decode into a custom shape like so: + let _custom_value = field.visit(value::GetValue::new())?; + + // We can also obtain and decode things without the complexity of the above: println!( - " {}: {}", + " {}: {} {}", field.name(), - field.decode::().unwrap() + field.decode_as::().unwrap(), + if tn.is_empty() { + String::new() + } else { + format!("(type name: {tn})") + }, ); } @@ -53,7 +69,7 @@ async fn main() -> Result<(), Error> { extrinsic .call() .fields() - .decode::>() + .decode_as::>() .unwrap() ); @@ -66,14 +82,14 @@ async fn main() -> Result<(), Error> { println!( " {}: {}", extension.name(), - extension.decode::().unwrap() + extension.decode_as::().unwrap() ); } // Or all of them at once: println!( " All: {}", - extensions.decode::>().unwrap() + extensions.decode_as::>().unwrap() ); } } @@ -81,3 +97,354 @@ async fn main() -> Result<(), Error> { Ok(()) } + +/// This module defines an example visitor which retrieves the name of a type. +/// This is a more advanced use case and can typically be avoided. +mod type_name { + use scale_decode::{ + Visitor, + visitor::types::{Composite, Sequence, Variant}, + visitor::{TypeIdFor, Unexpected}, + }; + use scale_type_resolver::TypeResolver; + + /// This is a visitor which obtains type names. + pub struct GetTypeName { + marker: core::marker::PhantomData, + } + + impl GetTypeName { + /// Construct our TypeName visitor. + pub fn new() -> Self { + GetTypeName { + marker: core::marker::PhantomData, + } + } + } + + impl Visitor for GetTypeName { + type Value<'scale, 'resolver> = Option<&'resolver str>; + type Error = scale_decode::Error; + type TypeResolver = R; + + // Look at the path of types that have paths and return the ident from that. + fn visit_composite<'scale, 'resolver>( + self, + value: &mut Composite<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(value.path().last()) + } + fn visit_variant<'scale, 'resolver>( + self, + value: &mut Variant<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(value.path().last()) + } + fn visit_sequence<'scale, 'resolver>( + self, + value: &mut Sequence<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(value.path().last()) + } + + // Else, we return nothing as we can't find a name for the type. + fn visit_unexpected<'scale, 'resolver>( + self, + _unexpected: Unexpected, + ) -> Result, Self::Error> { + Ok(None) + } + } +} + +/// This visitor demonstrates how to decode and return a custom Value shape +mod value { + use scale_decode::{ + Visitor, + visitor::TypeIdFor, + visitor::types::{Array, BitSequence, Composite, Sequence, Str, Tuple, Variant}, + }; + use scale_type_resolver::TypeResolver; + use std::collections::HashMap; + + /// A value type we're decoding into. + #[allow(dead_code)] + pub enum Value { + Number(f64), + BigNumber(String), + Bool(bool), + Char(char), + Array(Vec), + String(String), + Address(Vec), + I256([u8; 32]), + U256([u8; 32]), + Struct(HashMap), + Variant(String, VariantFields), + } + + pub enum VariantFields { + Unnamed(Vec), + Named(HashMap), + } + + /// An error we can encounter trying to decode things into a [`Value`] + #[derive(Debug, thiserror::Error)] + pub enum ValueError { + #[error("Decode error: {0}")] + Decode(#[from] scale_decode::visitor::DecodeError), + #[error("Cannot decode bit sequence: {0}")] + CannotDecodeBitSequence(codec::Error), + } + + /// This is a visitor which obtains type names. + pub struct GetValue { + marker: core::marker::PhantomData, + } + + impl GetValue { + /// Construct our TypeName visitor. + pub fn new() -> Self { + GetValue { + marker: core::marker::PhantomData, + } + } + } + + impl Visitor for GetValue { + type Value<'scale, 'resolver> = Value; + type Error = ValueError; + type TypeResolver = R; + + fn visit_i256<'resolver>( + self, + value: &[u8; 32], + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::I256(*value)) + } + + fn visit_u256<'resolver>( + self, + value: &[u8; 32], + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::U256(*value)) + } + + fn visit_i128<'scale, 'resolver>( + self, + value: i128, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + let attempt = value as f64; + if attempt as i128 == value { + Ok(Value::Number(attempt)) + } else { + Ok(Value::BigNumber(value.to_string())) + } + } + + fn visit_i64<'scale, 'resolver>( + self, + value: i64, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_i128(value.into(), type_id) + } + + fn visit_i32<'scale, 'resolver>( + self, + value: i32, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_i128(value.into(), type_id) + } + + fn visit_i16<'scale, 'resolver>( + self, + value: i16, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_i128(value.into(), type_id) + } + + fn visit_i8<'scale, 'resolver>( + self, + value: i8, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_i128(value.into(), type_id) + } + + fn visit_u128<'scale, 'resolver>( + self, + value: u128, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + let attempt = value as f64; + if attempt as u128 == value { + Ok(Value::Number(attempt)) + } else { + Ok(Value::BigNumber(value.to_string())) + } + } + + fn visit_u64<'scale, 'resolver>( + self, + value: u64, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_u128(value.into(), type_id) + } + + fn visit_u32<'scale, 'resolver>( + self, + value: u32, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_u128(value.into(), type_id) + } + + fn visit_u16<'scale, 'resolver>( + self, + value: u16, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_u128(value.into(), type_id) + } + + fn visit_u8<'scale, 'resolver>( + self, + value: u8, + type_id: TypeIdFor, + ) -> Result, Self::Error> { + self.visit_u128(value.into(), type_id) + } + + fn visit_bool<'scale, 'resolver>( + self, + value: bool, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::Bool(value)) + } + + fn visit_char<'scale, 'resolver>( + self, + value: char, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::Char(value)) + } + + fn visit_array<'scale, 'resolver>( + self, + values: &mut Array<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::Array(to_array(values.remaining(), values)?)) + } + + fn visit_sequence<'scale, 'resolver>( + self, + values: &mut Sequence<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::Array(to_array(values.remaining(), values)?)) + } + + fn visit_str<'scale, 'resolver>( + self, + value: &mut Str<'scale>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::String(value.as_str()?.to_owned())) + } + + fn visit_tuple<'scale, 'resolver>( + self, + values: &mut Tuple<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(Value::Array(to_array(values.remaining(), values)?)) + } + + fn visit_bitsequence<'scale, 'resolver>( + self, + value: &mut BitSequence<'scale>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + let bits = value.decode()?; + let mut out = Vec::with_capacity(bits.len()); + for b in bits { + let b = b.map_err(ValueError::CannotDecodeBitSequence)?; + out.push(Value::Bool(b)); + } + Ok(Value::Array(out)) + } + + fn visit_composite<'scale, 'resolver>( + self, + value: &mut Composite<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + // Special case for ss58 addresses: + if let Some(n) = value.name() + && n == "AccountId32" + && value.bytes_from_start().len() == 32 + { + return Ok(Value::Address(value.bytes_from_start().to_vec())); + } + + // Reuse logic for decoding variant fields: + match to_variant_fieldish(value)? { + VariantFields::Named(s) => Ok(Value::Struct(s)), + VariantFields::Unnamed(a) => Ok(Value::Array(a)), + } + } + + fn visit_variant<'scale, 'resolver>( + self, + value: &mut Variant<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + let name = value.name().to_owned(); + let fields = to_variant_fieldish(value.fields())?; + Ok(Value::Variant(name, fields)) + } + } + + fn to_variant_fieldish<'scale, 'resolver, R: TypeResolver>( + value: &mut Composite<'scale, 'resolver, R>, + ) -> Result { + // If fields are unnamed, treat as array: + if value.fields().iter().all(|f| f.name.is_none()) { + return Ok(VariantFields::Unnamed(to_array(value.remaining(), value)?)); + } + + // Otherwise object: + let mut out = HashMap::new(); + for field in value { + let field = field?; + let name = field.name().unwrap().to_string(); + let value = field.decode_with_visitor(GetValue::new())?; + out.insert(name, value); + } + Ok(VariantFields::Named(out)) + } + + fn to_array<'scale, 'resolver, R: TypeResolver>( + len: usize, + mut values: impl scale_decode::visitor::DecodeItemIterator<'scale, 'resolver, R>, + ) -> Result, ValueError> { + let mut out = Vec::with_capacity(len); + while let Some(value) = values.decode_item(GetValue::new()) { + out.push(value?); + } + Ok(out) + } +} diff --git a/historic/examples/storage.rs b/historic/examples/storage.rs index 2798b73c89b..f61ed9ac02c 100644 --- a/historic/examples/storage.rs +++ b/historic/examples/storage.rs @@ -1,8 +1,8 @@ #![allow(missing_docs)] -use subxt_historic::{Error, OnlineClient, PolkadotConfig, ext::StreamExt}; +use subxt_historic::{OnlineClient, PolkadotConfig, ext::StreamExt}; #[tokio::main] -async fn main() -> Result<(), Error> { +async fn main() -> Result<(), Box> { // Configuration for the Polkadot relay chain. let config = PolkadotConfig::new(); @@ -19,25 +19,28 @@ async fn main() -> Result<(), Error> { let client_at_block = client.at(block_number).await?; // We'll work the account balances at the given block, for this example. - let account_balances = client_at_block - .storage() - .entry("System", "Account")? - .into_map()?; + let account_balances = client_at_block.storage().entry("System", "Account")?; // We can see the default value for this entry at this block, if one exists. - if let Some(default_value) = account_balances.default() { - let default_balance_info = default_value.decode::()?; + if let Some(default_value) = account_balances.default_value() { + let default_balance_info = default_value.decode_as::()?; println!(" Default balance info: {default_balance_info}"); } // We can fetch a specific account balance by its key, like so (here I just picked a random key // I knew to exist from iterating over storage entries): let account_id_hex = "9a4d0faa2ba8c3cc5711852960940793acf55bf195b6eecf88fa78e961d0ce4a"; - let account_id = hex::decode(account_id_hex).unwrap(); + let account_id: [u8; 32] = hex::decode(account_id_hex).unwrap().try_into().unwrap(); if let Some(entry) = account_balances.fetch((account_id,)).await? { // We can decode the value into our generic `scale_value::Value` type, which can // represent any SCALE-encoded value, like so: - let _balance_info = entry.decode::()?; + let _balance_info = entry.decode_as::()?; + + // We can visit the value, which is a more advanced use case and allows us to extract more + // data from the type, here the name of it, if it exists: + let tn = entry + .visit(type_name::GetTypeName::new())? + .unwrap_or(""); // Or, if we know what shape to expect, we can decode the parts of the value that we care // about directly into a static type, which is more efficient and allows easy type-safe @@ -53,10 +56,10 @@ async fn main() -> Result<(), Error> { misc_frozen: u128, fee_frozen: u128, } - let balance_info = entry.decode::()?; + let balance_info = entry.decode_as::()?; println!( - " Single balance info from {account_id_hex} => free: {} reserved: {} misc_frozen: {} fee_frozen: {}", + " Single balance info from {account_id_hex} => free: {} reserved: {} misc_frozen: {} fee_frozen: {} (type name: {tn})", balance_info.data.free, balance_info.data.reserved, balance_info.data.misc_frozen, @@ -72,24 +75,101 @@ async fn main() -> Result<(), Error> { let mut all_balances = account_balances.iter(()).await?.take(10); while let Some(entry) = all_balances.next().await { let entry = entry?; - let key = entry.decode_key()?; + let key = entry.key()?; // Decode the account ID from the key (we know here that we're working // with a map which has one value, an account ID, so we just decode that part: let account_id = key .part(0) .unwrap() - .decode::<[u8; 32]>()? + .decode_as::<[u8; 32]>()? .expect("We expect this key to decode into a 32 byte AccountId"); let account_id_hex = hex::encode(account_id); // Decode these values into our generic scale_value::Value type. Less efficient than // defining a static type as above, but easier for the sake of the example. - let balance_info = entry.decode_value::()?; + let balance_info = entry.value().decode_as::()?; println!(" {account_id_hex} => {balance_info}"); } + + // We can also chain things together to fetch and decode a value in one go. + let _val = client_at_block + .storage() + .entry("System", "Account")? + .fetch((account_id,)) + .await? + .unwrap() + .decode_as::()?; + + let _vals = client_at_block + .storage() + .entry("System", "Account")? + .iter(()) + .await?; } Ok(()) } + +/// This module defines an example visitor which retrieves the name of a type. +/// This is a more advanced use case and can typically be avoided. +mod type_name { + use scale_decode::{ + Visitor, + visitor::types::{Composite, Sequence, Variant}, + visitor::{TypeIdFor, Unexpected}, + }; + use scale_type_resolver::TypeResolver; + + /// This is a visitor which obtains type names. + pub struct GetTypeName { + marker: core::marker::PhantomData, + } + + impl GetTypeName { + /// Construct our TypeName visitor. + pub fn new() -> Self { + GetTypeName { + marker: core::marker::PhantomData, + } + } + } + + impl Visitor for GetTypeName { + type Value<'scale, 'resolver> = Option<&'resolver str>; + type Error = scale_decode::Error; + type TypeResolver = R; + + // Look at the path of types that have paths and return the ident from that. + fn visit_composite<'scale, 'resolver>( + self, + value: &mut Composite<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(value.path().last()) + } + fn visit_variant<'scale, 'resolver>( + self, + value: &mut Variant<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(value.path().last()) + } + fn visit_sequence<'scale, 'resolver>( + self, + value: &mut Sequence<'scale, 'resolver, Self::TypeResolver>, + _type_id: TypeIdFor, + ) -> Result, Self::Error> { + Ok(value.path().last()) + } + + // Else, we return nothing as we can't find a name for the type. + fn visit_unexpected<'scale, 'resolver>( + self, + _unexpected: Unexpected, + ) -> Result, Self::Error> { + Ok(None) + } + } +} diff --git a/historic/src/error.rs b/historic/src/error.rs index 520b52ecf44..d84f534ffbb 100644 --- a/historic/src/error.rs +++ b/historic/src/error.rs @@ -21,10 +21,6 @@ pub enum Error { #[error(transparent)] StorageError(#[from] StorageError), #[error(transparent)] - StorageEntryIsNotAMap(#[from] StorageEntryIsNotAMap), - #[error(transparent)] - StorageEntryIsNotAPlainValue(#[from] StorageEntryIsNotAPlainValue), - #[error(transparent)] StorageKeyError(#[from] StorageKeyError), #[error(transparent)] StorageValueError(#[from] StorageValueError), @@ -214,22 +210,22 @@ pub enum ExtrinsicCallError { #[allow(missing_docs)] #[derive(Debug, thiserror::Error)] -#[error("Storage entry is not a map: pallet {pallet_name}, storage {storage_name}")] +#[error("Storage entry is not a map: pallet {pallet_name}, storage {entry_name}")] pub struct StorageEntryIsNotAMap { /// The pallet containing the storage entry that was not found. pub pallet_name: String, /// The storage entry that was not found. - pub storage_name: String, + pub entry_name: String, } #[allow(missing_docs)] #[derive(Debug, thiserror::Error)] -#[error("Storage entry is not a plain value: pallet {pallet_name}, storage {storage_name}")] +#[error("Storage entry is not a plain value: pallet {pallet_name}, storage {entry_name}")] pub struct StorageEntryIsNotAPlainValue { /// The pallet containing the storage entry that was not found. pub pallet_name: String, /// The storage entry that was not found. - pub storage_name: String, + pub entry_name: String, } #[allow(missing_docs)] @@ -252,14 +248,23 @@ pub enum StorageError { reason: frame_decode::storage::StorageKeyEncodeError, }, #[error( - "Too many keys provided: expected {num_keys_expected} keys, but got {num_keys_provided}" + "Wrong number of keys provided to fetch a value: expected {num_keys_expected} keys, but got {num_keys_provided}" )] - WrongNumberOfKeysProvided { + WrongNumberOfKeysProvidedForFetch { /// The number of keys that were provided. num_keys_provided: usize, /// The number of keys expected. num_keys_expected: usize, }, + #[error( + "too many keys were provided to iterate over a storage entry: expected at most {max_keys_expected} keys, but got {num_keys_provided}" + )] + TooManyKeysProvidedForIter { + /// The number of keys that were provided. + num_keys_provided: usize, + /// The maximum number of keys that we expect. + max_keys_expected: usize, + }, #[error( "Could not extract storage information from metadata: Unsupported metadata version ({version})" )] @@ -295,6 +300,10 @@ pub enum StorageKeyError { index: usize, reason: scale_decode::Error, }, + #[error("Could not decode values out of the storage key: {reason}")] + DecodeKeyValueError { + reason: frame_decode::storage::StorageKeyValueDecodeError, + }, } #[allow(missing_docs)] diff --git a/historic/src/extrinsics.rs b/historic/src/extrinsics.rs index 30239da842d..2bfc0e4a95a 100644 --- a/historic/src/extrinsics.rs +++ b/historic/src/extrinsics.rs @@ -7,7 +7,7 @@ mod extrinsic_info; mod extrinsic_transaction_extensions; mod extrinsics_type; -pub use extrinsic_transaction_extensions::ExtrinsicTransactionExtensions; +pub use extrinsic_transaction_extensions::ExtrinsicTransactionParams; pub use extrinsics_type::{Extrinsic, Extrinsics}; /// Work with extrinsics. diff --git a/historic/src/extrinsics/extrinsic_call.rs b/historic/src/extrinsics/extrinsic_call.rs index 31ffce61513..3f767b58a2a 100644 --- a/historic/src/extrinsics/extrinsic_call.rs +++ b/historic/src/extrinsics/extrinsic_call.rs @@ -1,6 +1,7 @@ use super::extrinsic_info::{AnyExtrinsicInfo, with_info}; use crate::error::ExtrinsicCallError; use crate::utils::Either; +use crate::utils::{AnyResolver, AnyTypeId}; use scale_info_legacy::{LookupName, TypeRegistrySet}; /// This represents the call data in the extrinsic. @@ -53,6 +54,7 @@ impl<'extrinsics, 'atblock> ExtrinsicCall<'extrinsics, 'atblock> { pub struct ExtrinsicCallFields<'extrinsics, 'atblock> { all_bytes: &'extrinsics [u8], info: &'extrinsics AnyExtrinsicInfo<'atblock>, + resolver: AnyResolver<'atblock>, } impl<'extrinsics, 'atblock> ExtrinsicCallFields<'extrinsics, 'atblock> { @@ -60,7 +62,16 @@ impl<'extrinsics, 'atblock> ExtrinsicCallFields<'extrinsics, 'atblock> { all_bytes: &'extrinsics [u8], info: &'extrinsics AnyExtrinsicInfo<'atblock>, ) -> Self { - Self { all_bytes, info } + let resolver = match info { + AnyExtrinsicInfo::Legacy(info) => AnyResolver::B(info.resolver), + AnyExtrinsicInfo::Current(info) => AnyResolver::A(info.resolver), + }; + + Self { + all_bytes, + info, + resolver, + } } /// Return the bytes representing the fields stored in this extrinsic. @@ -74,11 +85,12 @@ impl<'extrinsics, 'atblock> ExtrinsicCallFields<'extrinsics, 'atblock> { } /// Iterate over each of the fields of the extrinsic call data. - pub fn iter(&self) -> impl Iterator> { + pub fn iter(&self) -> impl Iterator> { match &self.info { AnyExtrinsicInfo::Legacy(info) => { Either::A(info.info.call_data().map(|named_arg| ExtrinsicCallField { field_bytes: &self.all_bytes[named_arg.range()], + resolver: &self.resolver, info: AnyExtrinsicCallFieldInfo::Legacy(ExtrinsicCallFieldInfo { info: named_arg, resolver: info.resolver, @@ -88,6 +100,7 @@ impl<'extrinsics, 'atblock> ExtrinsicCallFields<'extrinsics, 'atblock> { AnyExtrinsicInfo::Current(info) => { Either::B(info.info.call_data().map(|named_arg| ExtrinsicCallField { field_bytes: &self.all_bytes[named_arg.range()], + resolver: &self.resolver, info: AnyExtrinsicCallFieldInfo::Current(ExtrinsicCallFieldInfo { info: named_arg, resolver: info.resolver, @@ -98,7 +111,7 @@ impl<'extrinsics, 'atblock> ExtrinsicCallFields<'extrinsics, 'atblock> { } /// Attempt to decode the fields into the given type. - pub fn decode(&self) -> Result { + pub fn decode_as(&self) -> Result { with_info!(&self.info => { let cursor = &mut self.bytes(); let mut fields = &mut info.info.call_data().map(|named_arg| { @@ -119,9 +132,10 @@ impl<'extrinsics, 'atblock> ExtrinsicCallFields<'extrinsics, 'atblock> { } } -pub struct ExtrinsicCallField<'extrinsics, 'atblock> { +pub struct ExtrinsicCallField<'fields, 'extrinsics, 'atblock> { field_bytes: &'extrinsics [u8], info: AnyExtrinsicCallFieldInfo<'extrinsics, 'atblock>, + resolver: &'fields AnyResolver<'atblock>, } enum AnyExtrinsicCallFieldInfo<'extrinsics, 'atblock> { @@ -144,7 +158,7 @@ macro_rules! with_call_field_info { }; } -impl<'extrinsics, 'atblock> ExtrinsicCallField<'extrinsics, 'atblock> { +impl<'fields, 'extrinsics, 'atblock> ExtrinsicCallField<'fields, 'extrinsics, 'atblock> { /// Get the raw bytes for this field. pub fn bytes(&self) -> &'extrinsics [u8] { self.field_bytes @@ -155,8 +169,24 @@ impl<'extrinsics, 'atblock> ExtrinsicCallField<'extrinsics, 'atblock> { with_call_field_info!(&self.info => info.info.name()) } + /// Visit the given field with a [`scale_decode::visitor::Visitor`]. This is like a lower level + /// version of [`ExtrinsicCallField::decode_as`], as the visitor is able to preserve lifetimes + /// and has access to more type information than is available via [`ExtrinsicCallField::decode_as`]. + pub fn visit>>( + &self, + visitor: V, + ) -> Result, V::Error> { + let type_id = match &self.info { + AnyExtrinsicCallFieldInfo::Current(info) => AnyTypeId::A(*info.info.ty()), + AnyExtrinsicCallFieldInfo::Legacy(info) => AnyTypeId::B(info.info.ty().clone()), + }; + let cursor = &mut self.bytes(); + + scale_decode::visitor::decode_with_visitor(cursor, type_id, self.resolver, visitor) + } + /// Attempt to decode the value of this field into the given type. - pub fn decode(&self) -> Result { + pub fn decode_as(&self) -> Result { with_call_field_info!(&self.info => { let cursor = &mut &*self.field_bytes; let decoded = T::decode_as_type(cursor, info.info.ty().clone(), info.resolver) diff --git a/historic/src/extrinsics/extrinsic_transaction_extensions.rs b/historic/src/extrinsics/extrinsic_transaction_extensions.rs index 28c8747548a..3f360102510 100644 --- a/historic/src/extrinsics/extrinsic_transaction_extensions.rs +++ b/historic/src/extrinsics/extrinsic_transaction_extensions.rs @@ -16,7 +16,7 @@ struct ExtrinsicExtensionsInfo<'extrinsics, 'atblock, TypeId, Resolver> { } /// This represents the transaction extensions of an extrinsic. -pub struct ExtrinsicTransactionExtensions<'extrinsics, 'atblock> { +pub struct ExtrinsicTransactionParams<'extrinsics, 'atblock> { all_bytes: &'extrinsics [u8], info: AnyExtrinsicExtensionsInfo<'extrinsics, 'atblock>, } @@ -31,7 +31,7 @@ macro_rules! with_extensions_info { }; } -impl<'extrinsics, 'atblock> ExtrinsicTransactionExtensions<'extrinsics, 'atblock> { +impl<'extrinsics, 'atblock> ExtrinsicTransactionParams<'extrinsics, 'atblock> { pub(crate) fn new( all_bytes: &'extrinsics [u8], info: &'extrinsics AnyExtrinsicInfo<'atblock>, @@ -105,7 +105,7 @@ impl<'extrinsics, 'atblock> ExtrinsicTransactionExtensions<'extrinsics, 'atblock /// Attempt to decode the transaction extensions into a type where each field name is the name of the transaction /// extension and the field value is the decoded extension. - pub fn decode( + pub fn decode_as( &self, ) -> Result { with_extensions_info!(&self.info => { @@ -189,7 +189,7 @@ impl<'extrinsics, 'atblock> ExtrinsicTransactionExtension<'extrinsics, 'atblock> } /// Decode the bytes for this transaction extension into a type that implements `scale_decode::DecodeAsType`. - pub fn decode( + pub fn decode_as( &self, ) -> Result { with_extension_info!(&self.info => { diff --git a/historic/src/extrinsics/extrinsics_type.rs b/historic/src/extrinsics/extrinsics_type.rs index 4119f9b6b15..520b3147596 100644 --- a/historic/src/extrinsics/extrinsics_type.rs +++ b/historic/src/extrinsics/extrinsics_type.rs @@ -1,6 +1,6 @@ use super::extrinsic_call::ExtrinsicCall; use super::extrinsic_info::{AnyExtrinsicInfo, with_info}; -use super::extrinsic_transaction_extensions::ExtrinsicTransactionExtensions; +use super::extrinsic_transaction_extensions::ExtrinsicTransactionParams; use crate::client::OfflineClientAtBlockT; use crate::config::Config; use crate::error::ExtrinsicsError; @@ -106,10 +106,7 @@ impl<'extrinsics, 'atblock> Extrinsic<'extrinsics, 'atblock> { /// Get information about the transaction extensions of this extrinsic. pub fn transaction_extensions( &self, - ) -> Option> { - ExtrinsicTransactionExtensions::new(self.bytes, self.info) + ) -> Option> { + ExtrinsicTransactionParams::new(self.bytes, self.info) } } - -// TODO add extrinsic.call() with .bytes, and .decode function to make it easy to decode call fields into Value or whatever. -// Then add this to the example. Make sure we can do everything that dot-block-decoder does easily. diff --git a/historic/src/lib.rs b/historic/src/lib.rs index d4243d1ec50..8c15ab2e6fa 100644 --- a/historic/src/lib.rs +++ b/historic/src/lib.rs @@ -20,3 +20,8 @@ pub use error::Error; pub mod ext { pub use futures::stream::{Stream, StreamExt}; } + +/// Helper types that could be useful. +pub mod helpers { + pub use crate::utils::{AnyResolver, AnyResolverError, AnyTypeId}; +} diff --git a/historic/src/storage.rs b/historic/src/storage.rs index 14496445fa7..2d818b9b4e1 100644 --- a/historic/src/storage.rs +++ b/historic/src/storage.rs @@ -1,3 +1,4 @@ +mod list_storage_entries_any; mod storage_entry; mod storage_info; mod storage_key; @@ -5,16 +6,17 @@ mod storage_value; use crate::client::{OfflineClientAtBlockT, OnlineClientAtBlockT}; use crate::config::Config; -use crate::error::{StorageEntryIsNotAMap, StorageEntryIsNotAPlainValue, StorageError}; +use crate::error::StorageError; use crate::storage::storage_info::with_info; use std::borrow::Cow; +use std::sync::Arc; use storage_info::AnyStorageInfo; pub use storage_entry::StorageEntry; pub use storage_key::{StorageHasher, StorageKey, StorageKeyPart}; pub use storage_value::StorageValue; // We take how storage keys can be passed in from `frame-decode`, so re-export here. -pub use frame_decode::storage::{IntoStorageKeys, StorageKeys}; +pub use frame_decode::storage::{EncodableValues, IntoEncodableValues}; /// Work with storage. pub struct StorageClient<'atblock, Client, T> { @@ -33,44 +35,34 @@ impl<'atblock, Client, T> StorageClient<'atblock, Client, T> { } // Things that we can do offline with storage. -impl<'atblock, 'client: 'atblock, Client, T> StorageClient<'atblock, Client, T> +impl<'atblock, Client, T> StorageClient<'atblock, Client, T> where - T: Config + 'client, - Client: OfflineClientAtBlockT<'client, T>, + T: Config + 'atblock, + Client: OfflineClientAtBlockT<'atblock, T>, { /// Select the storage entry you'd like to work with. pub fn entry( &self, pallet_name: impl Into, - storage_name: impl Into, + entry_name: impl Into, ) -> Result, StorageError> { let pallet_name = pallet_name.into(); - let storage_name = storage_name.into(); + let entry_name = entry_name.into(); let storage_info = AnyStorageInfo::new( &pallet_name, - &storage_name, + &entry_name, self.client.metadata(), self.client.legacy_types(), )?; - if storage_info.is_map() { - Ok(StorageEntryClient::Map(StorageEntryMapClient { - client: self.client, - pallet_name, - storage_name, - info: storage_info, - marker: std::marker::PhantomData, - })) - } else { - Ok(StorageEntryClient::Plain(StorageEntryPlainClient { - client: self.client, - pallet_name, - storage_name, - info: storage_info, - marker: std::marker::PhantomData, - })) - } + Ok(StorageEntryClient { + client: self.client, + pallet_name, + entry_name, + info: Arc::new(storage_info), + marker: std::marker::PhantomData, + }) } /// Iterate over all of the storage entries listed in the metadata for the current block. This does **not** include well known @@ -78,34 +70,50 @@ where pub fn entries(&self) -> impl Iterator> { let client = self.client; let metadata = client.metadata(); - frame_decode::helpers::list_storage_entries_any(metadata).map(|entry| StorageEntriesItem { - entry, - client: self.client, - marker: std::marker::PhantomData, + + let mut pallet_name = Cow::Borrowed(""); + list_storage_entries_any::list_storage_entries_any(metadata).filter_map(move |entry| { + match entry { + frame_decode::storage::StorageEntry::In(name) => { + // Set the pallet name for upcoming entries: + pallet_name = name; + None + } + frame_decode::storage::StorageEntry::Name(entry_name) => { + // Output each entry with the last seen pallet name: + Some(StorageEntriesItem { + pallet_name: pallet_name.clone(), + entry_name, + client: self.client, + marker: std::marker::PhantomData, + }) + } + } }) } } /// Working with a specific storage entry. pub struct StorageEntriesItem<'atblock, Client, T> { - entry: frame_decode::helpers::StorageEntry<'atblock>, + pallet_name: Cow<'atblock, str>, + entry_name: Cow<'atblock, str>, client: &'atblock Client, marker: std::marker::PhantomData, } -impl<'atblock, 'client: 'atblock, Client, T> StorageEntriesItem<'atblock, Client, T> +impl<'atblock, Client, T> StorageEntriesItem<'atblock, Client, T> where - T: Config + 'client, - Client: OfflineClientAtBlockT<'client, T>, + T: Config + 'atblock, + Client: OfflineClientAtBlockT<'atblock, T>, { /// The pallet name. pub fn pallet_name(&self) -> &str { - self.entry.pallet() + &self.pallet_name } /// The storage entry name. - pub fn storage_name(&self) -> &str { - self.entry.entry() + pub fn entry_name(&self) -> &str { + &self.entry_name } /// Extract the relevant storage information so that we can work with this entry. @@ -114,88 +122,20 @@ where client: self.client, marker: std::marker::PhantomData, } - .entry( - self.entry.pallet().to_owned(), - self.entry.entry().to_owned(), - ) + .entry(&*self.pallet_name, &*self.entry_name) } } -/// A client for working with a specific storage entry. This is an enum because the storage entry -/// might be either a map or a plain value, and each has a different interface. -pub enum StorageEntryClient<'atblock, Client, T> { - Plain(StorageEntryPlainClient<'atblock, Client, T>), - Map(StorageEntryMapClient<'atblock, Client, T>), -} - -impl<'atblock, Client, T> StorageEntryClient<'atblock, Client, T> -where - T: Config + 'atblock, - Client: OfflineClientAtBlockT<'atblock, T>, -{ - /// Get the pallet name. - pub fn pallet_name(&self) -> &str { - match self { - StorageEntryClient::Plain(client) => &client.pallet_name, - StorageEntryClient::Map(client) => &client.pallet_name, - } - } - - /// Get the storage entry name. - pub fn storage_name(&self) -> &str { - match self { - StorageEntryClient::Plain(client) => &client.storage_name, - StorageEntryClient::Map(client) => &client.storage_name, - } - } - - /// Is the storage entry a plain value? - pub fn is_plain(&self) -> bool { - matches!(self, StorageEntryClient::Plain(_)) - } - - /// Is the storage entry a map? - pub fn is_map(&self) -> bool { - matches!(self, StorageEntryClient::Map(_)) - } - - /// If this storage entry is a plain value, return the client for working with it. Else return an error. - pub fn into_plain( - self, - ) -> Result, StorageEntryIsNotAPlainValue> { - match self { - StorageEntryClient::Plain(client) => Ok(client), - StorageEntryClient::Map(_) => Err(StorageEntryIsNotAPlainValue { - pallet_name: self.pallet_name().into(), - storage_name: self.storage_name().into(), - }), - } - } - - /// If this storage entry is a map, return the client for working with it. Else return an error. - pub fn into_map( - self, - ) -> Result, StorageEntryIsNotAMap> { - match self { - StorageEntryClient::Plain(_) => Err(StorageEntryIsNotAMap { - pallet_name: self.pallet_name().into(), - storage_name: self.storage_name().into(), - }), - StorageEntryClient::Map(client) => Ok(client), - } - } -} - -/// A client for working with a plain storage entry. -pub struct StorageEntryPlainClient<'atblock, Client, T> { +/// A client for working with a specific storage entry. +pub struct StorageEntryClient<'atblock, Client, T> { client: &'atblock Client, pallet_name: String, - storage_name: String, - info: AnyStorageInfo<'atblock>, + entry_name: String, + info: Arc>, marker: std::marker::PhantomData, } -impl<'atblock, Client, T> StorageEntryPlainClient<'atblock, Client, T> +impl<'atblock, Client, T> StorageEntryClient<'atblock, Client, T> where T: Config + 'atblock, Client: OfflineClientAtBlockT<'atblock, T>, @@ -206,134 +146,72 @@ where } /// Get the storage entry name. - pub fn storage_name(&self) -> &str { - &self.storage_name + pub fn entry_name(&self) -> &str { + &self.entry_name } - /// Return the default value for this storage entry, if there is one. Returns `None` if there - /// is no default value. - pub fn default(&self) -> Option> { - with_info!(info = &self.info => { - info.info.default_value.as_ref().map(|default_value| { - StorageValue::new(&self.info, default_value.clone()) - }) - }) - } -} - -impl<'atblock, Client, T> StorageEntryPlainClient<'atblock, Client, T> -where - T: Config + 'atblock, - Client: OnlineClientAtBlockT<'atblock, T>, -{ - /// Fetch the value for this storage entry. - pub async fn fetch(&self) -> Result>, StorageError> { - let key_bytes = self.key(); - fetch(self.client, &key_bytes) - .await - .map(|v| v.map(|bytes| StorageValue::new(&self.info, Cow::Owned(bytes)))) - } - - /// Fetch the value for this storage entry as per [`StorageEntryPlainClient::fetch`], but return the default - /// value for the storage entry if one exists and the entry does not exist. - pub async fn fetch_or_default( - &self, - ) -> Result>, StorageError> { - self.fetch() - .await - .map(|option_val| option_val.or_else(|| self.default())) - } - - /// The key for this storage entry. - pub fn key(&self) -> [u8; 32] { + /// The key which points to this storage entry (but not necessarily any values within it). + pub fn key_prefix(&self) -> [u8; 32] { let pallet_name = &*self.pallet_name; - let storage_name = &*self.storage_name; - - frame_decode::storage::encode_prefix(pallet_name, storage_name) - } -} - -/// A client for working with a storage entry that is a map. -pub struct StorageEntryMapClient<'atblock, Client, T> { - client: &'atblock Client, - pallet_name: String, - storage_name: String, - info: AnyStorageInfo<'atblock>, - marker: std::marker::PhantomData, -} - -impl<'atblock, Client, T> StorageEntryMapClient<'atblock, Client, T> -where - T: Config + 'atblock, - Client: OfflineClientAtBlockT<'atblock, T>, -{ - /// Get the pallet name. - pub fn pallet_name(&self) -> &str { - &self.pallet_name - } + let entry_name = &*self.entry_name; - /// Get the storage entry name. - pub fn storage_name(&self) -> &str { - &self.storage_name + frame_decode::storage::encode_storage_key_prefix(pallet_name, entry_name) } /// Return the default value for this storage entry, if there is one. Returns `None` if there /// is no default value. - pub fn default(&self) -> Option> { - with_info!(info = &self.info => { + pub fn default_value(&self) -> Option> { + with_info!(info = &*self.info => { info.info.default_value.as_ref().map(|default_value| { - StorageValue::new(&self.info, default_value.clone()) + StorageValue::new(self.info.clone(), default_value.clone()) }) }) } } -impl<'atblock, Client, T> StorageEntryMapClient<'atblock, Client, T> +impl<'atblock, Client, T> StorageEntryClient<'atblock, Client, T> where T: Config + 'atblock, Client: OnlineClientAtBlockT<'atblock, T>, { /// Fetch a specific key in this map. If the number of keys provided is not equal /// to the number of keys required to fetch a single value from the map, then an error - /// will be emitted. - pub async fn fetch( + /// will be emitted. If no value exists but there is a default value for this storage + /// entry, then the default value will be returned. Else, `None` will be returned. + pub async fn fetch( &self, keys: Keys, - ) -> Result>, StorageError> { - let expected_num_keys = with_info!(info = &self.info => { + ) -> Result>, StorageError> { + let expected_num_keys = with_info!(info = &*self.info => { info.info.keys.len() }); - if expected_num_keys != keys.num_keys() { - return Err(StorageError::WrongNumberOfKeysProvided { - num_keys_provided: keys.num_keys(), + // For fetching, we need exactly as many keys as exist for a storage entry. + if expected_num_keys != keys.num_encodable_values() { + return Err(StorageError::WrongNumberOfKeysProvidedForFetch { + num_keys_provided: keys.num_encodable_values(), num_keys_expected: expected_num_keys, }); } let key_bytes = self.key(keys)?; - fetch(self.client, &key_bytes) - .await - .map(|v| v.map(|bytes| StorageValue::new(&self.info, Cow::Owned(bytes)))) - } + let info = self.info.clone(); + let value = fetch(self.client, &key_bytes) + .await? + .map(|bytes| StorageValue::new(info, Cow::Owned(bytes))) + .or_else(|| self.default_value()); - /// Fetch a specific key in this map as per [`StorageEntryMapClient::fetch`], but return the default - /// value for the storage entry if one exists and the entry was not found. - pub async fn fetch_or_default( - &self, - keys: Keys, - ) -> Result>, StorageError> { - self.fetch(keys) - .await - .map(|option_val| option_val.or_else(|| self.default())) + Ok(value) } /// Iterate over the values underneath the provided keys. - pub async fn iter( + pub async fn iter( &self, keys: Keys, ) -> Result< - impl futures::Stream, StorageError>> + Unpin, + impl futures::Stream, StorageError>> + + Unpin + + use<'atblock, Client, T, Keys>, StorageError, > { use futures::stream::StreamExt; @@ -341,6 +219,19 @@ where ArchiveStorageEvent, StorageQuery, StorageQueryType, }; + let expected_num_keys = with_info!(info = &*self.info => { + info.info.keys.len() + }); + + // For iterating, we need at most one less key than the number that exists for a storage entry. + // TODO: The error message will be confusing if == keys are provided! + if keys.num_encodable_values() >= expected_num_keys { + return Err(StorageError::TooManyKeysProvidedForIter { + num_keys_provided: keys.num_encodable_values(), + max_keys_expected: expected_num_keys - 1, + }); + } + let block_hash = self.client.block_hash(); let key_bytes = self.key(keys)?; @@ -356,23 +247,22 @@ where .await .map_err(|e| StorageError::RpcError { reason: e })?; - let sub = sub.filter_map(async |item| { - let item = match item { - Ok(ArchiveStorageEvent::Item(item)) => item, - Ok(ArchiveStorageEvent::Error(err)) => { - return Some(Err(StorageError::StorageEventError { reason: err.error })); - } - Ok(ArchiveStorageEvent::Done) => return None, - Err(e) => return Some(Err(StorageError::RpcError { reason: e })), - }; - - item.value.map(|value| { - Ok(StorageEntry::new( - &self.info, - item.key.0, - Cow::Owned(value.0), - )) - }) + let info = self.info.clone(); + let sub = sub.filter_map(move |item| { + let info = info.clone(); + async move { + let item = match item { + Ok(ArchiveStorageEvent::Item(item)) => item, + Ok(ArchiveStorageEvent::Error(err)) => { + return Some(Err(StorageError::StorageEventError { reason: err.error })); + } + Ok(ArchiveStorageEvent::Done) => return None, + Err(e) => return Some(Err(StorageError::RpcError { reason: e })), + }; + + item.value + .map(|value| Ok(StorageEntry::new(info, item.key.0, Cow::Owned(value.0)))) + } }); Ok(Box::pin(sub)) @@ -384,16 +274,14 @@ where // Dev note: We don't have any functions that can take an already-encoded key and fetch an entry from // it yet, so we don't expose this. If we did expose it, we might want to return some struct that wraps // the key bytes and some metadata about them. Or maybe just fetch_raw and iter_raw. - fn key(&self, keys: Keys) -> Result, StorageError> { - with_info!(info = &self.info => { - let mut key_bytes = Vec::new(); - frame_decode::storage::encode_storage_key_with_info_to( + fn key(&self, keys: Keys) -> Result, StorageError> { + with_info!(info = &*self.info => { + let key_bytes = frame_decode::storage::encode_storage_key_with_info( &self.pallet_name, - &self.storage_name, + &self.entry_name, keys, &info.info, info.resolver, - &mut key_bytes, ).map_err(|e| StorageError::KeyEncodeError { reason: e })?; Ok(key_bytes) }) diff --git a/historic/src/storage/list_storage_entries_any.rs b/historic/src/storage/list_storage_entries_any.rs new file mode 100644 index 00000000000..e97bafd7480 --- /dev/null +++ b/historic/src/storage/list_storage_entries_any.rs @@ -0,0 +1,35 @@ +use frame_decode::storage::StorageEntryInfo; +use frame_metadata::RuntimeMetadata; + +pub use frame_decode::storage::StorageEntry; + +/// Returns an iterator listing the available storage entries in some metadata. +/// +/// This basically calls [`StorageEntryInfo::storage_entries()`] for each metadata version, +/// returning an empty iterator where applicable (ie when passing legacy metadata and the +/// `legacy` features flag is not enabled). +pub fn list_storage_entries_any( + metadata: &RuntimeMetadata, +) -> impl Iterator> { + match metadata { + RuntimeMetadata::V0(_deprecated_metadata) + | RuntimeMetadata::V1(_deprecated_metadata) + | RuntimeMetadata::V2(_deprecated_metadata) + | RuntimeMetadata::V3(_deprecated_metadata) + | RuntimeMetadata::V4(_deprecated_metadata) + | RuntimeMetadata::V5(_deprecated_metadata) + | RuntimeMetadata::V6(_deprecated_metadata) + | RuntimeMetadata::V7(_deprecated_metadata) => { + Box::new(core::iter::empty()) as Box>> + } + RuntimeMetadata::V8(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V9(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V10(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V11(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V12(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V13(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V14(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V15(m) => Box::new(m.storage_entries()), + RuntimeMetadata::V16(m) => Box::new(m.storage_entries()), + } +} diff --git a/historic/src/storage/storage_entry.rs b/historic/src/storage/storage_entry.rs index 736b092fb01..90aa0f68409 100644 --- a/historic/src/storage/storage_entry.rs +++ b/historic/src/storage/storage_entry.rs @@ -1,21 +1,21 @@ use super::storage_info::AnyStorageInfo; use super::storage_key::StorageKey; use super::storage_value::StorageValue; -use crate::error::{StorageKeyError, StorageValueError}; -use scale_decode::DecodeAsType; +use crate::error::StorageKeyError; use std::borrow::Cow; +use std::sync::Arc; /// This represents a storage entry, which is a key-value pair in the storage. -pub struct StorageEntry<'entry, 'atblock> { +pub struct StorageEntry<'atblock> { key: Vec, // This contains the storage information already: - value: StorageValue<'entry, 'atblock>, + value: StorageValue<'atblock>, } -impl<'entry, 'atblock> StorageEntry<'entry, 'atblock> { +impl<'atblock> StorageEntry<'atblock> { /// Create a new storage entry. pub fn new( - info: &'entry AnyStorageInfo<'atblock>, + info: Arc>, key: Vec, value: Cow<'atblock, [u8]>, ) -> Self { @@ -30,11 +30,6 @@ impl<'entry, 'atblock> StorageEntry<'entry, 'atblock> { &self.key } - /// Get the raw bytes for this storage entry's value. - pub fn value_bytes(&self) -> &[u8] { - self.value.bytes() - } - /// Consume this storage entry and return the raw bytes for the key and value. pub fn into_key_and_value_bytes(self) -> (Vec, Vec) { (self.key, self.value.into_bytes()) @@ -42,12 +37,12 @@ impl<'entry, 'atblock> StorageEntry<'entry, 'atblock> { /// Decode the key for this storage entry. This gives back a type from which we can /// decode specific parts of the key hash (where applicable). - pub fn decode_key(&'_ self) -> Result, StorageKeyError> { - StorageKey::new(self.value.info, &self.key) + pub fn key(&'_ self) -> Result, StorageKeyError> { + StorageKey::new(&self.value.info, &self.key) } - /// Decode this storage value. - pub fn decode_value(&self) -> Result { - self.value.decode::() + /// Return the storage value. + pub fn value(&self) -> &StorageValue<'atblock> { + &self.value } } diff --git a/historic/src/storage/storage_info.rs b/historic/src/storage/storage_info.rs index e54de0e3ee8..685a0ff7667 100644 --- a/historic/src/storage/storage_info.rs +++ b/historic/src/storage/storage_info.rs @@ -44,7 +44,7 @@ impl<'atblock> AnyStorageInfo<'atblock> { Resolver: scale_type_resolver::TypeResolver, AnyStorageInfo<'atblock>: From>, { - m.get_storage_info(pallet_name, entry_name) + m.storage_info(pallet_name, entry_name) .map(|frame_storage_info| { let info = StorageInfo { info: frame_storage_info, @@ -84,7 +84,7 @@ impl<'atblock> From> } } -pub struct StorageInfo<'atblock, TypeId, Resolver> { +pub struct StorageInfo<'atblock, TypeId: Clone, Resolver> { pub info: frame_decode::storage::StorageInfo<'atblock, TypeId>, pub resolver: &'atblock Resolver, } diff --git a/historic/src/storage/storage_key.rs b/historic/src/storage/storage_key.rs index ad72f7f37c6..cbabe0e6a06 100644 --- a/historic/src/storage/storage_key.rs +++ b/historic/src/storage/storage_key.rs @@ -3,7 +3,7 @@ use crate::{error::StorageKeyError, storage::storage_info::with_info}; use scale_info_legacy::{LookupName, TypeRegistrySet}; // This is part of our public interface. -pub use frame_decode::storage::StorageHasher; +pub use frame_decode::storage::{IntoDecodableValues, StorageHasher}; enum AnyStorageKeyInfo<'atblock> { Legacy(StorageKeyInfo<'atblock, LookupName, TypeRegistrySet<'atblock>>), @@ -78,6 +78,23 @@ impl<'entry, 'atblock> StorageKey<'entry, 'atblock> { }) } + /// Attempt to decode the values contained within this storage key to the `Target` type + /// provided. This type is typically a tuple of types which each implement [`scale_decode::DecodeAsType`] + /// and correspond to each of the key types present, in order. + pub fn decode_as(&self) -> Result { + with_key_info!(info = &self.info => { + let values = frame_decode::storage::decode_storage_key_values( + self.bytes, + &info.info, + info.resolver + ).map_err(|e| { + StorageKeyError::DecodeKeyValueError { reason: e } + })?; + + Ok(values) + }) + } + /// Iterate over the parts of this storage key. Each part of a storage key corresponds to a /// single value that has been hashed. pub fn parts(&'_ self) -> impl ExactSizeIterator> { @@ -137,7 +154,7 @@ impl<'key, 'entry, 'atblock> StorageKeyPart<'key, 'entry, 'atblock> { /// is available as a part of the key hash, allowing us to decode it into anything /// implementing [`scale_decode::DecodeAsType`]. If the key was produced using a /// different hasher, this will return `None`. - pub fn decode(&self) -> Result, StorageKeyError> { + pub fn decode_as(&self) -> Result, StorageKeyError> { with_key_info!(info = &self.info => { let part_info = &info.info[self.index]; let Some(value_info) = part_info.value() else { diff --git a/historic/src/storage/storage_value.rs b/historic/src/storage/storage_value.rs index f4f2704e50b..c19bebaa67d 100644 --- a/historic/src/storage/storage_value.rs +++ b/historic/src/storage/storage_value.rs @@ -1,19 +1,31 @@ use super::storage_info::AnyStorageInfo; use super::storage_info::with_info; use crate::error::StorageValueError; +use crate::utils::{AnyResolver, AnyTypeId}; use scale_decode::DecodeAsType; use std::borrow::Cow; +use std::sync::Arc; /// This represents a storage value. -pub struct StorageValue<'entry, 'atblock> { - pub(crate) info: &'entry AnyStorageInfo<'atblock>, +pub struct StorageValue<'atblock> { + pub(crate) info: Arc>, bytes: Cow<'atblock, [u8]>, + resolver: AnyResolver<'atblock>, } -impl<'entry, 'atblock> StorageValue<'entry, 'atblock> { +impl<'atblock> StorageValue<'atblock> { /// Create a new storage value. - pub fn new(info: &'entry AnyStorageInfo<'atblock>, bytes: Cow<'atblock, [u8]>) -> Self { - Self { info, bytes } + pub(crate) fn new(info: Arc>, bytes: Cow<'atblock, [u8]>) -> Self { + let resolver = match &*info { + AnyStorageInfo::Current(info) => AnyResolver::A(info.resolver), + AnyStorageInfo::Legacy(info) => AnyResolver::B(info.resolver), + }; + + Self { + info, + bytes, + resolver, + } } /// Get the raw bytes for this storage value. @@ -26,9 +38,25 @@ impl<'entry, 'atblock> StorageValue<'entry, 'atblock> { self.bytes.to_vec() } + /// Visit the given field with a [`scale_decode::visitor::Visitor`]. This is like a lower level + /// version of [`StorageValue::decode_as`], as the visitor is able to preserve lifetimes + /// and has access to more type information than is available via [`StorageValue::decode_as`]. + pub fn visit>>( + &self, + visitor: V, + ) -> Result, V::Error> { + let type_id = match &*self.info { + AnyStorageInfo::Current(info) => AnyTypeId::A(info.info.value_id), + AnyStorageInfo::Legacy(info) => AnyTypeId::B(info.info.value_id.clone()), + }; + let cursor = &mut self.bytes(); + + scale_decode::visitor::decode_with_visitor(cursor, type_id, &self.resolver, visitor) + } + /// Decode this storage value. - pub fn decode(&self) -> Result { - with_info!(info = &self.info => { + pub fn decode_as(&self) -> Result { + with_info!(info = &*self.info => { let cursor = &mut &*self.bytes; let value = T::decode_as_type( diff --git a/historic/src/utils.rs b/historic/src/utils.rs index c715c91ed4c..4a4edf859ba 100644 --- a/historic/src/utils.rs +++ b/historic/src/utils.rs @@ -1,5 +1,7 @@ +mod any_resolver; mod either; mod range_map; +pub use any_resolver::{AnyResolver, AnyResolverError, AnyTypeId}; pub use either::Either; pub use range_map::RangeMap; diff --git a/historic/src/utils/any_resolver.rs b/historic/src/utils/any_resolver.rs new file mode 100644 index 00000000000..8d92bcf4bd9 --- /dev/null +++ b/historic/src/utils/any_resolver.rs @@ -0,0 +1,188 @@ +use super::Either; +use scale_info_legacy::LookupName; +use scale_type_resolver::ResolvedTypeVisitor; + +/// A type resolver which could either be for modern or historic resolving. +pub type AnyResolver<'resolver> = Either< + &'resolver scale_info::PortableRegistry, + &'resolver scale_info_legacy::TypeRegistrySet<'resolver>, +>; + +/// A type ID which is either a modern or historic ID. +pub type AnyTypeId = Either; + +impl Default for AnyTypeId { + fn default() -> Self { + // Not a sensible default, but we don't need / can't provide a sensible one. + AnyTypeId::A(u32::MAX) + } +} +impl From for AnyTypeId { + fn from(value: u32) -> Self { + AnyTypeId::A(value) + } +} +impl From for AnyTypeId { + fn from(value: LookupName) -> Self { + AnyTypeId::B(value) + } +} +impl TryFrom for u32 { + type Error = (); + fn try_from(value: AnyTypeId) -> Result { + match value { + AnyTypeId::A(v) => Ok(v), + AnyTypeId::B(_) => Err(()), + } + } +} +impl TryFrom for LookupName { + type Error = (); + fn try_from(value: AnyTypeId) -> Result { + match value { + AnyTypeId::A(_) => Err(()), + AnyTypeId::B(v) => Ok(v), + } + } +} + +/// A resolve error that comes from using [`AnyResolver`] to resolve some [`AnyTypeId`] into a type. +#[derive(Debug, thiserror::Error)] +pub enum AnyResolverError { + #[error("got a {got} type ID but expected a {expected} type ID")] + TypeIdMismatch { + got: &'static str, + expected: &'static str, + }, + #[error("{0}")] + ScaleInfo(scale_type_resolver::portable_registry::Error), + #[error("{0}")] + ScaleInfoLegacy(scale_info_legacy::type_registry::TypeRegistryResolveError), +} + +impl<'resolver> scale_type_resolver::TypeResolver for AnyResolver<'resolver> { + type TypeId = AnyTypeId; + type Error = AnyResolverError; + + fn resolve_type<'this, V: ResolvedTypeVisitor<'this, TypeId = Self::TypeId>>( + &'this self, + type_id: Self::TypeId, + visitor: V, + ) -> Result { + match (self, type_id) { + (Either::A(resolver), Either::A(id)) => resolver + .resolve_type(id, ModernVisitor(visitor)) + .map_err(AnyResolverError::ScaleInfo), + (Either::B(resolver), Either::B(id)) => resolver + .resolve_type(id, LegacyVisitor(visitor)) + .map_err(AnyResolverError::ScaleInfoLegacy), + (Either::A(_), Either::B(_)) => Err(AnyResolverError::TypeIdMismatch { + got: "LookupName", + expected: "u32", + }), + (Either::B(_), Either::A(_)) => Err(AnyResolverError::TypeIdMismatch { + got: "u32", + expected: "LookupName", + }), + } + } +} + +// We need to have a visitor which understands only modern or legacy types, and can wrap the more generic visitor +// that must be provided to AnyResolver::resolve_type. This then allows us to visit historic _or_ modern types +// using the single visitor provided by the user. +struct LegacyVisitor(V); +struct ModernVisitor(V); + +mod impls { + use super::{AnyTypeId, LegacyVisitor, LookupName, ModernVisitor}; + use scale_type_resolver::*; + + // An ugly implementation which maps from modern or legacy types into our AnyTypeId, + // to make LegacyVisitor and ModernVisitor valid visitors when wrapping a generic "any" visitor. + macro_rules! impl_visitor_mapper { + ($struc:ident, $type_id_ty:ident, $variant:ident) => { + impl<'this, V> ResolvedTypeVisitor<'this> for $struc + where + V: ResolvedTypeVisitor<'this, TypeId = AnyTypeId>, + { + type TypeId = $type_id_ty; + type Value = V::Value; + + fn visit_unhandled(self, kind: UnhandledKind) -> Self::Value { + self.0.visit_unhandled(kind) + } + fn visit_array(self, type_id: Self::TypeId, len: usize) -> Self::Value { + self.0.visit_array(AnyTypeId::$variant(type_id), len) + } + fn visit_not_found(self) -> Self::Value { + self.0.visit_not_found() + } + fn visit_composite(self, path: Path, fields: Fields) -> Self::Value + where + Path: PathIter<'this>, + Fields: FieldIter<'this, Self::TypeId>, + { + self.0.visit_composite( + path, + fields.map(|field| Field { + name: field.name, + id: AnyTypeId::$variant(field.id), + }), + ) + } + fn visit_variant(self, path: Path, variants: Var) -> Self::Value + where + Path: PathIter<'this>, + Fields: FieldIter<'this, Self::TypeId>, + Var: VariantIter<'this, Fields>, + { + self.0.visit_variant( + path, + variants.map(|variant| Variant { + index: variant.index, + name: variant.name, + fields: variant.fields.map(|field| Field { + name: field.name, + id: AnyTypeId::$variant(field.id), + }), + }), + ) + } + fn visit_sequence(self, path: Path, type_id: Self::TypeId) -> Self::Value + where + Path: PathIter<'this>, + { + self.0.visit_sequence(path, AnyTypeId::$variant(type_id)) + } + + fn visit_tuple(self, type_ids: TypeIds) -> Self::Value + where + TypeIds: ExactSizeIterator, + { + self.0 + .visit_tuple(type_ids.map(|id| AnyTypeId::$variant(id))) + } + + fn visit_primitive(self, primitive: Primitive) -> Self::Value { + self.0.visit_primitive(primitive) + } + + fn visit_compact(self, type_id: Self::TypeId) -> Self::Value { + self.0.visit_compact(AnyTypeId::$variant(type_id)) + } + + fn visit_bit_sequence( + self, + store_format: BitsStoreFormat, + order_format: BitsOrderFormat, + ) -> Self::Value { + self.0.visit_bit_sequence(store_format, order_format) + } + } + }; + } + + impl_visitor_mapper!(ModernVisitor, u32, A); + impl_visitor_mapper!(LegacyVisitor, LookupName, B); +} diff --git a/historic/src/utils/either.rs b/historic/src/utils/either.rs index a81fe55b11d..081b52e92e2 100644 --- a/historic/src/utils/either.rs +++ b/historic/src/utils/either.rs @@ -1,5 +1,6 @@ macro_rules! either { ($name:ident( $fst:ident, $($variant:ident),* )) => { + #[derive(Clone, Copy, Debug)] pub enum $name<$fst, $($variant),*> { $fst($fst), $($variant($variant),)* diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index 425dc6698dc..dd68a34b45d 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -14,11 +14,23 @@ homepage.workspace = true description = "Command line utilities for checking metadata compatibility between nodes." [features] -default = ["std"] +default = ["std", "legacy"] std = ["scale-info/std", "frame-metadata/std"] +# Enable decoding of legacy metadata, too. +# std required by frame-metadata to decode Self { + Opts { + sanitize_paths: true, + ignore_not_found: true, + } + } +} + +macro_rules! from_historic { + ($vis:vis fn $fn_name:ident($metadata:path $(, builtin_index: $builtin_index:ident)? )) => { + $vis fn $fn_name(metadata: &$metadata, types: &TypeRegistrySet<'_>, opts: Opts) -> Result { + // This will be used to construct our `PortableRegistry` from old-style types. + let mut portable_registry_builder = PortableRegistryBuilder::new(&types); + portable_registry_builder.ignore_not_found(opts.ignore_not_found); + portable_registry_builder.sanitize_paths(opts.sanitize_paths); + + + // We use this type in a few places to denote that we don't know how to decode it. + let unknown_type_id = portable_registry_builder.add_type_str("special::Unknown", None) + .map_err(|e| Error::add_type("constructing 'Unknown' type", e))?; + + // Pallet metadata + let mut call_index = 0u8; + let mut error_index = 0u8; + let mut event_index = 0u8; + + let new_pallets = as_decoded(&metadata.modules).iter().map(|pallet| { + // In older metadatas, calls and event enums can have different indexes + // in a given pallet. Pallets without calls or events don't increment + // the respective index for them. + // + // We assume since errors are non optional, that the pallet index _always_ + // increments for errors (no `None`s to skip). + let (call_index, event_index, error_index) = { + let out = (call_index, event_index, error_index); + if pallet.calls.is_some() { + call_index += 1; + } + if pallet.event.is_some() { + event_index += 1; + } + error_index += 1; + + out + }; + + // For v12 and v13 metadata, there is a builtin index for everything in a pallet. + // We enable this logic for those metadatas to get the correct index. + $( + let $builtin_index = true; + let (call_index, event_index, error_index) = if $builtin_index { + (pallet.index, pallet.index, pallet.index) + } else { + (call_index, event_index, error_index) + }; + )? + + let pallet_name = as_decoded(&pallet.name).to_string(); + + // Storage entries: + let storage = pallet.storage.as_ref().map(|s| { + let storage = as_decoded(s); + let prefix = as_decoded(&storage.prefix); + let entries = metadata.storage_in_pallet(&pallet_name).map(|entry_name| { + let info = metadata + .storage_info(&pallet_name, &entry_name) + .map_err(|e| Error::StorageInfoError(e.into_owned()))?; + let entry_name = entry_name.into_owned(); + + let info = info.map_ids(|old_id| { + portable_registry_builder.add_type(old_id) + }).map_err(|e| { + let ctx = format!("adding type used in storage entry {pallet_name}.{entry_name}"); + Error::add_type(ctx, e) + })?; + + let entry = crate::StorageEntryMetadata { + name: entry_name.clone(), + info: info.into_owned(), + // We don't expose docs via our storage info yet. + docs: Vec::new(), + }; + + Ok((entry_name, entry)) + }).collect::, _>>()?; + Ok(crate::StorageMetadata { + prefix: prefix.clone(), + entries, + }) + }).transpose()?; + + // Pallet error type is just a builtin type: + let error_ty = portable_registry_builder.add_type_str(&format!("builtin::module::error::{pallet_name}"), None) + .map_err(|e| { + let ctx = format!("converting the error enum for pallet {pallet_name}"); + Error::add_type(ctx, e) + })?; + + // Pallet calls also just a builtin type: + let call_ty = pallet.calls.as_ref().map(|_| { + portable_registry_builder.add_type_str(&format!("builtin::module::call::{pallet_name}"), None) + .map_err(|e| { + let ctx = format!("converting the call enum for pallet {pallet_name}"); + Error::add_type(ctx, e) + }) + }).transpose()?; + + // Pallet events also just a builtin type: + let event_ty = pallet.event.as_ref().map(|_| { + portable_registry_builder.add_type_str(&format!("builtin::module::event::{pallet_name}"), None) + .map_err(|e| { + let ctx = format!("converting the event enum for pallet {pallet_name}"); + Error::add_type(ctx, e) + }) + }).transpose()?; + + let call_variant_index = + VariantIndex::build(call_ty, portable_registry_builder.types()); + let error_variant_index = + VariantIndex::build(Some(error_ty), portable_registry_builder.types()); + let event_variant_index = + VariantIndex::build(event_ty, portable_registry_builder.types()); + + let constants = metadata.constants_in_pallet(&pallet_name).map(|name| { + let name = name.into_owned(); + let info = metadata.constant_info(&pallet_name, &name) + .map_err(|e| Error::ConstantInfoError(e.into_owned()))?; + let new_type_id = portable_registry_builder.add_type(info.type_id) + .map_err(|e| { + let ctx = format!("converting the constant {name} for pallet {pallet_name}"); + Error::add_type(ctx, e) + })?; + + let constant = crate::ConstantMetadata { + name: name.clone(), + ty: new_type_id, + value: info.bytes.to_vec(), + // We don't expose docs via our constant info yet. + docs: Vec::new(), + }; + + Ok((name, constant)) + }).collect::>()?; + + let pallet_metadata = crate::PalletMetadataInner { + name: pallet_name.clone(), + call_index, + event_index, + error_index, + storage, + error_ty: Some(error_ty), + call_ty, + event_ty, + call_variant_index, + error_variant_index, + event_variant_index, + constants, + view_functions: Default::default(), + associated_types: Default::default(), + // Pallets did not have docs prior to V15. + docs: Default::default(), + }; + + Ok((pallet_name, pallet_metadata)) + }).collect::,Error>>()?; + + // Extrinsic metadata + let new_extrinsic = { + let signature_info = metadata + .extrinsic_signature_info() + .map_err(|e| Error::ExtrinsicInfoError(e.into_owned()))?; + + let address_ty_id = portable_registry_builder.add_type(signature_info.address_id) + .map_err(|_| Error::CannotFindAddressType)?; + + let signature_ty_id = portable_registry_builder.add_type(signature_info.signature_id) + .map_err(|_| Error::CannotFindCallType)?; + + let transaction_extensions = metadata + .extrinsic_extension_info(None) + .map_err(|e| Error::ExtrinsicInfoError(e.into_owned()))? + .extension_ids + .into_iter() + .map(|ext| { + let ext_name = ext.name.into_owned(); + let ext_type = portable_registry_builder.add_type(ext.id) + .map_err(|e| { + let ctx = format!("converting the signed extension {ext_name}"); + Error::add_type(ctx, e) + })?; + + Ok(crate::TransactionExtensionMetadataInner { + identifier: ext_name, + extra_ty: ext_type, + // This only started existing in V14+ metadata, but in any case, + // we don't need to know how to decode the signed payload for + // historic blocks (hopefully), so set to unknown. + additional_ty: unknown_type_id.into() + }) + }) + .collect::,Error>>()?; + + let transaction_extensions_by_version = BTreeMap::from_iter([( + 0, + (0..transaction_extensions.len() as u32).collect() + )]); + + crate::ExtrinsicMetadata { + address_ty: address_ty_id.into(), + signature_ty: signature_ty_id.into(), + supported_versions: Vec::from_iter([4]), + transaction_extensions, + transaction_extensions_by_version, + } + }; + + // Outer enum types + let outer_enums = crate::OuterEnumsMetadata { + call_enum_ty: portable_registry_builder.add_type_str("builtin::Call", None) + .map_err(|e| { + let ctx = format!("constructing the 'builtin::Call' type to put in the OuterEnums metadata"); + Error::add_type(ctx, e) + })?, + event_enum_ty: portable_registry_builder.add_type_str("builtin::Event", None) + .map_err(|e| { + let ctx = format!("constructing the 'builtin::Event' type to put in the OuterEnums metadata"); + Error::add_type(ctx, e) + })?, + error_enum_ty: portable_registry_builder.add_type_str("builtin::Error", None) + .map_err(|e| { + let ctx = format!("constructing the 'builtin::Error' type to put in the OuterEnums metadata"); + Error::add_type(ctx, e) + })?, + }; + + // These are all the same in V13, but be explicit anyway for clarity. + let pallets_by_call_index = new_pallets + .values() + .iter() + .enumerate() + .map(|(idx,p)| (p.call_index, idx)) + .collect(); + let pallets_by_error_index = new_pallets + .values() + .iter() + .enumerate() + .map(|(idx,p)| (p.error_index, idx)) + .collect(); + let pallets_by_event_index = new_pallets + .values() + .iter() + .enumerate() + .map(|(idx,p)| (p.event_index, idx)) + .collect(); + + // This is optional in the sense that Subxt will return an error if it needs to decode this type, + // and I think for historic metadata we wouldn't end up down that path anyway. Historic metadata + // tends to call it just "DispatchError" but search more specific paths first. + let dispatch_error_ty = portable_registry_builder + .try_add_type_str("hardcoded::DispatchError", None) + .or_else(|| portable_registry_builder.try_add_type_str("sp_runtime::DispatchError", None)) + .or_else(|| portable_registry_builder.try_add_type_str("DispatchError", None)) + .transpose() + .map_err(|e| Error::add_type("constructing DispatchError", e))?; + + // Runtime API definitions live with type definitions. + let apis = type_registry_to_runtime_apis(&types, &mut portable_registry_builder)?; + + Ok(crate::Metadata { + types: portable_registry_builder.finish(), + pallets: new_pallets, + pallets_by_call_index, + pallets_by_error_index, + pallets_by_event_index, + extrinsic: new_extrinsic, + outer_enums, + dispatch_error_ty, + apis, + // Nothing custom existed in V13 + custom: v15::CustomMetadata { map: Default::default() }, + }) + }} +} + +from_historic!(pub fn from_v13(frame_metadata::v13::RuntimeMetadataV13, builtin_index: yes)); +from_historic!(pub fn from_v12(frame_metadata::v12::RuntimeMetadataV12, builtin_index: yes)); +from_historic!(pub fn from_v11(frame_metadata::v11::RuntimeMetadataV11)); +from_historic!(pub fn from_v10(frame_metadata::v10::RuntimeMetadataV10)); +from_historic!(pub fn from_v9(frame_metadata::v9::RuntimeMetadataV9)); +from_historic!(pub fn from_v8(frame_metadata::v8::RuntimeMetadataV8)); + +fn as_decoded(item: &frame_metadata::decode_different::DecodeDifferent) -> &B { + match item { + frame_metadata::decode_different::DecodeDifferent::Encode(_a) => { + panic!("Expecting decoded data") + } + frame_metadata::decode_different::DecodeDifferent::Decoded(b) => b, + } +} + +// Obtain Runtime API information from some type registry. +pub fn type_registry_to_runtime_apis( + types: &TypeRegistrySet<'_>, + portable_registry_builder: &mut PortableRegistryBuilder, +) -> Result, Error> { + let mut apis = OrderedMap::new(); + let mut trait_name = ""; + let mut trait_methods = OrderedMap::new(); + + for api in types.runtime_apis() { + match api { + RuntimeApiName::Trait(name) => { + if !trait_methods.is_empty() { + apis.push_insert( + trait_name.into(), + crate::RuntimeApiMetadataInner { + name: trait_name.into(), + methods: trait_methods, + docs: Vec::new(), + }, + ); + } + trait_methods = OrderedMap::new(); + trait_name = name; + } + RuntimeApiName::Method(name) => { + let info = types + .runtime_api_info(trait_name, name) + .map_err(|e| Error::RuntimeApiInfoError(e.into_owned()))?; + + let info = info.map_ids(|id| { + portable_registry_builder.add_type(id).map_err(|e| { + let c = format!("converting type for runtime API {trait_name}.{name}"); + Error::add_type(c, e) + }) + })?; + + trait_methods.push_insert( + name.to_owned(), + crate::RuntimeApiMethodMetadataInner { + name: name.into(), + info, + docs: Vec::new(), + }, + ); + } + } + } + + Ok(apis) +} + +/// An error encountered converting some legacy metadata to our internal format. +#[allow(missing_docs)] +#[derive(Debug, thiserror::Error)] +pub enum Error { + /// Cannot add a type. + #[error("Cannot add type ({context}): {error}")] + AddTypeError { + context: String, + error: portable_registry_builder::PortableRegistryAddTypeError, + }, + #[error("Cannot find 'hardcoded::ExtrinsicAddress' type in legacy types")] + CannotFindAddressType, + #[error("Cannot find 'hardcoded::ExtrinsicSignature' type in legacy types")] + CannotFindSignatureType, + #[error( + "Cannot find 'builtin::Call' type in legacy types (this should have been automatically added)" + )] + CannotFindCallType, + #[error("Cannot obtain the storage information we need to convert storage entries")] + StorageInfoError(frame_decode::storage::StorageInfoError<'static>), + #[error("Cannot obtain the extrinsic information we need to convert transaction extensions")] + ExtrinsicInfoError(frame_decode::extrinsics::ExtrinsicInfoError<'static>), + #[error("Cannot obtain the Runtime API information we need")] + RuntimeApiInfoError(frame_decode::runtime_apis::RuntimeApiInfoError<'static>), + #[error("Cannot obtain the Constant information we need")] + ConstantInfoError(frame_decode::constants::ConstantInfoError<'static>), +} + +impl Error { + /// A shorthand for the [`Error::AddTypeError`] variant. + fn add_type( + context: impl Into, + error: impl Into, + ) -> Self { + Error::AddTypeError { + context: context.into(), + error: error.into(), + } + } +} diff --git a/metadata/src/from/legacy/portable_registry_builder.rs b/metadata/src/from/legacy/portable_registry_builder.rs new file mode 100644 index 00000000000..b681d691608 --- /dev/null +++ b/metadata/src/from/legacy/portable_registry_builder.rs @@ -0,0 +1,541 @@ +use alloc::borrow::ToOwned; +use alloc::collections::{BTreeMap, BTreeSet}; +use alloc::string::ToString; +use alloc::vec::Vec; +use scale_info::PortableRegistry; +use scale_info::{PortableType, form::PortableForm}; +use scale_info_legacy::type_registry::TypeRegistryResolveError; +use scale_info_legacy::{LookupName, TypeRegistrySet}; +use scale_type_resolver::{ + BitsOrderFormat, BitsStoreFormat, FieldIter, PathIter, Primitive, ResolvedTypeVisitor, + UnhandledKind, VariantIter, +}; + +#[derive(thiserror::Error, Debug)] +pub enum PortableRegistryAddTypeError { + #[error("Error resolving type: {0}")] + ResolveError(#[from] TypeRegistryResolveError), + #[error("Cannot find type '{0}'")] + TypeNotFound(LookupName), +} + +/// the purpose of this is to convert a (subset of) [`scale_info_legacy::TypeRegistrySet`] +/// into a [`scale_info::PortableRegistry`]. Type IDs from the former are passed in, and +/// type IDs from the latter are handed back. Calling [`PortableRegistryBuilder::finish()`] +/// then hands back a [`scale_info::PortableRegistry`] which these Ids can be used with. +pub struct PortableRegistryBuilder<'info> { + legacy_types: &'info TypeRegistrySet<'info>, + scale_info_types: PortableRegistry, + old_to_new: BTreeMap, + ignore_not_found: bool, + sanitize_paths: bool, + seen_names_in_default_path: BTreeSet, +} + +impl<'info> PortableRegistryBuilder<'info> { + /// Instantiate a new [`PortableRegistryBuilder`], providing the set of + /// legacy types you wish to use to construct modern types from. + pub fn new(legacy_types: &'info TypeRegistrySet<'info>) -> Self { + PortableRegistryBuilder { + legacy_types, + scale_info_types: PortableRegistry { + types: Default::default(), + }, + old_to_new: Default::default(), + ignore_not_found: false, + sanitize_paths: false, + seen_names_in_default_path: Default::default(), + } + } + + /// If this is enabled, any type that isn't found will be replaced by a "special::Unknown" type + /// instead of a "type not found" error being emitted. + /// + /// Default: false + pub fn ignore_not_found(&mut self, ignore: bool) { + self.ignore_not_found = ignore; + } + + /// Should type paths be sanitized to make them more amenable to things like codegen? + /// + /// Default: false + pub fn sanitize_paths(&mut self, sanitize: bool) { + self.sanitize_paths = sanitize; + } + + /// Try adding a type, given its string name and optionally the pallet it's scoped to. + pub fn try_add_type_str( + &mut self, + id: &str, + pallet: Option<&str>, + ) -> Option> { + let mut id = match LookupName::parse(id) { + Ok(id) => id, + Err(e) => { + return Some(Err(TypeRegistryResolveError::LookupNameInvalid( + id.to_owned(), + e, + ))); + } + }; + + if let Some(pallet) = pallet { + id = id.in_pallet(pallet); + } + + self.try_add_type(id) + } + + /// Try adding a type, returning `None` if the type doesn't exist. + pub fn try_add_type( + &mut self, + id: LookupName, + ) -> Option> { + match self.add_type(id) { + Ok(id) => Some(Ok(id)), + Err(PortableRegistryAddTypeError::TypeNotFound(_)) => None, + Err(PortableRegistryAddTypeError::ResolveError(e)) => Some(Err(e)), + } + } + + /// Add a new legacy type, giving its string ID/name and, if applicable, the pallet that it's seen in, + /// returning the corresponding "modern" type ID to use in its place, or an error if something does wrong. + pub fn add_type_str( + &mut self, + id: &str, + pallet: Option<&str>, + ) -> Result { + let mut id = LookupName::parse(id) + .map_err(|e| TypeRegistryResolveError::LookupNameInvalid(id.to_owned(), e))?; + + if let Some(pallet) = pallet { + id = id.in_pallet(pallet); + } + + self.add_type(id) + } + + /// Add a new legacy type, returning the corresponding "modern" type ID to use in + /// its place, or an error if something does wrong. + pub fn add_type(&mut self, id: LookupName) -> Result { + if let Some(new_id) = self.old_to_new.get(&id) { + return Ok(*new_id); + } + + // Assign a new ID immediately to prevent any recursion. If we don't do this, then + // recursive types (ie types that contain themselves) will lead to a stack overflow. + // with this, we assign IDs up front, so the ID is returned immediately on recursing. + let new_id = self.scale_info_types.types.len() as u32; + + // Add a placeholder type to "reserve" this ID. + self.scale_info_types.types.push(PortableType { + id: new_id, + ty: scale_info::Type::new( + scale_info::Path { segments: vec![] }, + core::iter::empty(), + scale_info::TypeDef::Variant(scale_info::TypeDefVariant { variants: vec![] }), + Default::default(), + ), + }); + + // Cache the ID so that recursing calls bail early. + self.old_to_new.insert(id.clone(), new_id); + + let visitor = PortableRegistryVisitor { + builder: &mut *self, + current_type: &id, + }; + + match visitor + .builder + .legacy_types + .resolve_type(id.clone(), visitor) + { + Ok(Ok(ty)) => { + self.scale_info_types.types[new_id as usize].ty = ty; + Ok(new_id) + } + Ok(Err(e)) => { + self.old_to_new.remove(&id); + Err(e) + } + Err(e) => { + self.old_to_new.remove(&id); + Err(e.into()) + } + } + } + + /// Return the current [`scale_info::PortableRegistry`]. + pub fn types(&self) -> &PortableRegistry { + &self.scale_info_types + } + + /// Finish adding types and return the modern type registry. + pub fn finish(self) -> PortableRegistry { + self.scale_info_types + } +} + +struct PortableRegistryVisitor<'a, 'info> { + builder: &'a mut PortableRegistryBuilder<'info>, + current_type: &'a LookupName, +} + +impl<'a, 'info> ResolvedTypeVisitor<'info> for PortableRegistryVisitor<'a, 'info> { + type TypeId = LookupName; + type Value = Result, PortableRegistryAddTypeError>; + + fn visit_unhandled(self, kind: UnhandledKind) -> Self::Value { + panic!("A handler exists for every type, but visit_unhandled({kind:?}) was called"); + } + + fn visit_not_found(self) -> Self::Value { + if self.builder.ignore_not_found { + // Return the "unknown" type if we're ignoring not found types: + Ok(unknown_type()) + } else { + // Otherwise just return an error at this point: + Err(PortableRegistryAddTypeError::TypeNotFound( + self.current_type.clone(), + )) + } + } + + fn visit_primitive(self, primitive: Primitive) -> Self::Value { + let p = match primitive { + Primitive::Bool => scale_info::TypeDefPrimitive::Bool, + Primitive::Char => scale_info::TypeDefPrimitive::Char, + Primitive::Str => scale_info::TypeDefPrimitive::Str, + Primitive::U8 => scale_info::TypeDefPrimitive::U8, + Primitive::U16 => scale_info::TypeDefPrimitive::U16, + Primitive::U32 => scale_info::TypeDefPrimitive::U32, + Primitive::U64 => scale_info::TypeDefPrimitive::U64, + Primitive::U128 => scale_info::TypeDefPrimitive::U128, + Primitive::U256 => scale_info::TypeDefPrimitive::U256, + Primitive::I8 => scale_info::TypeDefPrimitive::I8, + Primitive::I16 => scale_info::TypeDefPrimitive::I16, + Primitive::I32 => scale_info::TypeDefPrimitive::I32, + Primitive::I64 => scale_info::TypeDefPrimitive::I64, + Primitive::I128 => scale_info::TypeDefPrimitive::I128, + Primitive::I256 => scale_info::TypeDefPrimitive::I256, + }; + + Ok(scale_info::Type::new( + Default::default(), + core::iter::empty(), + scale_info::TypeDef::Primitive(p), + Default::default(), + )) + } + + fn visit_sequence>( + self, + path: Path, + inner_type_id: Self::TypeId, + ) -> Self::Value { + let inner_id = self.builder.add_type(inner_type_id)?; + let path = scale_info::Path { + segments: prepare_path(path, self.builder), + }; + + Ok(scale_info::Type::new( + path, + core::iter::empty(), + scale_info::TypeDef::Sequence(scale_info::TypeDefSequence { + type_param: inner_id.into(), + }), + Default::default(), + )) + } + + fn visit_composite(self, path: Path, fields: Fields) -> Self::Value + where + Path: PathIter<'info>, + Fields: FieldIter<'info, Self::TypeId>, + { + let path = scale_info::Path { + segments: prepare_path(path, self.builder), + }; + + let mut scale_info_fields = Vec::>::new(); + for field in fields { + let type_name = field.id.to_string(); + let id = self.builder.add_type(field.id)?; + scale_info_fields.push(scale_info::Field { + name: field.name.map(Into::into), + ty: id.into(), + type_name: Some(type_name), + docs: Default::default(), + }); + } + + Ok(scale_info::Type::new( + path, + core::iter::empty(), + scale_info::TypeDef::Composite(scale_info::TypeDefComposite { + fields: scale_info_fields, + }), + Default::default(), + )) + } + + fn visit_array(self, inner_type_id: LookupName, len: usize) -> Self::Value { + let inner_id = self.builder.add_type(inner_type_id)?; + + Ok(scale_info::Type::new( + Default::default(), + core::iter::empty(), + scale_info::TypeDef::Array(scale_info::TypeDefArray { + len: len as u32, + type_param: inner_id.into(), + }), + Default::default(), + )) + } + + fn visit_tuple(self, type_ids: TypeIds) -> Self::Value + where + TypeIds: ExactSizeIterator, + { + let mut scale_info_fields = Vec::new(); + for old_id in type_ids { + let new_id = self.builder.add_type(old_id)?; + scale_info_fields.push(new_id.into()); + } + + Ok(scale_info::Type::new( + Default::default(), + core::iter::empty(), + scale_info::TypeDef::Tuple(scale_info::TypeDefTuple { + fields: scale_info_fields, + }), + Default::default(), + )) + } + + fn visit_variant(self, path: Path, variants: Var) -> Self::Value + where + Path: PathIter<'info>, + Fields: FieldIter<'info, Self::TypeId>, + Var: VariantIter<'info, Fields>, + { + let path = scale_info::Path { + segments: prepare_path(path, self.builder), + }; + + let mut scale_info_variants = Vec::new(); + for variant in variants { + let mut scale_info_variant_fields = Vec::>::new(); + for field in variant.fields { + let type_name = field.id.to_string(); + let id = self.builder.add_type(field.id)?; + scale_info_variant_fields.push(scale_info::Field { + name: field.name.map(Into::into), + ty: id.into(), + type_name: Some(type_name), + docs: Default::default(), + }); + } + + scale_info_variants.push(scale_info::Variant { + name: variant.name.to_owned(), + index: variant.index, + fields: scale_info_variant_fields, + docs: Default::default(), + }) + } + + Ok(scale_info::Type::new( + path, + core::iter::empty(), + scale_info::TypeDef::Variant(scale_info::TypeDefVariant { + variants: scale_info_variants, + }), + Default::default(), + )) + } + + fn visit_compact(self, inner_type_id: Self::TypeId) -> Self::Value { + let inner_id = self.builder.add_type(inner_type_id)?; + + // Configure the path and type params to maximise compat. + let path = ["parity_scale_codec", "Compact"] + .into_iter() + .map(ToOwned::to_owned) + .collect(); + let type_params = [scale_info::TypeParameter { + name: "T".to_owned(), + ty: Some(inner_id.into()), + }]; + + Ok(scale_info::Type::new( + scale_info::Path { segments: path }, + type_params, + scale_info::TypeDef::Compact(scale_info::TypeDefCompact { + type_param: inner_id.into(), + }), + Default::default(), + )) + } + + fn visit_bit_sequence( + self, + store_format: BitsStoreFormat, + order_format: BitsOrderFormat, + ) -> Self::Value { + // These order types are added by default into a `TypeRegistry`, so we + // expect them to exist. Parsing should always succeed. + let order_ty_str = match order_format { + BitsOrderFormat::Lsb0 => "bitvec::order::Lsb0", + BitsOrderFormat::Msb0 => "bitvec::order::Msb0", + }; + let order_ty = LookupName::parse(order_ty_str).unwrap(); + let new_order_ty = self.builder.add_type(order_ty)?; + + // The store types also exist by default. Parsing should always succeed. + let store_ty_str = match store_format { + BitsStoreFormat::U8 => "u8", + BitsStoreFormat::U16 => "u16", + BitsStoreFormat::U32 => "u32", + BitsStoreFormat::U64 => "u64", + }; + let store_ty = LookupName::parse(store_ty_str).unwrap(); + let new_store_ty = self.builder.add_type(store_ty)?; + + // Configure the path and type params to look like BitVec's to try + // and maximise compatibility. + let path = ["bitvec", "vec", "BitVec"] + .into_iter() + .map(ToOwned::to_owned) + .collect(); + let type_params = [ + scale_info::TypeParameter { + name: "Store".to_owned(), + ty: Some(new_store_ty.into()), + }, + scale_info::TypeParameter { + name: "Order".to_owned(), + ty: Some(new_order_ty.into()), + }, + ]; + + Ok(scale_info::Type::new( + scale_info::Path { segments: path }, + type_params, + scale_info::TypeDef::BitSequence(scale_info::TypeDefBitSequence { + bit_order_type: new_order_ty.into(), + bit_store_type: new_store_ty.into(), + }), + Default::default(), + )) + } +} + +fn prepare_path<'info, Path: PathIter<'info>>( + path: Path, + builder: &mut PortableRegistryBuilder<'_>, +) -> Vec { + // If no sanitizint, just return the path as-is. + if !builder.sanitize_paths { + return path.map(|p| p.to_owned()).collect(); + } + + /// Names of prelude types. For codegen to work, any type that _isn't_ one of these must + /// have a path that is sensible and can be converted to module names. + static PRELUDE_TYPE_NAMES: [&str; 24] = [ + "Vec", + "Option", + "Result", + "Cow", + "BTreeMap", + "BTreeSet", + "BinaryHeap", + "VecDeque", + "LinkedList", + "Range", + "RangeInclusive", + "NonZeroI8", + "NonZeroU8", + "NonZeroI16", + "NonZeroU16", + "NonZeroI32", + "NonZeroU32", + "NonZeroI64", + "NonZeroU64", + "NonZeroI128", + "NonZeroU128", + "NonZeroIsize", + "NonZeroUsize", + "Duration", + ]; + + let path: Vec<&str> = path.collect(); + + // No path should be empty; at least the type name should be present. + if path.is_empty() { + panic!( + "Empty path is not expected when converting legacy type; type name expected at least" + ); + } + + // The special::Unknown type can be returned as is; dupe paths allowed. + if path.len() == 2 && path[0] == "special" && path[1] == "Unknown" { + return vec!["special".to_owned(), "Unknown".to_owned()]; + } + + // If non-prelude type has no path, give it one. + if path.len() == 1 && !PRELUDE_TYPE_NAMES.contains(&path[0]) { + return vec![ + "other".to_owned(), + prepare_ident(path[0], &mut builder.seen_names_in_default_path), + ]; + } + + // Non-compliant paths are converted to our default path + let non_compliant_path = path[0..path.len() - 1].iter().any(|&p| { + p.is_empty() + || p.starts_with(|c: char| !c.is_ascii_alphabetic()) + || p.contains(|c: char| !c.is_ascii_alphanumeric() || c.is_ascii_uppercase()) + }); + if non_compliant_path { + let last = *path.last().unwrap(); + return vec![ + "other".to_owned(), + prepare_ident(last, &mut builder.seen_names_in_default_path), + ]; + } + + // If path happens by chance to be ["other", Foo] then ensure Foo isn't duped + if path.len() == 2 && path[0] == "other" { + return vec![ + "other".to_owned(), + prepare_ident(path[1], &mut builder.seen_names_in_default_path), + ]; + } + + path.iter().map(|&p| p.to_owned()).collect() +} + +fn prepare_ident(base_ident: &str, seen: &mut BTreeSet) -> String { + let mut n = 1; + let mut ident = base_ident.to_owned(); + while !seen.insert(ident.clone()) { + ident = format!("{base_ident}{n}"); + n += 1; + } + ident +} + +fn unknown_type() -> scale_info::Type { + scale_info::Type::new( + scale_info::Path { + segments: Vec::from_iter(["special".to_owned(), "Unknown".to_owned()]), + }, + core::iter::empty(), + scale_info::TypeDef::Variant(scale_info::TypeDefVariant { + variants: Vec::new(), + }), + Default::default(), + ) +} diff --git a/metadata/src/from/legacy/tests.rs b/metadata/src/from/legacy/tests.rs new file mode 100644 index 00000000000..c4589d5ef24 --- /dev/null +++ b/metadata/src/from/legacy/tests.rs @@ -0,0 +1,477 @@ +use super::*; +use alloc::collections::BTreeSet; +use codec::Decode; +use core::str::FromStr; +use frame_decode::constants::ConstantTypeInfo; +use frame_decode::runtime_apis::RuntimeApiEntryInfo; +use frame_metadata::RuntimeMetadata; +use scale_info_legacy::LookupName; +use scale_type_resolver::TypeResolver; + +/// Load some legacy kusama metadata from our artifacts. +fn legacy_kusama_metadata(version: u8) -> (u64, RuntimeMetadata) { + const VERSIONS: [(u8, u64, &str); 5] = [ + (9, 1021, "metadata_v9_1021.scale"), + (10, 1038, "metadata_v10_1038.scale"), + (11, 1045, "metadata_v11_1045.scale"), + (12, 2025, "metadata_v12_2025.scale"), + (13, 9030, "metadata_v13_9030.scale"), + ]; + + let (spec_version, filename) = VERSIONS + .iter() + .find(|(v, _spec_version, _filename)| *v == version) + .map(|(_, spec_version, name)| (*spec_version, *name)) + .unwrap_or_else(|| panic!("v{version} metadata artifact does not exist")); + + let mut path = std::path::PathBuf::from_str("../artifacts/kusama/").unwrap(); + path.push(filename); + + let bytes = std::fs::read(path).expect("Could not read file"); + let metadata = RuntimeMetadata::decode(&mut &*bytes).expect("Could not SCALE decode metadata"); + + (spec_version, metadata) +} + +/// Load our kusama types. +/// TODO: This is WRONG at the moment; change to point to kusama types when they exist: +fn kusama_types() -> scale_info_legacy::ChainTypeRegistry { + frame_decode::legacy_types::polkadot::relay_chain() +} + +/// Sanitizing paths changes things between old and new, so disable this in tests by default +/// so that we can compare paths and check that by default things translate identically. +/// Tests assume that ignore_not_found is enabled, which converts not found types to +/// special::Unknown instead of returning an error. +fn test_opts() -> super::Opts { + super::Opts { + sanitize_paths: false, + ignore_not_found: true, + } +} + +/// Return a pair of original metadata + converted subxt_metadata::Metadata +fn metadata_pair( + version: u8, + opts: super::Opts, +) -> (TypeRegistrySet<'static>, RuntimeMetadata, crate::Metadata) { + let (spec_version, metadata) = legacy_kusama_metadata(version); + let types = kusama_types(); + + // Extend the types with builtins. + let types_for_spec = { + let mut types_for_spec = types.for_spec_version(spec_version).to_owned(); + let extended_types = + frame_decode::helpers::type_registry_from_metadata_any(&metadata).unwrap(); + types_for_spec.prepend(extended_types); + types_for_spec + }; + + let subxt_metadata = match &metadata { + RuntimeMetadata::V9(m) => super::from_v9(m, &types_for_spec, opts), + RuntimeMetadata::V10(m) => super::from_v10(m, &types_for_spec, opts), + RuntimeMetadata::V11(m) => super::from_v11(m, &types_for_spec, opts), + RuntimeMetadata::V12(m) => super::from_v12(m, &types_for_spec, opts), + RuntimeMetadata::V13(m) => super::from_v13(m, &types_for_spec, opts), + _ => panic!("Metadata version {} not expected", metadata.version()), + } + .expect("Could not convert to subxt_metadata::Metadata"); + + (types_for_spec, metadata, subxt_metadata) +} + +/// A representation of the shape of some type that we can compare across metadatas. +#[derive(PartialEq, Debug, Clone)] +enum Shape { + Array(Box, usize), + BitSequence( + scale_type_resolver::BitsStoreFormat, + scale_type_resolver::BitsOrderFormat, + ), + Compact(Box), + Composite(Vec, Vec<(Option, Shape)>), + Primitive(scale_type_resolver::Primitive), + Sequence(Vec, Box), + Tuple(Vec), + Variant(Vec, Vec), + // This is very important for performance; if we've already seen a variant at some path, + // we'll return just the variant path next time in this, to avoid duplicating lots of variants. + // This also eliminates recursion, since variants allow for it. + SeenVariant(Vec), +} + +#[derive(PartialEq, Debug, Clone)] +struct Variant { + index: u8, + name: String, + fields: Vec<(Option, Shape)>, +} + +impl Shape { + /// convert some modern type definition into a [`Shape`]. + fn from_modern_type(id: u32, types: &scale_info::PortableRegistry) -> Shape { + let mut seen_variants = BTreeSet::new(); + Shape::from_modern_type_inner(id, &mut seen_variants, types) + } + + fn from_modern_type_inner( + id: u32, + seen_variants: &mut BTreeSet>, + types: &scale_info::PortableRegistry, + ) -> Shape { + let visitor = + scale_type_resolver::visitor::new((seen_variants, types), |_, _| panic!("Unhandled")) + .visit_array(|(seen_variants, types), type_id, len| { + let inner = Shape::from_modern_type_inner(type_id, seen_variants, types); + Shape::Array(Box::new(inner), len) + }) + .visit_bit_sequence(|_, store, order| Shape::BitSequence(store, order)) + .visit_compact(|(seen_variants, types), type_id| { + let inner = Shape::from_modern_type_inner(type_id, seen_variants, types); + Shape::Compact(Box::new(inner)) + }) + .visit_composite(|(seen_variants, types), path, fields| { + let path = path.map(|p| p.to_owned()).collect(); + let inners = fields + .map(|field| { + let name = field.name.map(|n| n.to_owned()); + let inner = + Shape::from_modern_type_inner(field.id, seen_variants, types); + (name, inner) + }) + .collect(); + Shape::Composite(path, inners) + }) + .visit_primitive(|_types, prim| Shape::Primitive(prim)) + .visit_sequence(|(seen_variants, types), path, type_id| { + let path = path.map(|p| p.to_owned()).collect(); + let inner = Shape::from_modern_type_inner(type_id, seen_variants, types); + Shape::Sequence(path, Box::new(inner)) + }) + .visit_tuple(|(seen_variants, types), fields| { + let inners = fields + .map(|field| Shape::from_modern_type_inner(field, seen_variants, types)) + .collect(); + Shape::Tuple(inners) + }) + .visit_variant(|(seen_variants, types), path, variants| { + let path: Vec = path.map(|p| p.to_owned()).collect(); + // very important to avoid recursion and performance costs: + if !seen_variants.insert(path.clone()) { + return Shape::SeenVariant(path); + } + let variants = variants + .map(|v| Variant { + index: v.index, + name: v.name.to_owned(), + fields: v + .fields + .map(|field| { + let name = field.name.map(|n| n.to_owned()); + let inner = Shape::from_modern_type_inner( + field.id, + seen_variants, + types, + ); + (name, inner) + }) + .collect(), + }) + .collect(); + Shape::Variant(path, variants) + }) + .visit_not_found(|_types| { + panic!("PortableRegistry should not have a type which can't be found") + }); + + types.resolve_type(id, visitor).unwrap() + } + + /// convert some historic type definition into a [`Shape`]. + fn from_legacy_type(name: &LookupName, types: &TypeRegistrySet<'_>) -> Shape { + let mut seen_variants = BTreeSet::new(); + Shape::from_legacy_type_inner(name.clone(), &mut seen_variants, types) + } + + fn from_legacy_type_inner( + id: LookupName, + seen_variants: &mut BTreeSet>, + types: &TypeRegistrySet<'_>, + ) -> Shape { + let visitor = + scale_type_resolver::visitor::new((seen_variants, types), |_, _| panic!("Unhandled")) + .visit_array(|(seen_variants, types), type_id, len| { + let inner = Shape::from_legacy_type_inner(type_id, seen_variants, types); + Shape::Array(Box::new(inner), len) + }) + .visit_bit_sequence(|_types, store, order| Shape::BitSequence(store, order)) + .visit_compact(|(seen_variants, types), type_id| { + let inner = Shape::from_legacy_type_inner(type_id, seen_variants, types); + Shape::Compact(Box::new(inner)) + }) + .visit_composite(|(seen_variants, types), path, fields| { + let path = path.map(|p| p.to_owned()).collect(); + let inners = fields + .map(|field| { + let name = field.name.map(|n| n.to_owned()); + let inner = + Shape::from_legacy_type_inner(field.id, seen_variants, types); + (name, inner) + }) + .collect(); + Shape::Composite(path, inners) + }) + .visit_primitive(|_types, prim| Shape::Primitive(prim)) + .visit_sequence(|(seen_variants, types), path, type_id| { + let path = path.map(|p| p.to_owned()).collect(); + let inner = Shape::from_legacy_type_inner(type_id, seen_variants, types); + Shape::Sequence(path, Box::new(inner)) + }) + .visit_tuple(|(seen_variants, types), fields| { + let inners = fields + .map(|field| Shape::from_legacy_type_inner(field, seen_variants, types)) + .collect(); + Shape::Tuple(inners) + }) + .visit_variant(|(seen_variants, types), path, variants| { + let path: Vec = path.map(|p| p.to_owned()).collect(); + // very important to avoid recursion and performance costs: + if !seen_variants.insert(path.clone()) { + return Shape::SeenVariant(path); + } + let variants = variants + .map(|v| Variant { + index: v.index, + name: v.name.to_owned(), + fields: v + .fields + .map(|field| { + let name = field.name.map(|n| n.to_owned()); + let inner = Shape::from_legacy_type_inner( + field.id, + seen_variants, + types, + ); + (name, inner) + }) + .collect(), + }) + .collect(); + Shape::Variant(path, variants) + }) + .visit_not_found(|(seen_variants, _)| { + // When we convert legacy to modern types, any types we don't find + // are replaced with empty variants (since we can't have dangling types + // in our new PortableRegistry). Do the same here so they compare equal. + Shape::from_legacy_type_inner( + LookupName::parse("special::Unknown").unwrap(), + seen_variants, + types, + ) + }); + + types.resolve_type(id, visitor).unwrap() + } +} + +// Go over all of the constants listed via frame-decode and check that our old +// and new metadatas both have identical output. +macro_rules! constants_eq { + ($name:ident, $version:literal, $version_path:ident) => { + #[test] + fn $name() { + let (old_types, old_md, new_md) = metadata_pair($version, test_opts()); + let RuntimeMetadata::$version_path(old_md) = old_md else { + panic!("Wrong version") + }; + + let old: Vec<_> = old_md + .constant_tuples() + .map(|(p, n)| old_md.constant_info(&p, &n).unwrap()) + .map(|c| { + ( + c.bytes.to_owned(), + Shape::from_legacy_type(&c.type_id, &old_types), + ) + }) + .collect(); + let new: Vec<_> = new_md + .constant_tuples() + .map(|(p, n)| new_md.constant_info(&p, &n).unwrap()) + .map(|c| { + ( + c.bytes.to_owned(), + Shape::from_modern_type(c.type_id, new_md.types()), + ) + }) + .collect(); + + assert_eq!(old, new); + } + }; +} + +constants_eq!(v9_constants_eq, 9, V9); +constants_eq!(v10_constants_eq, 10, V10); +constants_eq!(v11_constants_eq, 11, V11); +constants_eq!(v12_constants_eq, 12, V12); +constants_eq!(v13_constants_eq, 13, V13); + +/// Make sure all Runtime APIs are the same once translated. +#[test] +fn runtime_apis() { + for version in 9..=13 { + let (old_types, _old_md, new_md) = metadata_pair(version, test_opts()); + + let old: Vec<_> = old_types + .runtime_api_tuples() + .map(|(p, n)| { + old_types + .runtime_api_info(&p, &n) + .unwrap() + .map_ids(|id| Ok::<_, ()>(Shape::from_legacy_type(&id, &old_types))) + .unwrap() + }) + .collect(); + let new: Vec<_> = new_md + .runtime_api_tuples() + .map(|(p, n)| { + new_md + .runtime_api_info(&p, &n) + .unwrap() + .map_ids(|id| Ok::<_, ()>(Shape::from_modern_type(id, new_md.types()))) + .unwrap() + }) + .collect(); + + assert_eq!(old, new); + } +} + +macro_rules! storage_eq { + ($name:ident, $version:literal, $version_path:ident) => { + #[test] + fn $name() { + let (old_types, old_md, new_md) = metadata_pair($version, test_opts()); + let RuntimeMetadata::$version_path(old_md) = old_md else { + panic!("Wrong version") + }; + + let old: Vec<_> = old_md + .storage_tuples() + .map(|(p, n)| { + let info = old_md + .storage_info(&p, &n) + .unwrap() + .map_ids(|id| Ok::<_, ()>(Shape::from_legacy_type(&id, &old_types))) + .unwrap(); + (p.into_owned(), n.into_owned(), info) + }) + .collect(); + + let new: Vec<_> = new_md + .storage_tuples() + .map(|(p, n)| { + let info = new_md + .storage_info(&p, &n) + .unwrap() + .map_ids(|id| Ok::<_, ()>(Shape::from_modern_type(id, new_md.types()))) + .unwrap(); + (p.into_owned(), n.into_owned(), info) + }) + .collect(); + + if old.len() != new.len() { + panic!("Storage entries for version 9 metadata differ in length"); + } + + for (old, new) in old.into_iter().zip(new.into_iter()) { + assert_eq!((&old.0, &old.1), (&new.0, &new.1), "Storage entry mismatch"); + assert_eq!( + old.2, new.2, + "Storage entry {}.{} does not match!", + old.0, old.1 + ); + } + } + }; +} + +storage_eq!(v9_storage_eq, 9, V9); +storage_eq!(v10_storage_eq, 10, V10); +storage_eq!(v11_storage_eq, 11, V11); +storage_eq!(v12_storage_eq, 12, V12); +storage_eq!(v13_storage_eq, 13, V13); + +#[test] +fn builtin_call() { + for version in 9..=13 { + let (old_types, _old_md, new_md) = metadata_pair(version, test_opts()); + + let old = Shape::from_legacy_type(&LookupName::parse("builtin::Call").unwrap(), &old_types); + let new = Shape::from_modern_type(new_md.outer_enums.call_enum_ty, new_md.types()); + assert_eq!(old, new, "Call types do not match in metadata V{version}!"); + } +} + +#[test] +fn builtin_error() { + for version in 9..=13 { + let (old_types, _old_md, new_md) = metadata_pair(version, test_opts()); + + let old = + Shape::from_legacy_type(&LookupName::parse("builtin::Error").unwrap(), &old_types); + let new = Shape::from_modern_type(new_md.outer_enums.error_enum_ty, new_md.types()); + assert_eq!(old, new, "Error types do not match in metadata V{version}!"); + } +} + +#[test] +fn builtin_event() { + for version in 9..=13 { + let (old_types, _old_md, new_md) = metadata_pair(version, test_opts()); + + let old = + Shape::from_legacy_type(&LookupName::parse("builtin::Event").unwrap(), &old_types); + let new = Shape::from_modern_type(new_md.outer_enums.event_enum_ty, new_md.types()); + assert_eq!(old, new, "Event types do not match in metadata V{version}!"); + } +} + +#[test] +fn codegen_works() { + for version in 9..=13 { + // We need to do this against `subxt_codegen::Metadata` and so cannot re-use our + // test functions for it. This is because the compiler sees some difference between + // `subxct_codegen::Metadata` and `crate::Metadata` even though they should be identical. + let new_md = { + let (spec_version, metadata) = legacy_kusama_metadata(version); + let types = kusama_types(); + + let types_for_spec = { + let mut types_for_spec = types.for_spec_version(spec_version).to_owned(); + let extended_types = + frame_decode::helpers::type_registry_from_metadata_any(&metadata).unwrap(); + types_for_spec.prepend(extended_types); + types_for_spec + }; + + match &metadata { + RuntimeMetadata::V9(m) => subxt_codegen::Metadata::from_v9(m, &types_for_spec), + RuntimeMetadata::V10(m) => subxt_codegen::Metadata::from_v10(m, &types_for_spec), + RuntimeMetadata::V11(m) => subxt_codegen::Metadata::from_v11(m, &types_for_spec), + RuntimeMetadata::V12(m) => subxt_codegen::Metadata::from_v12(m, &types_for_spec), + RuntimeMetadata::V13(m) => subxt_codegen::Metadata::from_v13(m, &types_for_spec), + _ => panic!("Metadata version {} not expected", metadata.version()), + } + .expect("Could not convert to subxt_metadata::Metadata") + }; + + // We only test that generation succeeds without any errors, not necessarily that it's 100% useful: + let codegen = subxt_codegen::CodegenBuilder::new(); + let _ = codegen + .generate(new_md) + .map_err(|e| e.into_compile_error()) + .unwrap_or_else(|e| panic!("Codegen failed for metadata V{version}: {e}")); + } +} diff --git a/metadata/src/from/mod.rs b/metadata/src/from/mod.rs index 777b00451fd..5a5ed0c55b3 100644 --- a/metadata/src/from/mod.rs +++ b/metadata/src/from/mod.rs @@ -8,6 +8,10 @@ mod v14; mod v15; mod v16; +/// Legacy translation hidden behind the corresponding feature flag. +#[cfg(feature = "legacy")] +pub mod legacy; + /// 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. @@ -33,6 +37,15 @@ pub enum TryFromError { /// Invalid type path. #[error("Type has an invalid path {0}")] InvalidTypePath(String), + /// Cannot decode storage entry information. + #[error("Error decoding storage entry information: {0}")] + StorageInfoError(#[from] frame_decode::storage::StorageInfoError<'static>), + /// Cannot decode Runtime API information. + #[error("Error decoding Runtime API information: {0}")] + RuntimeInfoError(#[from] frame_decode::runtime_apis::RuntimeApiInfoError<'static>), + /// Cannot decode View Function information. + #[error("Error decoding View Function information: {0}")] + ViewFunctionInfoError(#[from] frame_decode::view_functions::ViewFunctionInfoError<'static>), } impl TryFrom for crate::Metadata { diff --git a/metadata/src/from/v14.rs b/metadata/src/from/v14.rs index 5326f158bce..ee31cd85376 100644 --- a/metadata/src/from/v14.rs +++ b/metadata/src/from/v14.rs @@ -6,9 +6,8 @@ use super::TryFromError; use crate::utils::variant_index::VariantIndex; use crate::{ - ArcStr, ConstantMetadata, CustomMetadataInner, ExtrinsicMetadata, Metadata, OuterEnumsMetadata, - PalletMetadataInner, StorageEntryMetadata, StorageEntryModifier, StorageEntryType, - StorageHasher, StorageMetadata, TransactionExtensionMetadataInner, + ConstantMetadata, CustomMetadataInner, ExtrinsicMetadata, Metadata, OuterEnumsMetadata, + PalletMetadataInner, StorageEntryMetadata, StorageMetadata, TransactionExtensionMetadataInner, utils::ordered_map::OrderedMap, }; use alloc::borrow::ToOwned; @@ -16,6 +15,7 @@ use alloc::collections::BTreeMap; use alloc::string::String; use alloc::vec::Vec; use alloc::{format, vec}; +use frame_decode::storage::StorageTypeInfo; use frame_metadata::v14; use hashbrown::HashMap; use scale_info::form::PortableForm; @@ -28,23 +28,37 @@ impl TryFrom for Metadata { let mut pallets = OrderedMap::new(); let mut pallets_by_index = HashMap::new(); - for (pos, p) in m.pallets.into_iter().enumerate() { - let name: ArcStr = p.name.into(); - - let storage = p.storage.map(|s| StorageMetadata { - prefix: s.prefix, - entries: s - .entries - .into_iter() - .map(|s| { - let name: ArcStr = s.name.clone().into(); - (name.clone(), from_storage_entry_metadata(name, s)) - }) - .collect(), - }); - let constants = p.constants.into_iter().map(|c| { - let name: ArcStr = c.name.clone().into(); - (name.clone(), from_constant_metadata(name, c)) + for (pos, p) in m.pallets.iter().enumerate() { + let name: String = p.name.clone(); + + let storage = match &p.storage { + None => None, + Some(s) => Some(StorageMetadata { + prefix: s.prefix.clone(), + entries: s + .entries + .iter() + .map(|s| { + let entry_name: String = s.name.clone(); + let storage_info = m + .storage_info(&name, &entry_name) + .map_err(|e| e.into_owned())? + .into_owned(); + let storage_entry = StorageEntryMetadata { + name: entry_name.clone(), + info: storage_info, + docs: s.docs.clone(), + }; + + Ok::<_, TryFromError>((entry_name, storage_entry)) + }) + .collect::>()?, + }), + }; + + let constants = p.constants.iter().map(|c| { + let name = c.name.clone(); + (name, from_constant_metadata(c.clone())) }); let call_variant_index = @@ -58,14 +72,16 @@ impl TryFrom for Metadata { pallets.push_insert( name.clone(), PalletMetadataInner { - name, - index: p.index, + name: name.clone(), + call_index: p.index, + event_index: p.index, + error_index: p.index, storage, - call_ty: p.calls.map(|c| c.ty.id), + call_ty: p.calls.as_ref().map(|c| c.ty.id), call_variant_index, - event_ty: p.event.map(|e| e.ty.id), + event_ty: p.event.as_ref().map(|e| e.ty.id), event_variant_index, - error_ty: p.error.map(|e| e.ty.id), + error_ty: p.error.as_ref().map(|e| e.ty.id), error_variant_index, constants: constants.collect(), view_functions: Default::default(), @@ -85,7 +101,9 @@ impl TryFrom for Metadata { Ok(Metadata { types: m.types, pallets, - pallets_by_index, + pallets_by_call_index: pallets_by_index.clone(), + pallets_by_error_index: pallets_by_index.clone(), + pallets_by_event_index: pallets_by_index, extrinsic: from_extrinsic_metadata(m.extrinsic, missing_extrinsic_type_ids), dispatch_error_ty, outer_enums: OuterEnumsMetadata { @@ -135,59 +153,9 @@ fn from_extrinsic_metadata( } } -fn from_storage_hasher(value: v14::StorageHasher) -> StorageHasher { - match value { - v14::StorageHasher::Blake2_128 => StorageHasher::Blake2_128, - v14::StorageHasher::Blake2_256 => StorageHasher::Blake2_256, - v14::StorageHasher::Blake2_128Concat => StorageHasher::Blake2_128Concat, - v14::StorageHasher::Twox128 => StorageHasher::Twox128, - v14::StorageHasher::Twox256 => StorageHasher::Twox256, - v14::StorageHasher::Twox64Concat => StorageHasher::Twox64Concat, - v14::StorageHasher::Identity => StorageHasher::Identity, - } -} - -fn from_storage_entry_type(value: v14::StorageEntryType) -> StorageEntryType { - match value { - v14::StorageEntryType::Plain(ty) => StorageEntryType::Plain(ty.id), - v14::StorageEntryType::Map { - hashers, - key, - value, - } => StorageEntryType::Map { - hashers: hashers.into_iter().map(from_storage_hasher).collect(), - key_ty: key.id, - value_ty: value.id, - }, - } -} - -fn from_storage_entry_modifier(value: v14::StorageEntryModifier) -> StorageEntryModifier { - match value { - v14::StorageEntryModifier::Optional => StorageEntryModifier::Optional, - v14::StorageEntryModifier::Default => StorageEntryModifier::Default, - } -} - -fn from_storage_entry_metadata( - name: ArcStr, - s: v14::StorageEntryMetadata, -) -> StorageEntryMetadata { - StorageEntryMetadata { - name, - modifier: from_storage_entry_modifier(s.modifier), - entry_type: from_storage_entry_type(s.ty), - default: s.default, - docs: s.docs, - } -} - -fn from_constant_metadata( - name: ArcStr, - s: v14::PalletConstantMetadata, -) -> ConstantMetadata { +fn from_constant_metadata(s: v14::PalletConstantMetadata) -> ConstantMetadata { ConstantMetadata { - name, + name: s.name, ty: s.ty.id, value: s.value, docs: s.docs, diff --git a/metadata/src/from/v15.rs b/metadata/src/from/v15.rs index 3fc0f07db9a..0a170c1cde2 100644 --- a/metadata/src/from/v15.rs +++ b/metadata/src/from/v15.rs @@ -6,14 +6,15 @@ use super::TryFromError; use crate::utils::variant_index::VariantIndex; use crate::{ - ArcStr, ConstantMetadata, ExtrinsicMetadata, Metadata, MethodParamMetadata, OuterEnumsMetadata, - PalletMetadataInner, RuntimeApiMetadataInner, RuntimeApiMethodMetadataInner, - StorageEntryMetadata, StorageEntryModifier, StorageEntryType, StorageHasher, StorageMetadata, + ConstantMetadata, ExtrinsicMetadata, Metadata, OuterEnumsMetadata, PalletMetadataInner, + RuntimeApiMetadataInner, RuntimeApiMethodMetadataInner, StorageEntryMetadata, StorageMetadata, TransactionExtensionMetadataInner, utils::ordered_map::OrderedMap, }; use alloc::collections::BTreeMap; use alloc::vec; use alloc::vec::Vec; +use frame_decode::runtime_apis::RuntimeApiTypeInfo; +use frame_decode::storage::StorageTypeInfo; use frame_metadata::v15; use hashbrown::HashMap; use scale_info::form::PortableForm; @@ -23,23 +24,37 @@ impl TryFrom for Metadata { fn try_from(m: v15::RuntimeMetadataV15) -> Result { let mut pallets = OrderedMap::new(); let mut pallets_by_index = HashMap::new(); - for (pos, p) in m.pallets.into_iter().enumerate() { - let name: ArcStr = p.name.into(); - - let storage = p.storage.map(|s| StorageMetadata { - prefix: s.prefix, - entries: s - .entries - .into_iter() - .map(|s| { - let name: ArcStr = s.name.clone().into(); - (name.clone(), from_storage_entry_metadata(name, s)) - }) - .collect(), - }); - let constants = p.constants.into_iter().map(|c| { - let name: ArcStr = c.name.clone().into(); - (name.clone(), from_constant_metadata(name, c)) + for (pos, p) in m.pallets.iter().enumerate() { + let name = p.name.clone(); + + let storage = match &p.storage { + None => None, + Some(s) => Some(StorageMetadata { + prefix: s.prefix.clone(), + entries: s + .entries + .iter() + .map(|s| { + let entry_name = s.name.clone(); + let storage_info = m + .storage_info(&name, &entry_name) + .map_err(|e| e.into_owned())? + .into_owned(); + let storage_entry = StorageEntryMetadata { + name: entry_name.clone(), + info: storage_info, + docs: s.docs.clone(), + }; + + Ok::<_, TryFromError>((entry_name, storage_entry)) + }) + .collect::>()?, + }), + }; + + let constants = p.constants.iter().map(|c| { + let name = c.name.clone(); + (name, from_constant_metadata(c.clone())) }); let call_variant_index = @@ -54,26 +69,54 @@ impl TryFrom for Metadata { name.clone(), PalletMetadataInner { name, - index: p.index, + call_index: p.index, + event_index: p.index, + error_index: p.index, storage, - call_ty: p.calls.map(|c| c.ty.id), + call_ty: p.calls.as_ref().map(|c| c.ty.id), call_variant_index, - event_ty: p.event.map(|e| e.ty.id), + event_ty: p.event.as_ref().map(|e| e.ty.id), event_variant_index, - error_ty: p.error.map(|e| e.ty.id), + error_ty: p.error.as_ref().map(|e| e.ty.id), error_variant_index, constants: constants.collect(), view_functions: Default::default(), associated_types: Default::default(), - docs: p.docs, + docs: p.docs.clone(), }, ); } - let apis = m.apis.into_iter().map(|api| { - let name: ArcStr = api.name.clone().into(); - (name.clone(), from_runtime_api_metadata(name, api)) - }); + let apis = m + .apis + .iter() + .map(|api| { + let trait_name = api.name.clone(); + let methods = api + .methods + .iter() + .map(|method| { + let method_name = method.name.clone(); + let method_info = RuntimeApiMethodMetadataInner { + info: m + .runtime_api_info(&trait_name, &method.name) + .map_err(|e| e.into_owned())? + .into_owned(), + name: method.name.clone(), + docs: method.docs.clone(), + }; + Ok((method_name, method_info)) + }) + .collect::>()?; + + let runtime_api_metadata = RuntimeApiMetadataInner { + name: trait_name.clone(), + methods, + docs: api.docs.clone(), + }; + Ok((trait_name, runtime_api_metadata)) + }) + .collect::>()?; let dispatch_error_ty = m .types @@ -85,10 +128,12 @@ impl TryFrom for Metadata { Ok(Metadata { types: m.types, pallets, - pallets_by_index, + pallets_by_call_index: pallets_by_index.clone(), + pallets_by_error_index: pallets_by_index.clone(), + pallets_by_event_index: pallets_by_index, extrinsic: from_extrinsic_metadata(m.extrinsic), dispatch_error_ty, - apis: apis.collect(), + apis, outer_enums: OuterEnumsMetadata { call_enum_ty: m.outer_enums.call_enum_ty.id, event_enum_ty: m.outer_enums.event_enum_ty.id, @@ -130,104 +175,11 @@ fn from_extrinsic_metadata(value: v15::ExtrinsicMetadata) -> Extri } } -fn from_storage_hasher(value: v15::StorageHasher) -> StorageHasher { - match value { - v15::StorageHasher::Blake2_128 => StorageHasher::Blake2_128, - v15::StorageHasher::Blake2_256 => StorageHasher::Blake2_256, - v15::StorageHasher::Blake2_128Concat => StorageHasher::Blake2_128Concat, - v15::StorageHasher::Twox128 => StorageHasher::Twox128, - v15::StorageHasher::Twox256 => StorageHasher::Twox256, - v15::StorageHasher::Twox64Concat => StorageHasher::Twox64Concat, - v15::StorageHasher::Identity => StorageHasher::Identity, - } -} - -fn from_storage_entry_type(value: v15::StorageEntryType) -> StorageEntryType { - match value { - v15::StorageEntryType::Plain(ty) => StorageEntryType::Plain(ty.id), - v15::StorageEntryType::Map { - hashers, - key, - value, - } => StorageEntryType::Map { - hashers: hashers.into_iter().map(from_storage_hasher).collect(), - key_ty: key.id, - value_ty: value.id, - }, - } -} - -fn from_storage_entry_modifier(value: v15::StorageEntryModifier) -> StorageEntryModifier { - match value { - v15::StorageEntryModifier::Optional => StorageEntryModifier::Optional, - v15::StorageEntryModifier::Default => StorageEntryModifier::Default, - } -} - -fn from_storage_entry_metadata( - name: ArcStr, - s: v15::StorageEntryMetadata, -) -> StorageEntryMetadata { - StorageEntryMetadata { - name, - modifier: from_storage_entry_modifier(s.modifier), - entry_type: from_storage_entry_type(s.ty), - default: s.default, - docs: s.docs, - } -} - -fn from_constant_metadata( - name: ArcStr, - s: v15::PalletConstantMetadata, -) -> ConstantMetadata { +fn from_constant_metadata(s: v15::PalletConstantMetadata) -> ConstantMetadata { ConstantMetadata { - name, + name: s.name, ty: s.ty.id, value: s.value, docs: s.docs, } } - -fn from_runtime_api_metadata( - name: ArcStr, - s: v15::RuntimeApiMetadata, -) -> RuntimeApiMetadataInner { - RuntimeApiMetadataInner { - name, - docs: s.docs, - methods: s - .methods - .into_iter() - .map(|m| { - let name: ArcStr = m.name.clone().into(); - (name.clone(), from_runtime_api_method_metadata(name, m)) - }) - .collect(), - } -} - -fn from_runtime_api_method_metadata( - name: ArcStr, - s: v15::RuntimeApiMethodMetadata, -) -> RuntimeApiMethodMetadataInner { - RuntimeApiMethodMetadataInner { - name, - inputs: s - .inputs - .into_iter() - .map(from_runtime_api_method_param_metadata) - .collect(), - output_ty: s.output.id, - docs: s.docs, - } -} - -fn from_runtime_api_method_param_metadata( - s: v15::RuntimeApiMethodParamMetadata, -) -> MethodParamMetadata { - MethodParamMetadata { - name: s.name, - ty: s.ty.id, - } -} diff --git a/metadata/src/from/v16.rs b/metadata/src/from/v16.rs index 53a0d26a1fa..83696202646 100644 --- a/metadata/src/from/v16.rs +++ b/metadata/src/from/v16.rs @@ -6,11 +6,13 @@ use super::TryFromError; use crate::utils::variant_index::VariantIndex; use crate::{ - ArcStr, ConstantMetadata, ExtrinsicMetadata, Metadata, MethodParamMetadata, OuterEnumsMetadata, - PalletMetadataInner, RuntimeApiMetadataInner, RuntimeApiMethodMetadataInner, - StorageEntryMetadata, StorageEntryModifier, StorageEntryType, StorageHasher, StorageMetadata, + ConstantMetadata, ExtrinsicMetadata, Metadata, OuterEnumsMetadata, PalletMetadataInner, + RuntimeApiMetadataInner, RuntimeApiMethodMetadataInner, StorageEntryMetadata, StorageMetadata, TransactionExtensionMetadataInner, ViewFunctionMetadataInner, utils::ordered_map::OrderedMap, }; +use frame_decode::runtime_apis::RuntimeApiTypeInfo; +use frame_decode::storage::StorageTypeInfo; +use frame_decode::view_functions::ViewFunctionTypeInfo; use frame_metadata::{v15, v16}; use hashbrown::HashMap; use scale_info::form::PortableForm; @@ -18,43 +20,67 @@ use scale_info::form::PortableForm; impl TryFrom for Metadata { type Error = TryFromError; fn try_from(m: v16::RuntimeMetadataV16) -> Result { - let types = m.types; + let types = &m.types; let mut pallets = OrderedMap::new(); let mut pallets_by_index = HashMap::new(); - for (pos, p) in m.pallets.into_iter().enumerate() { - let name: ArcStr = p.name.into(); - - let storage = p.storage.map(|s| StorageMetadata { - prefix: s.prefix, - entries: s - .entries - .into_iter() - .map(|s| { - let name: ArcStr = s.name.clone().into(); - (name.clone(), from_storage_entry_metadata(name, s)) - }) - .collect(), - }); - let constants = p.constants.into_iter().map(|c| { - let name: ArcStr = c.name.clone().into(); - (name.clone(), from_constant_metadata(name, c)) - }); - let view_functions = p.view_functions.into_iter().map(|v| { - let name: ArcStr = v.name.clone().into(); - (name.clone(), from_view_function_metadata(name, v)) + for (pos, p) in m.pallets.iter().enumerate() { + let name = p.name.clone(); + + let storage = match &p.storage { + None => None, + Some(s) => Some(StorageMetadata { + prefix: s.prefix.clone(), + entries: s + .entries + .iter() + .map(|s| { + let entry_name = s.name.clone(); + let storage_info = m + .storage_info(&name, &entry_name) + .map_err(|e| e.into_owned())? + .into_owned(); + let storage_entry = StorageEntryMetadata { + name: entry_name.clone(), + info: storage_info, + docs: s.docs.clone(), + }; + + Ok::<_, TryFromError>((entry_name, storage_entry)) + }) + .collect::>()?, + }), + }; + + let view_functions = p + .view_functions + .iter() + .map(|vf| { + let view_function_metadata = ViewFunctionMetadataInner { + name: vf.name.clone(), + info: m + .view_function_info(&name, &vf.name) + .map_err(|e| e.into_owned())? + .into_owned(), + docs: vf.docs.clone(), + }; + Ok((vf.name.clone(), view_function_metadata)) + }) + .collect::>()?; + + let constants = p.constants.iter().map(|c| { + let name = c.name.clone(); + (name, from_constant_metadata(c.clone())) }); - let call_variant_index = VariantIndex::build(p.calls.as_ref().map(|c| c.ty.id), &types); - let error_variant_index = - VariantIndex::build(p.error.as_ref().map(|e| e.ty.id), &types); - let event_variant_index = - VariantIndex::build(p.event.as_ref().map(|e| e.ty.id), &types); + let call_variant_index = VariantIndex::build(p.calls.as_ref().map(|c| c.ty.id), types); + let error_variant_index = VariantIndex::build(p.error.as_ref().map(|e| e.ty.id), types); + let event_variant_index = VariantIndex::build(p.event.as_ref().map(|e| e.ty.id), types); let associated_types = p .associated_types - .into_iter() - .map(|t| (t.name, t.ty.id)) + .iter() + .map(|t| (t.name.clone(), t.ty.id)) .collect(); pallets_by_index.insert(p.index, pos); @@ -62,26 +88,54 @@ impl TryFrom for Metadata { name.clone(), PalletMetadataInner { name, - index: p.index, + call_index: p.index, + event_index: p.index, + error_index: p.index, storage, - call_ty: p.calls.map(|c| c.ty.id), + call_ty: p.calls.as_ref().map(|c| c.ty.id), call_variant_index, - event_ty: p.event.map(|e| e.ty.id), + event_ty: p.event.as_ref().map(|e| e.ty.id), event_variant_index, - error_ty: p.error.map(|e| e.ty.id), + error_ty: p.error.as_ref().map(|e| e.ty.id), error_variant_index, constants: constants.collect(), - view_functions: view_functions.collect(), + view_functions, associated_types, - docs: p.docs, + docs: p.docs.clone(), }, ); } - let apis = m.apis.into_iter().map(|api| { - let name: ArcStr = api.name.clone().into(); - (name.clone(), from_runtime_api_metadata(name, api)) - }); + let apis = m + .apis + .iter() + .map(|api| { + let trait_name = api.name.clone(); + let methods = api + .methods + .iter() + .map(|method| { + let method_name = method.name.clone(); + let method_info = RuntimeApiMethodMetadataInner { + info: m + .runtime_api_info(&trait_name, &method.name) + .map_err(|e| e.into_owned())? + .into_owned(), + name: method.name.clone(), + docs: method.docs.clone(), + }; + Ok((method_name, method_info)) + }) + .collect::>()?; + + let runtime_api_metadata = RuntimeApiMetadataInner { + name: trait_name.clone(), + methods, + docs: api.docs.clone(), + }; + Ok((trait_name, runtime_api_metadata)) + }) + .collect::>()?; let custom_map = m .custom @@ -103,12 +157,14 @@ impl TryFrom for Metadata { .map(|ty| ty.id); Ok(Metadata { - types, + types: m.types, pallets, - pallets_by_index, + pallets_by_call_index: pallets_by_index.clone(), + pallets_by_error_index: pallets_by_index.clone(), + pallets_by_event_index: pallets_by_index, extrinsic: from_extrinsic_metadata(m.extrinsic), dispatch_error_ty, - apis: apis.collect(), + apis, outer_enums: OuterEnumsMetadata { call_enum_ty: m.outer_enums.call_enum_ty.id, event_enum_ty: m.outer_enums.event_enum_ty.id, @@ -147,118 +203,11 @@ fn from_extrinsic_metadata(value: v16::ExtrinsicMetadata) -> Extri } } -fn from_storage_hasher(value: v16::StorageHasher) -> StorageHasher { - match value { - v16::StorageHasher::Blake2_128 => StorageHasher::Blake2_128, - v16::StorageHasher::Blake2_256 => StorageHasher::Blake2_256, - v16::StorageHasher::Blake2_128Concat => StorageHasher::Blake2_128Concat, - v16::StorageHasher::Twox128 => StorageHasher::Twox128, - v16::StorageHasher::Twox256 => StorageHasher::Twox256, - v16::StorageHasher::Twox64Concat => StorageHasher::Twox64Concat, - v16::StorageHasher::Identity => StorageHasher::Identity, - } -} - -fn from_storage_entry_type(value: v16::StorageEntryType) -> StorageEntryType { - match value { - v16::StorageEntryType::Plain(ty) => StorageEntryType::Plain(ty.id), - v16::StorageEntryType::Map { - hashers, - key, - value, - } => StorageEntryType::Map { - hashers: hashers.into_iter().map(from_storage_hasher).collect(), - key_ty: key.id, - value_ty: value.id, - }, - } -} - -fn from_storage_entry_modifier(value: v16::StorageEntryModifier) -> StorageEntryModifier { - match value { - v16::StorageEntryModifier::Optional => StorageEntryModifier::Optional, - v16::StorageEntryModifier::Default => StorageEntryModifier::Default, - } -} - -fn from_storage_entry_metadata( - name: ArcStr, - s: v16::StorageEntryMetadata, -) -> StorageEntryMetadata { - StorageEntryMetadata { - name, - modifier: from_storage_entry_modifier(s.modifier), - entry_type: from_storage_entry_type(s.ty), - default: s.default, - docs: s.docs, - } -} - -fn from_constant_metadata( - name: ArcStr, - s: v16::PalletConstantMetadata, -) -> ConstantMetadata { +fn from_constant_metadata(s: v16::PalletConstantMetadata) -> ConstantMetadata { ConstantMetadata { - name, + name: s.name, ty: s.ty.id, value: s.value, docs: s.docs, } } - -fn from_runtime_api_metadata( - name: ArcStr, - s: v16::RuntimeApiMetadata, -) -> RuntimeApiMetadataInner { - RuntimeApiMetadataInner { - name, - docs: s.docs, - methods: s - .methods - .into_iter() - .map(|m| { - let name: ArcStr = m.name.clone().into(); - (name.clone(), from_runtime_api_method_metadata(name, m)) - }) - .collect(), - } -} - -fn from_runtime_api_method_metadata( - name: ArcStr, - s: v16::RuntimeApiMethodMetadata, -) -> RuntimeApiMethodMetadataInner { - RuntimeApiMethodMetadataInner { - name, - inputs: s - .inputs - .into_iter() - .map(|param| MethodParamMetadata { - name: param.name, - ty: param.ty.id, - }) - .collect(), - output_ty: s.output.id, - docs: s.docs, - } -} - -fn from_view_function_metadata( - name: ArcStr, - s: v16::PalletViewFunctionMetadata, -) -> ViewFunctionMetadataInner { - ViewFunctionMetadataInner { - name, - query_id: s.id, - inputs: s - .inputs - .into_iter() - .map(|param| MethodParamMetadata { - name: param.name, - ty: param.ty.id, - }) - .collect(), - output_ty: s.output.id, - docs: s.docs, - } -} diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs index f680b36883c..daadc372057 100644 --- a/metadata/src/lib.rs +++ b/metadata/src/lib.rs @@ -24,13 +24,22 @@ mod utils; use alloc::borrow::Cow; use alloc::collections::BTreeMap; -use alloc::string::String; -use alloc::sync::Arc; +use alloc::string::{String, ToString}; use alloc::vec::Vec; +use frame_decode::constants::{ConstantEntry, ConstantInfo, ConstantInfoError}; +use frame_decode::custom_values::{CustomValue, CustomValueInfo, CustomValueInfoError}; use frame_decode::extrinsics::{ ExtrinsicCallInfo, ExtrinsicExtensionInfo, ExtrinsicInfoArg, ExtrinsicInfoError, ExtrinsicSignatureInfo, }; +use frame_decode::runtime_apis::{ + RuntimeApiEntry, RuntimeApiInfo, RuntimeApiInfoError, RuntimeApiInput, +}; +use frame_decode::storage::{StorageEntry, StorageInfo, StorageInfoError, StorageKeyInfo}; +use frame_decode::view_functions::{ + ViewFunctionEntry, ViewFunctionInfo, ViewFunctionInfoError, ViewFunctionInput, +}; + use hashbrown::HashMap; use scale_info::{PortableRegistry, Variant, form::PortableForm}; use utils::{ @@ -39,12 +48,14 @@ use utils::{ variant_index::VariantIndex, }; -type ArcStr = Arc; - +pub use frame_decode::storage::StorageHasher; pub use from::SUPPORTED_METADATA_VERSIONS; pub use from::TryFromError; pub use utils::validation::MetadataHasher; +#[cfg(feature = "legacy")] +pub use from::legacy::Error as LegacyFromError; + type CustomMetadataInner = frame_metadata::v15::CustomMetadata; /// Node metadata. This can be constructed by providing some compatible [`frame_metadata`] @@ -55,9 +66,19 @@ pub struct Metadata { /// Type registry containing all types used in the metadata. types: PortableRegistry, /// Metadata of all the pallets. - pallets: OrderedMap, - /// Find the location in the pallet Vec by pallet index. - pallets_by_index: HashMap, + pallets: OrderedMap, + /// Find the pallet for a given call index. + pallets_by_call_index: HashMap, + /// Find the pallet for a given event index. + /// + /// for modern metadatas, this is the same as pallets_by_call_index, + /// but for old metadatas this can vary. + pallets_by_event_index: HashMap, + /// Find the pallet for a given error index. + /// + /// for modern metadatas, this is the same as pallets_by_call_index, + /// but for old metadatas this can vary. + pallets_by_error_index: HashMap, /// Metadata of the extrinsic. extrinsic: ExtrinsicMetadata, /// The types of the outer enums. @@ -65,7 +86,7 @@ pub struct Metadata { /// The type Id of the `DispatchError` type, which Subxt makes use of. dispatch_error_ty: Option, /// Details about each of the runtime API traits. - apis: OrderedMap, + apis: OrderedMap, /// Allows users to add custom types to the metadata. A map that associates a string key to a `CustomValueMetadata`. custom: CustomMetadataInner, } @@ -75,12 +96,12 @@ pub struct Metadata { impl frame_decode::extrinsics::ExtrinsicTypeInfo for Metadata { type TypeId = u32; - fn get_call_info( + fn extrinsic_call_info( &self, pallet_index: u8, call_index: u8, ) -> Result, ExtrinsicInfoError<'_>> { - let pallet = self.pallet_by_index(pallet_index).ok_or({ + let pallet = self.pallet_by_call_index(pallet_index).ok_or({ ExtrinsicInfoError::PalletNotFound { index: pallet_index, } @@ -108,7 +129,7 @@ impl frame_decode::extrinsics::ExtrinsicTypeInfo for Metadata { }) } - fn get_signature_info( + fn extrinsic_signature_info( &self, ) -> Result, ExtrinsicInfoError<'_>> { Ok(ExtrinsicSignatureInfo { @@ -117,7 +138,7 @@ impl frame_decode::extrinsics::ExtrinsicTypeInfo for Metadata { }) } - fn get_extension_info( + fn extrinsic_extension_info( &self, extension_version: Option, ) -> Result, ExtrinsicInfoError<'_>> { @@ -142,8 +163,292 @@ impl frame_decode::extrinsics::ExtrinsicTypeInfo for Metadata { Ok(ExtrinsicExtensionInfo { extension_ids }) } } +impl frame_decode::storage::StorageTypeInfo for Metadata { + type TypeId = u32; + + fn storage_info( + &self, + pallet_name: &str, + storage_entry: &str, + ) -> Result, StorageInfoError<'_>> { + let pallet = + self.pallet_by_name(pallet_name) + .ok_or_else(|| StorageInfoError::PalletNotFound { + pallet_name: pallet_name.to_string(), + })?; + let entry = pallet + .storage() + .and_then(|storage| storage.entry_by_name(storage_entry)) + .ok_or_else(|| StorageInfoError::StorageNotFound { + name: storage_entry.to_string(), + pallet_name: Cow::Borrowed(pallet.name()), + })?; + + let info = StorageInfo { + keys: Cow::Borrowed(&*entry.info.keys), + value_id: entry.info.value_id, + default_value: entry + .info + .default_value + .as_ref() + .map(|def| Cow::Borrowed(&**def)), + }; + + Ok(info) + } +} +impl frame_decode::storage::StorageEntryInfo for Metadata { + fn storage_entries(&self) -> impl Iterator> { + self.pallets().flat_map(|pallet| { + let pallet_name = pallet.name(); + let pallet_iter = core::iter::once(StorageEntry::In(pallet_name.into())); + let entries_iter = pallet.storage().into_iter().flat_map(|storage| { + storage + .entries() + .iter() + .map(|entry| StorageEntry::Name(entry.name().into())) + }); + + pallet_iter.chain(entries_iter) + }) + } +} +impl frame_decode::runtime_apis::RuntimeApiTypeInfo for Metadata { + type TypeId = u32; + + fn runtime_api_info( + &self, + trait_name: &str, + method_name: &str, + ) -> Result, RuntimeApiInfoError<'_>> { + let api_trait = + self.apis + .get_by_key(trait_name) + .ok_or_else(|| RuntimeApiInfoError::TraitNotFound { + trait_name: trait_name.to_string(), + })?; + let api_method = api_trait.methods.get_by_key(method_name).ok_or_else(|| { + RuntimeApiInfoError::MethodNotFound { + trait_name: Cow::Borrowed(&api_trait.name), + method_name: method_name.to_string(), + } + })?; + + let info = RuntimeApiInfo { + inputs: Cow::Borrowed(&api_method.info.inputs), + output_id: api_method.info.output_id, + }; + + Ok(info) + } +} +impl frame_decode::runtime_apis::RuntimeApiEntryInfo for Metadata { + fn runtime_api_entries(&self) -> impl Iterator> { + self.runtime_api_traits().flat_map(|api_trait| { + let trait_name = api_trait.name(); + let trait_iter = core::iter::once(RuntimeApiEntry::In(trait_name.into())); + let method_iter = api_trait + .methods() + .map(|method| RuntimeApiEntry::Name(method.name().into())); + + trait_iter.chain(method_iter) + }) + } +} +impl frame_decode::view_functions::ViewFunctionTypeInfo for Metadata { + type TypeId = u32; + + fn view_function_info( + &self, + pallet_name: &str, + function_name: &str, + ) -> Result, ViewFunctionInfoError<'_>> { + let pallet = self.pallet_by_name(pallet_name).ok_or_else(|| { + ViewFunctionInfoError::PalletNotFound { + pallet_name: pallet_name.to_string(), + } + })?; + let function = pallet.view_function_by_name(function_name).ok_or_else(|| { + ViewFunctionInfoError::FunctionNotFound { + pallet_name: Cow::Borrowed(pallet.name()), + function_name: function_name.to_string(), + } + })?; + + let info = ViewFunctionInfo { + inputs: Cow::Borrowed(&function.inner.info.inputs), + output_id: function.inner.info.output_id, + query_id: *function.query_id(), + }; + + Ok(info) + } +} +impl frame_decode::view_functions::ViewFunctionEntryInfo for Metadata { + fn view_function_entries(&self) -> impl Iterator> { + self.pallets().flat_map(|pallet| { + let pallet_name = pallet.name(); + let pallet_iter = core::iter::once(ViewFunctionEntry::In(pallet_name.into())); + let fn_iter = pallet + .view_functions() + .map(|function| ViewFunctionEntry::Name(function.name().into())); + + pallet_iter.chain(fn_iter) + }) + } +} +impl frame_decode::constants::ConstantTypeInfo for Metadata { + type TypeId = u32; + + fn constant_info( + &self, + pallet_name: &str, + constant_name: &str, + ) -> Result, ConstantInfoError<'_>> { + let pallet = + self.pallet_by_name(pallet_name) + .ok_or_else(|| ConstantInfoError::PalletNotFound { + pallet_name: pallet_name.to_string(), + })?; + let constant = pallet.constant_by_name(constant_name).ok_or_else(|| { + ConstantInfoError::ConstantNotFound { + pallet_name: Cow::Borrowed(pallet.name()), + constant_name: constant_name.to_string(), + } + })?; + + let info = ConstantInfo { + bytes: &constant.value, + type_id: constant.ty, + }; + + Ok(info) + } +} +impl frame_decode::constants::ConstantEntryInfo for Metadata { + fn constant_entries(&self) -> impl Iterator> { + self.pallets().flat_map(|pallet| { + let pallet_name = pallet.name(); + let pallet_iter = core::iter::once(ConstantEntry::In(pallet_name.into())); + let constant_iter = pallet + .constants() + .map(|constant| ConstantEntry::Name(constant.name().into())); + + pallet_iter.chain(constant_iter) + }) + } +} +impl frame_decode::custom_values::CustomValueTypeInfo for Metadata { + type TypeId = u32; + + fn custom_value_info( + &self, + name: &str, + ) -> Result, CustomValueInfoError> { + let custom_value = self + .custom() + .get(name) + .ok_or_else(|| CustomValueInfoError { + not_found: name.to_string(), + })?; + + let info = CustomValueInfo { + bytes: custom_value.data, + type_id: custom_value.type_id, + }; + + Ok(info) + } +} +impl frame_decode::custom_values::CustomValueEntryInfo for Metadata { + fn custom_values(&self) -> impl Iterator> { + self.custom.map.keys().map(|name| CustomValue { + name: Cow::Borrowed(name), + }) + } +} impl Metadata { + /// This is essentially an alias for `::decode(&mut bytes)` + pub fn decode_from(mut bytes: &[u8]) -> Result { + ::decode(&mut bytes) + } + + /// Convert V16 metadata into [`Metadata`]. + pub fn from_v16( + metadata: frame_metadata::v16::RuntimeMetadataV16, + ) -> Result { + metadata.try_into() + } + + /// Convert V15 metadata into [`Metadata`]. + pub fn from_v15( + metadata: frame_metadata::v15::RuntimeMetadataV15, + ) -> Result { + metadata.try_into() + } + + /// Convert V14 metadata into [`Metadata`]. + pub fn from_v14( + metadata: frame_metadata::v14::RuntimeMetadataV14, + ) -> Result { + metadata.try_into() + } + + /// Convert V13 metadata into [`Metadata`], given the necessary extra type information. + #[cfg(feature = "legacy")] + pub fn from_v13( + metadata: &frame_metadata::v13::RuntimeMetadataV13, + types: &scale_info_legacy::TypeRegistrySet<'_>, + ) -> Result { + from::legacy::from_v13(metadata, types, from::legacy::Opts::compat()) + } + + /// Convert V12 metadata into [`Metadata`], given the necessary extra type information. + #[cfg(feature = "legacy")] + pub fn from_v12( + metadata: &frame_metadata::v12::RuntimeMetadataV12, + types: &scale_info_legacy::TypeRegistrySet<'_>, + ) -> Result { + from::legacy::from_v12(metadata, types, from::legacy::Opts::compat()) + } + + /// Convert V13 metadata into [`Metadata`], given the necessary extra type information. + #[cfg(feature = "legacy")] + pub fn from_v11( + metadata: &frame_metadata::v11::RuntimeMetadataV11, + types: &scale_info_legacy::TypeRegistrySet<'_>, + ) -> Result { + from::legacy::from_v11(metadata, types, from::legacy::Opts::compat()) + } + + /// Convert V13 metadata into [`Metadata`], given the necessary extra type information. + #[cfg(feature = "legacy")] + pub fn from_v10( + metadata: &frame_metadata::v10::RuntimeMetadataV10, + types: &scale_info_legacy::TypeRegistrySet<'_>, + ) -> Result { + from::legacy::from_v10(metadata, types, from::legacy::Opts::compat()) + } + + /// Convert V9 metadata into [`Metadata`], given the necessary extra type information. + #[cfg(feature = "legacy")] + pub fn from_v9( + metadata: &frame_metadata::v9::RuntimeMetadataV9, + types: &scale_info_legacy::TypeRegistrySet<'_>, + ) -> Result { + from::legacy::from_v9(metadata, types, from::legacy::Opts::compat()) + } + + /// Convert V8 metadata into [`Metadata`], given the necessary extra type information. + #[cfg(feature = "legacy")] + pub fn from_v8( + metadata: &frame_metadata::v8::RuntimeMetadataV8, + types: &scale_info_legacy::TypeRegistrySet<'_>, + ) -> Result { + from::legacy::from_v8(metadata, types, from::legacy::Opts::compat()) + } + /// Access the underlying type registry. pub fn types(&self) -> &PortableRegistry { &self.types @@ -177,10 +482,36 @@ impl Metadata { }) } - /// Access a pallet given its encoded variant index. - pub fn pallet_by_index(&self, variant_index: u8) -> Option> { + /// Access a pallet given some call/extrinsic pallet index byte + pub fn pallet_by_call_index(&self, variant_index: u8) -> Option> { + let inner = self + .pallets_by_call_index + .get(&variant_index) + .and_then(|i| self.pallets.get_by_index(*i))?; + + Some(PalletMetadata { + inner, + types: self.types(), + }) + } + + /// Access a pallet given some event pallet index byte + pub fn pallet_by_event_index(&self, variant_index: u8) -> Option> { + let inner = self + .pallets_by_event_index + .get(&variant_index) + .and_then(|i| self.pallets.get_by_index(*i))?; + + Some(PalletMetadata { + inner, + types: self.types(), + }) + } + + /// Access a pallet given some error pallet index byte + pub fn pallet_by_error_index(&self, variant_index: u8) -> Option> { let inner = self - .pallets_by_index + .pallets_by_error_index .get(&variant_index) .and_then(|i| self.pallets.get_by_index(*i))?; @@ -217,20 +548,6 @@ impl Metadata { }) } - /// Access a view function given its query ID, if any. - pub fn view_function_by_query_id( - &'_ self, - query_id: &[u8; 32], - ) -> Option> { - // Dev note: currently, we only have pallet view functions, and here - // we just do a naive thing of iterating over the pallets to find the one - // we're looking for. Eventually we should construct a separate map of view - // functions for easy querying here. - self.pallets() - .flat_map(|p| p.view_functions()) - .find(|vf| vf.query_id() == query_id) - } - /// Returns custom user defined types pub fn custom(&self) -> CustomMetadata<'_> { CustomMetadata { @@ -264,9 +581,19 @@ impl<'a> PalletMetadata<'a> { &self.inner.name } - /// The pallet index. - pub fn index(&self) -> u8 { - self.inner.index + /// The index to use for calls in this pallet. + pub fn call_index(&self) -> u8 { + self.inner.call_index + } + + /// The index to use for events in this pallet. + pub fn event_index(&self) -> u8 { + self.inner.event_index + } + + /// The index to use for errors in this pallet. + pub fn error_index(&self) -> u8 { + self.inner.error_index } /// The pallet docs. @@ -418,9 +745,19 @@ impl<'a> PalletMetadata<'a> { #[derive(Debug, Clone)] struct PalletMetadataInner { /// Pallet name. - name: ArcStr, - /// Pallet index. - index: u8, + name: String, + /// The index for calls in the pallet. + call_index: u8, + /// The index for events in the pallet. + /// + /// This is the same as `call_index` for modern metadatas, + /// but can be different for older metadatas (pre-V12). + event_index: u8, + /// The index for errors in the pallet. + /// + /// This is the same as `call_index` for modern metadatas, + /// but can be different for older metadatas (pre-V12). + error_index: u8, /// Pallet storage metadata. storage: Option, /// Type ID for the pallet Call enum. @@ -436,9 +773,9 @@ struct PalletMetadataInner { /// Error variants by name/u8. error_variant_index: VariantIndex, /// Map from constant name to constant details. - constants: OrderedMap, + constants: OrderedMap, /// Details about each of the pallet view functions. - view_functions: OrderedMap, + view_functions: OrderedMap, /// Mapping from associated type to type ID describing its shape. associated_types: BTreeMap, /// Pallet documentation. @@ -451,7 +788,7 @@ pub struct StorageMetadata { /// The common prefix used by all storage entries. prefix: String, /// Map from storage entry name to details. - entries: OrderedMap, + entries: OrderedMap, } impl StorageMetadata { @@ -475,13 +812,9 @@ impl StorageMetadata { #[derive(Debug, Clone)] pub struct StorageEntryMetadata { /// Variable name of the storage entry. - name: ArcStr, - /// An `Option` modifier of that storage entry. - modifier: StorageEntryModifier, - /// Type of the value stored in the entry. - entry_type: StorageEntryType, - /// Default value (SCALE encoded). - default: Vec, + name: String, + /// Information about the storage entry. + info: StorageInfo<'static, u32>, /// Storage entry documentation. docs: Vec, } @@ -491,17 +824,18 @@ impl StorageEntryMetadata { pub fn name(&self) -> &str { &self.name } - /// Is the entry value optional or does it have a default value. - pub fn modifier(&self) -> StorageEntryModifier { - self.modifier + /// Keys in this storage entry. + pub fn keys(&self) -> impl ExactSizeIterator> { + let keys = &*self.info.keys; + keys.iter() } - /// Type of the storage entry. - pub fn entry_type(&self) -> &StorageEntryType { - &self.entry_type + /// Value type for this storage entry. + pub fn value_ty(&self) -> u32 { + self.info.value_id } - /// The SCALE encoded default value for this entry. - pub fn default_bytes(&self) -> &[u8] { - &self.default + /// The default value, if one exists, for this entry. + pub fn default_value(&self) -> Option<&[u8]> { + self.info.default_value.as_deref() } /// Storage entry documentation. pub fn docs(&self) -> &[String] { @@ -509,101 +843,11 @@ impl StorageEntryMetadata { } } -/// The type of a storage entry. -#[derive(Debug, Clone)] -pub enum StorageEntryType { - /// Plain storage entry (just the value). - Plain(u32), - /// A storage map. - Map { - /// One or more hashers, should be one hasher per key element. - hashers: Vec, - /// The type of the key, can be a tuple with elements for each of the hashers. - key_ty: u32, - /// The type of the value. - value_ty: u32, - }, -} - -impl StorageEntryType { - /// The type of the value. - pub fn value_ty(&self) -> u32 { - match self { - StorageEntryType::Map { value_ty, .. } | StorageEntryType::Plain(value_ty) => *value_ty, - } - } - - /// The type of the key, can be a tuple with elements for each of the hashers. None for a Plain storage entry. - pub fn key_ty(&self) -> Option { - match self { - StorageEntryType::Map { key_ty, .. } => Some(*key_ty), - StorageEntryType::Plain(_) => None, - } - } -} - -/// Hasher used by storage maps. -#[derive(Debug, Clone, Copy)] -pub enum StorageHasher { - /// 128-bit Blake2 hash. - Blake2_128, - /// 256-bit Blake2 hash. - Blake2_256, - /// Multiple 128-bit Blake2 hashes concatenated. - Blake2_128Concat, - /// 128-bit XX hash. - Twox128, - /// 256-bit XX hash. - Twox256, - /// Multiple 64-bit XX hashes concatenated. - Twox64Concat, - /// Identity hashing (no hashing). - Identity, -} - -impl StorageHasher { - /// The hash produced by a [`StorageHasher`] can have these two components, in order: - /// - /// 1. A fixed size hash. (not present for [`StorageHasher::Identity`]). - /// 2. The SCALE encoded key that was used as an input to the hasher (only present for - /// [`StorageHasher::Twox64Concat`], [`StorageHasher::Blake2_128Concat`] or [`StorageHasher::Identity`]). - /// - /// This function returns the number of bytes used to represent the first of these. - pub fn len_excluding_key(&self) -> usize { - match self { - StorageHasher::Blake2_128Concat => 16, - StorageHasher::Twox64Concat => 8, - StorageHasher::Blake2_128 => 16, - StorageHasher::Blake2_256 => 32, - StorageHasher::Twox128 => 16, - StorageHasher::Twox256 => 32, - StorageHasher::Identity => 0, - } - } - - /// Returns true if the key used to produce the hash is appended to the hash itself. - pub fn ends_with_key(&self) -> bool { - matches!( - self, - StorageHasher::Blake2_128Concat | StorageHasher::Twox64Concat | StorageHasher::Identity - ) - } -} - -/// Is the storage entry optional, or does it have a default value. -#[derive(Debug, Clone, Copy, Eq, PartialEq)] -pub enum StorageEntryModifier { - /// The storage entry returns an `Option`, with `None` if the key is not present. - Optional, - /// The storage entry returns `T::Default` if the key is not present. - Default, -} - /// Metadata for a single constant. #[derive(Debug, Clone)] pub struct ConstantMetadata { /// Name of the pallet constant. - name: ArcStr, + name: String, /// Type of the pallet constant. ty: u32, /// Value stored in the constant (SCALE encoded). @@ -816,9 +1060,9 @@ impl<'a> RuntimeApiMetadata<'a> { #[derive(Debug, Clone)] struct RuntimeApiMetadataInner { /// Trait name. - name: ArcStr, + name: String, /// Trait methods. - methods: OrderedMap, + methods: OrderedMap, /// Trait documentation. docs: Vec, } @@ -841,12 +1085,15 @@ impl<'a> RuntimeApiMethodMetadata<'a> { &self.inner.docs } /// Method inputs. - pub fn inputs(&self) -> impl ExactSizeIterator + use<'a> { - self.inner.inputs.iter() + pub fn inputs( + &self, + ) -> impl ExactSizeIterator> + use<'a> { + let inputs = &*self.inner.info.inputs; + inputs.iter() } /// Method return type. pub fn output_ty(&self) -> u32 { - self.inner.output_ty + self.inner.info.output_id } /// Return a hash for the method. pub fn hash(&self) -> [u8; HASH_LEN] { @@ -857,11 +1104,9 @@ impl<'a> RuntimeApiMethodMetadata<'a> { #[derive(Debug, Clone)] struct RuntimeApiMethodMetadataInner { /// Method name. - name: ArcStr, - /// Method parameters. - inputs: Vec, - /// Method output type. - output_ty: u32, + name: String, + /// Info. + info: RuntimeApiInfo<'static, u32>, /// Method documentation. docs: Vec, } @@ -882,19 +1127,22 @@ impl<'a> ViewFunctionMetadata<'a> { /// Query ID. This is used to query the function. Roughly, it is constructed by doing /// `twox_128(pallet_name) ++ twox_128("fn_name(fnarg_types) -> return_ty")` . pub fn query_id(&self) -> &'a [u8; 32] { - &self.inner.query_id + &self.inner.info.query_id } /// Method documentation. pub fn docs(&self) -> &'a [String] { &self.inner.docs } /// Method inputs. - pub fn inputs(&self) -> impl ExactSizeIterator + use<'a> { - self.inner.inputs.iter() + pub fn inputs( + &self, + ) -> impl ExactSizeIterator> + use<'a> { + let inputs = &*self.inner.info.inputs; + inputs.iter() } /// Method return type. pub fn output_ty(&self) -> u32 { - self.inner.output_ty + self.inner.info.output_id } /// Return a hash for the method. The query ID of a view function validates it to some /// degree, but only takes type _names_ into account. This hash takes into account the @@ -907,13 +1155,9 @@ impl<'a> ViewFunctionMetadata<'a> { #[derive(Debug, Clone)] struct ViewFunctionMetadataInner { /// View function name. - name: ArcStr, - /// View function query ID. - query_id: [u8; 32], - /// Input types. - inputs: Vec, - /// Output type. - output_ty: u32, + name: String, + /// Info. + info: ViewFunctionInfo<'static, u32>, /// Documentation. docs: Vec, } @@ -999,6 +1243,38 @@ impl<'a> CustomValueMetadata<'a> { } } +/// Decode SCALE encoded metadata. +/// +/// - The default assumption is that metadata is encoded as [`frame_metadata::RuntimeMetadataPrefixed`]. This is the +/// expected format that metadata is encoded into. +/// - if this fails, we also try to decode as [`frame_metadata::RuntimeMetadata`]. +/// - If this all fails, we also try to decode as [`frame_metadata::OpaqueMetadata`]. +pub fn decode_runtime_metadata( + input: &[u8], +) -> Result { + use codec::Decode; + + let err = match frame_metadata::RuntimeMetadataPrefixed::decode(&mut &*input) { + Ok(md) => return Ok(md.1), + Err(e) => e, + }; + + if let Ok(md) = frame_metadata::RuntimeMetadata::decode(&mut &*input) { + return Ok(md); + } + + // frame_metadata::OpaqueMetadata is a vec of bytes. If we can decode the length, AND + // the length definitely corresponds to the number of remaining bytes, then we try to + // decode the inner bytes. + if let Ok(len) = codec::Compact::::decode(&mut &*input) { + if input.len() == len.0 as usize { + return decode_runtime_metadata(input); + } + } + + Err(err) +} + // Support decoding metadata from the "wire" format directly into this. // Errors may be lost in the case that the metadata content is somehow invalid. impl codec::Decode for Metadata { @@ -1008,9 +1284,11 @@ impl codec::Decode for Metadata { frame_metadata::RuntimeMetadata::V14(md) => md.try_into(), frame_metadata::RuntimeMetadata::V15(md) => md.try_into(), frame_metadata::RuntimeMetadata::V16(md) => md.try_into(), - _ => return Err("Cannot try_into() to Metadata: unsupported metadata version".into()), + _ => { + return Err("Metadata::decode failed: Cannot try_into() to Metadata: unsupported metadata version".into()) + }, }; - metadata.map_err(|_e| "Cannot try_into() to Metadata.".into()) + metadata.map_err(|_| "Metadata::decode failed: Cannot try_into() to Metadata".into()) } } diff --git a/metadata/src/utils/validation.rs b/metadata/src/utils/validation.rs index a48e9c0a1dc..38a7873c94e 100644 --- a/metadata/src/utils/validation.rs +++ b/metadata/src/utils/validation.rs @@ -6,8 +6,7 @@ use crate::{ CustomMetadata, CustomValueMetadata, ExtrinsicMetadata, Metadata, PalletMetadata, - RuntimeApiMetadata, RuntimeApiMethodMetadata, StorageEntryMetadata, StorageEntryType, - ViewFunctionMetadata, + RuntimeApiMetadata, RuntimeApiMethodMetadata, StorageEntryMetadata, ViewFunctionMetadata, }; use alloc::vec::Vec; use hashbrown::HashMap; @@ -290,29 +289,19 @@ fn get_extrinsic_hash(registry: &PortableRegistry, extrinsic: &ExtrinsicMetadata fn get_storage_entry_hash(registry: &PortableRegistry, entry: &StorageEntryMetadata) -> Hash { let mut bytes = concat_and_hash3( &hash(entry.name.as_bytes()), - // Cloning 'entry.modifier' should essentially be a copy. - &[entry.modifier as u8; HASH_LEN], - &hash(&entry.default), + &get_type_hash(registry, entry.info.value_id), + &hash(entry.info.default_value.as_deref().unwrap_or_default()), ); - match &entry.entry_type { - StorageEntryType::Plain(ty) => concat_and_hash2(&bytes, &get_type_hash(registry, *ty)), - StorageEntryType::Map { - hashers, - key_ty, - value_ty, - } => { - for hasher in hashers { - // Cloning the hasher should essentially be a copy. - bytes = concat_and_hash2(&bytes, &[*hasher as u8; HASH_LEN]); - } - concat_and_hash3( - &bytes, - &get_type_hash(registry, *key_ty), - &get_type_hash(registry, *value_ty), - ) - } + for key in &*entry.info.keys { + bytes = concat_and_hash3( + &bytes, + &[key.hasher as u8; HASH_LEN], + &get_type_hash(registry, key.key_id), + ) } + + bytes } fn get_custom_metadata_hash(custom_metadata: &CustomMetadata) -> Hash { @@ -382,7 +371,7 @@ pub fn get_runtime_api_hash(runtime_api: &RuntimeApiMethodMetadata) -> Hash { bytes = concat_and_hash3( &bytes, &hash(input.name.as_bytes()), - &get_type_hash(registry, input.ty), + &get_type_hash(registry, input.id), ); } @@ -419,7 +408,7 @@ pub fn get_view_function_hash(view_function: &ViewFunctionMetadata) -> Hash { bytes = concat_and_hash3( &bytes, &hash(input.name.as_bytes()), - &get_type_hash(registry, input.ty), + &get_type_hash(registry, input.id), ); } diff --git a/subxt/examples/block_decoding_dynamic.rs b/subxt/examples/block_decoding_dynamic.rs index eb45cf51b88..44ba483221c 100644 --- a/subxt/examples/block_decoding_dynamic.rs +++ b/subxt/examples/block_decoding_dynamic.rs @@ -21,10 +21,10 @@ async fn main() -> Result<(), Box> { continue; // we do not look at inherents in this example }; - let meta = ext.extrinsic_metadata()?; - let fields = ext.field_values()?; + // Decode the fields into our dynamic Value type to display: + let fields = ext.decode_as_fields::()?; - println!(" {}/{}", meta.pallet.name(), meta.variant.name); + println!(" {}/{}", ext.pallet_name(), ext.call_name()); println!(" Transaction Extensions:"); for signed_ext in transaction_extensions.iter() { // We only want to take a look at these 3 signed extensions, because the others all just have unit fields. diff --git a/subxt/examples/blocks_subscribing.rs b/subxt/examples/blocks_subscribing.rs index 05ebb69c1e3..f0f0a37d43e 100644 --- a/subxt/examples/blocks_subscribing.rs +++ b/subxt/examples/blocks_subscribing.rs @@ -42,7 +42,7 @@ async fn main() -> Result<(), Box> { let evt = evt?; let pallet_name = evt.pallet_name(); let event_name = evt.variant_name(); - let event_values = evt.field_values()?; + let event_values = evt.decode_as_fields::()?; println!(" {pallet_name}_{event_name}"); println!(" {event_values}"); diff --git a/subxt/examples/constants_dynamic.rs b/subxt/examples/constants_dynamic.rs index b44db292eab..2d4ed4c5d7e 100644 --- a/subxt/examples/constants_dynamic.rs +++ b/subxt/examples/constants_dynamic.rs @@ -1,4 +1,5 @@ #![allow(missing_docs)] +use subxt::dynamic::Value; use subxt::{OnlineClient, PolkadotConfig}; #[tokio::main] @@ -6,13 +7,20 @@ async fn main() -> Result<(), Box> { // Create a client to use: let api = OnlineClient::::new().await?; - // A dynamic query to obtain some constant: - let constant_query = subxt::dynamic::constant("System", "BlockLength"); + // We can query a constant by providing a tuple of the pallet and constant name. The return type + // will be `Value` if we pass this query: + let constant_query = ("System", "BlockLength"); + let _value = api.constants().at(&constant_query)?; - // Obtain the value: + // Or we can use the library function to query a constant, which allows us to pass a generic type + // that Subxt will attempt to decode the constant into: + let constant_query = subxt::dynamic::constant::("System", "BlockLength"); let value = api.constants().at(&constant_query)?; - println!("Constant bytes: {:?}", value.encoded()); - println!("Constant value: {}", value.to_value()?); + // Or we can obtain the bytes for the constant, using either form of query. + let bytes = api.constants().bytes_at(&constant_query)?; + + println!("Constant bytes: {:?}", bytes); + println!("Constant value: {}", value); Ok(()) } diff --git a/subxt/examples/constants_static.rs b/subxt/examples/constants_static.rs index 3343dd36f86..2bb1aecbf6b 100644 --- a/subxt/examples/constants_static.rs +++ b/subxt/examples/constants_static.rs @@ -15,6 +15,10 @@ async fn main() -> Result<(), Box> { // Obtain the value: let value = api.constants().at(&constant_query)?; + // Or obtain the bytes: + let bytes = api.constants().bytes_at(&constant_query)?; + + println!("Encoded block length: {bytes:?}"); println!("Block length: {value:?}"); Ok(()) } diff --git a/subxt/examples/events.rs b/subxt/examples/events.rs index aaa9c1e3191..9861c9238ef 100644 --- a/subxt/examples/events.rs +++ b/subxt/examples/events.rs @@ -19,7 +19,7 @@ async fn main() -> Result<(), Box> { let pallet = event.pallet_name(); let variant = event.variant_name(); - let field_values = event.field_values()?; + let field_values = event.decode_as_fields::()?; println!("{pallet}::{variant}: {field_values}"); } diff --git a/subxt/examples/runtime_apis_dynamic.rs b/subxt/examples/runtime_apis_dynamic.rs index f69ea34be11..ef9c4ac0714 100644 --- a/subxt/examples/runtime_apis_dynamic.rs +++ b/subxt/examples/runtime_apis_dynamic.rs @@ -1,5 +1,5 @@ #![allow(missing_docs)] -use subxt::dynamic::Value; +use subxt::utils::AccountId32; use subxt::{OnlineClient, config::PolkadotConfig}; use subxt_signer::sr25519::dev; @@ -8,14 +8,14 @@ async fn main() -> Result<(), Box> { // Create a client to use: let api = OnlineClient::::new().await?; - // Create a dynamically runtime API payload that calls the - // `AccountNonceApi_account_nonce` function. - let account = dev::alice().public_key(); - let runtime_api_call = subxt::dynamic::runtime_api_call( - "AccountNonceApi", - "account_nonce", - vec![Value::from_bytes(account)], - ); + // Create a "dynamic" runtime API payload that calls the + // `AccountNonceApi_account_nonce` function. We could use the + // `scale_value::Value` type as output, and a vec of those as inputs, + // but since we know the input + return types we can pass them directly. + // There is one input argument, so the inputs are a tuple of one element. + let account: AccountId32 = dev::alice().public_key().into(); + let runtime_api_call = + subxt::dynamic::runtime_api_call::<_, u64>("AccountNonceApi", "account_nonce", (account,)); // Submit the call to get back a result. let nonce = api @@ -25,6 +25,6 @@ async fn main() -> Result<(), Box> { .call(runtime_api_call) .await?; - println!("Account nonce: {:#?}", nonce.to_value()); + println!("Account nonce: {:#?}", nonce); Ok(()) } diff --git a/subxt/examples/storage_fetch.rs b/subxt/examples/storage_fetch.rs index e29a87dccaa..1fe491898c3 100644 --- a/subxt/examples/storage_fetch.rs +++ b/subxt/examples/storage_fetch.rs @@ -10,22 +10,23 @@ pub mod polkadot {} async fn main() -> Result<(), Box> { // Create a new API client, configured to talk to Polkadot nodes. let api = OnlineClient::::new().await?; + let account = dev::alice().public_key().into(); // Build a storage query to access account information. - let account = dev::alice().public_key().into(); - let storage_query = polkadot::storage().system().account(account); + let storage_query = polkadot::storage().system().account(); - // Use that query to `fetch` a result. This returns an `Option<_>`, which will be - // `None` if no value exists at the given address. You can also use `fetch_default` - // where applicable, which will return the default value if none exists. - let result = api - .storage() - .at_latest() + // Use that query to access a storage entry, fetch a result and decode the value. + // The static address knows that fetching requires a tuple of one value, an + // AccountId32. + let client_at = api.storage().at_latest().await?; + let account_info = client_at + .entry(storage_query)? + .fetch((account,)) .await? - .fetch(&storage_query) - .await?; + .decode()?; - let v = result.unwrap().data.free; - println!("Alice: {v}"); + // The static address that we got from the subxt macro knows the expected input + // and return types, so it is decoded into a static type for us. + println!("Alice: {account_info:?}"); Ok(()) } diff --git a/subxt/examples/storage_fetch_dynamic.rs b/subxt/examples/storage_fetch_dynamic.rs index 17bf1de785d..61a81fef98a 100644 --- a/subxt/examples/storage_fetch_dynamic.rs +++ b/subxt/examples/storage_fetch_dynamic.rs @@ -1,5 +1,6 @@ #![allow(missing_docs)] use subxt::dynamic::{At, Value}; +use subxt::utils::AccountId32; use subxt::{OnlineClient, PolkadotConfig}; use subxt_signer::sr25519::dev; @@ -9,20 +10,25 @@ async fn main() -> Result<(), Box> { let api = OnlineClient::::new().await?; // Build a dynamic storage query to access account information. - let account = dev::alice().public_key(); - let storage_query = - subxt::dynamic::storage("System", "Account", vec![Value::from_bytes(account)]); + // here, we assume that there is one value to provide at this entry + // to access a value; an AccountId32. In this example we don't know the + // return type and so we set it to `Value`, which anything can decode into. + let account: AccountId32 = dev::alice().public_key().into(); + let storage_query = subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account"); - // Use that query to `fetch` a result. Because the query is dynamic, we don't know what the result - // type will be either, and so we get a type back that can be decoded into a dynamic Value type. - let result = api - .storage() - .at_latest() + // Use that query to access a storage entry, fetch a result and decode the value. + let client_at = api.storage().at_latest().await?; + let account_info = client_at + .entry(storage_query)? + .fetch((account,)) .await? - .fetch(&storage_query) - .await?; - let value = result.unwrap().to_value()?; + .decode()?; - println!("Alice has free balance: {:?}", value.at("data").at("free")); + // With out `Value` type we can dig in to find what we want using the `At` + // trait and `.at()` method that this provides on the Value. + println!( + "Alice has free balance: {}", + account_info.at("data").at("free").unwrap() + ); Ok(()) } diff --git a/subxt/examples/storage_iterating.rs b/subxt/examples/storage_iterating.rs index f64fad6c8d9..3ff74029bd9 100644 --- a/subxt/examples/storage_iterating.rs +++ b/subxt/examples/storage_iterating.rs @@ -1,7 +1,9 @@ #![allow(missing_docs)] +use subxt::ext::futures::StreamExt; use subxt::{OnlineClient, PolkadotConfig}; -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] +// Generate an interface that we can use from the node's metadata. +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] pub mod polkadot {} #[tokio::main] @@ -9,17 +11,31 @@ async fn main() -> Result<(), Box> { // Create a new API client, configured to talk to Polkadot nodes. let api = OnlineClient::::new().await?; - // Build a storage query to iterate over account information. - let storage_query = polkadot::storage().system().account_iter(); + // Build a storage query to access account information. Same as if we were + // fetching a single value from this entry. + let storage_query = polkadot::storage().system().account(); - // Get back an iterator of results (here, we are fetching 10 items at - // a time from the node, but we always iterate over one at a time). - let mut results = api.storage().at_latest().await?.iter(storage_query).await?; + // Use that query to access a storage entry, iterate over it and decode values. + let client_at = api.storage().at_latest().await?; - while let Some(Ok(kv)) = results.next().await { - println!("Keys decoded: {:?}", kv.keys); - println!("Key: 0x{}", hex::encode(&kv.key_bytes)); - println!("Value: {:?}", kv.value); + // We provide an empty tuple when iterating. If the storage entry had been an N map with + // multiple keys, then we could provide any prefix of those keys to iterate over. This is + // statically type checked, so only a valid number/type of keys in the tuple is accepted. + let mut values = client_at.entry(storage_query)?.iter(()).await?; + + while let Some(kv) = values.next().await { + let kv = kv?; + + // The key decodes into the type that the static address knows about, in this case a + // tuple of one entry, because the only part of the key that we can decode is the + // AccountId32 for each user. + let (account_id32,) = kv.key()?.decode()?; + + // The value decodes into a statically generated type which holds account information. + let value = kv.value().decode()?; + + let value_data = value.data; + println!("{account_id32}:\n {value_data:?}"); } Ok(()) diff --git a/subxt/examples/storage_iterating_dynamic.rs b/subxt/examples/storage_iterating_dynamic.rs index 8cae0f8d7db..443c977eef2 100644 --- a/subxt/examples/storage_iterating_dynamic.rs +++ b/subxt/examples/storage_iterating_dynamic.rs @@ -1,23 +1,41 @@ #![allow(missing_docs)] -use subxt::{OnlineClient, PolkadotConfig, dynamic::Value}; +use subxt::ext::futures::StreamExt; +use subxt::utils::AccountId32; +use subxt::{ + OnlineClient, PolkadotConfig, + dynamic::{At, Value}, +}; #[tokio::main] async fn main() -> Result<(), Box> { // Create a new API client, configured to talk to Polkadot nodes. let api = OnlineClient::::new().await?; - // Build a dynamic storage query to iterate account information. - // With a dynamic query, we can just provide an empty vector as the keys to iterate over all entries. - let keys: Vec = vec![]; - let storage_query = subxt::dynamic::storage("System", "Account", keys); + // Build a dynamic storage query to access account information. + // here, we assume that there is one value to provide at this entry + // to access a value; an AccountId32. In this example we don't know the + // return type and so we set it to `Value`, which anything can decode into. + let storage_query = subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account"); - // Use that query to return an iterator over the results. - let mut results = api.storage().at_latest().await?.iter(storage_query).await?; + // Use that query to access a storage entry, iterate over it and decode values. + let client_at = api.storage().at_latest().await?; + let mut values = client_at.entry(storage_query)?.iter(()).await?; - while let Some(Ok(kv)) = results.next().await { - println!("Keys decoded: {:?}", kv.keys); - println!("Key: 0x{}", hex::encode(&kv.key_bytes)); - println!("Value: {:?}", kv.value.to_value()?); + while let Some(kv) = values.next().await { + let kv = kv?; + + // The key decodes into the first type we provided in the address. Since there's just + // one key, it is a tuple of one entry, an AccountId32. If we didn't know how many + // keys or their type, we could set the key to `Vec` instead. + let (account_id32,) = kv.key()?.decode()?; + + // The value decodes into the second type we provided in the address. In this example, + // we just decode it into our `Value` type and then look at the "data" field in this + // (which implicitly assumes we get a struct shaped thing back with such a field). + let value = kv.value().decode()?; + + let value_data = value.at("data").unwrap(); + println!("{account_id32}:\n {value_data}"); } Ok(()) diff --git a/subxt/examples/storage_iterating_partial.rs b/subxt/examples/storage_iterating_partial.rs deleted file mode 100644 index dc901d8f6a0..00000000000 --- a/subxt/examples/storage_iterating_partial.rs +++ /dev/null @@ -1,77 +0,0 @@ -#![allow(missing_docs)] -use polkadot::multisig::events::NewMultisig; -use polkadot::runtime_types::{ - frame_system::pallet::Call, rococo_runtime::RuntimeCall, sp_weights::weight_v2::Weight, -}; -use subxt::utils::AccountId32; -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::{Keypair, dev}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] -pub mod polkadot {} - -#[tokio::main] -async fn main() -> Result<(), Box> { - // Create a new API client, configured to talk to Polkadot nodes. - let api = OnlineClient::::new().await?; - - // Prepare the chain to have 3 open multisig requests (2 of them are alice + bob): - let alice_signer = dev::alice(); - let bob = AccountId32(dev::bob().public_key().0); - let charlie = AccountId32(dev::charlie().public_key().0); - - let new_multisig_1 = submit_remark_as_multi(&alice_signer, &bob, b"Hello", &api).await?; - let new_multisig_2 = submit_remark_as_multi(&alice_signer, &bob, b"Hi", &api).await?; - let new_multisig_3 = submit_remark_as_multi(&alice_signer, &charlie, b"Hello", &api).await?; - - // Note: the NewMultisig event contains the multisig address we need to use for the storage queries: - assert_eq!(new_multisig_1.multisig, new_multisig_2.multisig); - assert_ne!(new_multisig_1.multisig, new_multisig_3.multisig); - - // Build a storage query to iterate over open multisig extrinsics from - // new_multisig_1.multisig which is the AccountId of the alice + bob multisig account - let alice_bob_account_id = new_multisig_1.multisig; - let storage_query = polkadot::storage() - .multisig() - .multisigs_iter1(alice_bob_account_id); - - // Get back an iterator of results. - let mut results = api.storage().at_latest().await?.iter(storage_query).await?; - - while let Some(Ok(kv)) = results.next().await { - println!("Keys decoded: {:?}", kv.keys); - println!("Key: 0x{}", hex::encode(&kv.key_bytes)); - println!("Value: {:?}", kv.value); - } - Ok(()) -} - -async fn submit_remark_as_multi( - signer: &Keypair, - other: &AccountId32, - remark: &[u8], - api: &OnlineClient, -) -> Result> { - let multisig_remark_tx = polkadot::tx().multisig().as_multi( - 2, - vec![other.clone()], - None, - RuntimeCall::System(Call::remark { - remark: remark.to_vec(), - }), - Weight { - ref_time: 0, - proof_size: 0, - }, - ); - let events = api - .tx() - .sign_and_submit_then_watch_default(&multisig_remark_tx, signer) - .await? - .wait_for_finalized_success() - .await?; - let new_multisig = events - .find_first::()? - .expect("should contain event"); - Ok(new_multisig) -} diff --git a/subxt/src/backend/chain_head/follow_stream.rs b/subxt/src/backend/chain_head/follow_stream.rs index e82e8cb9c48..f06b5d06776 100644 --- a/subxt/src/backend/chain_head/follow_stream.rs +++ b/subxt/src/backend/chain_head/follow_stream.rs @@ -3,7 +3,7 @@ // see LICENSE for license details. use crate::config::{Config, HashFor}; -use crate::error::Error; +use crate::error::BackendError; use futures::{FutureExt, Stream, StreamExt, TryStreamExt}; use std::future::Future; use std::pin::Pin; @@ -34,12 +34,16 @@ pub type FollowEventStreamGetter = Box FollowEventStreamFut /// The future which will return a stream of follow events and the subscription ID for it. pub type FollowEventStreamFut = Pin< - Box, String), Error>> + Send + 'static>, + Box< + dyn Future, String), BackendError>> + + Send + + 'static, + >, >; /// The stream of follow events. pub type FollowEventStream = - Pin, Error>> + Send + 'static>>; + Pin, BackendError>> + Send + 'static>>; /// Either a ready message with the current subscription ID, or /// an event from the stream itself. @@ -108,7 +112,7 @@ impl FollowStream { let stream = methods.chainhead_v1_follow(true).await?; // Extract the subscription ID: let Some(sub_id) = stream.subscription_id().map(ToOwned::to_owned) else { - return Err(Error::Other( + return Err(BackendError::Other( "Subscription ID expected for chainHead_follow response, but not given" .to_owned(), )); @@ -128,7 +132,7 @@ impl FollowStream { impl std::marker::Unpin for FollowStream {} impl Stream for FollowStream { - type Item = Result, Error>; + type Item = Result, BackendError>; fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.get_mut(); @@ -228,7 +232,7 @@ pub(super) mod test_utils { where Hash: Send + 'static, F: Fn() -> I + Send + 'static, - I: IntoIterator, Error>>, + I: IntoIterator, BackendError>>, { let start_idx = Arc::new(AtomicUsize::new(0)); @@ -307,7 +311,7 @@ pub mod test { Ok(FollowEvent::Stop), Ok(ev_new_block(1, 2)), // Nothing should be emitted after an error: - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), Ok(ev_new_block(2, 3)), ] }); diff --git a/subxt/src/backend/chain_head/follow_stream_driver.rs b/subxt/src/backend/chain_head/follow_stream_driver.rs index 3fd2d1af410..f1ff507729e 100644 --- a/subxt/src/backend/chain_head/follow_stream_driver.rs +++ b/subxt/src/backend/chain_head/follow_stream_driver.rs @@ -4,7 +4,7 @@ use super::follow_stream_unpin::{BlockRef, FollowStreamMsg, FollowStreamUnpin}; use crate::config::Hash; -use crate::error::{Error, RpcError}; +use crate::error::{BackendError, RpcError}; use futures::stream::{Stream, StreamExt}; use std::collections::{HashMap, HashSet, VecDeque}; use std::ops::DerefMut; @@ -42,7 +42,7 @@ impl FollowStreamDriver { } impl Stream for FollowStreamDriver { - type Item = Result<(), Error>; + type Item = Result<(), BackendError>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { match self.inner.poll_next_unpin(cx) { @@ -421,7 +421,7 @@ where H: Hash, F: Fn(FollowEvent>) -> Vec>, { - type Item = Result<(String, Vec>), Error>; + type Item = Result<(String, Vec>), BackendError>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { if self.is_done { @@ -500,7 +500,7 @@ mod test_utils { where H: Hash + 'static, F: Fn() -> I + Send + 'static, - I: IntoIterator, Error>>, + I: IntoIterator, BackendError>>, { let (stream, _) = test_unpin_stream_getter(events, max_life); FollowStreamDriver::new(stream) @@ -537,7 +537,7 @@ mod test { Ok(ev_new_block(0, 1)), Ok(ev_best_block(1)), Ok(ev_finalized([1], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -580,7 +580,7 @@ mod test { Ok(ev_finalized([1], [])), Ok(ev_new_block(1, 2)), Ok(ev_new_block(2, 3)), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -630,7 +630,7 @@ mod test { Ok(ev_new_block(1, 2)), Ok(ev_new_block(2, 3)), Ok(ev_finalized([1], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -668,7 +668,7 @@ mod test { Ok(FollowEvent::Stop), Ok(ev_initialized(1)), Ok(ev_finalized([2], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -714,7 +714,7 @@ mod test { // Emulate that we missed some blocks. Ok(ev_initialized(13)), Ok(ev_finalized([14], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -742,7 +742,7 @@ mod test { ) ); assert!( - matches!(&evs[1], Err(Error::Rpc(RpcError::ClientError(subxt_rpcs::Error::DisconnectedWillReconnect(e)))) if e.contains("Missed at least one block when the connection was lost")) + matches!(&evs[1], Err(BackendError::Rpc(RpcError::ClientError(subxt_rpcs::Error::DisconnectedWillReconnect(e)))) if e.contains("Missed at least one block when the connection was lost")) ); assert_eq!( evs[2].as_ref().unwrap(), diff --git a/subxt/src/backend/chain_head/follow_stream_unpin.rs b/subxt/src/backend/chain_head/follow_stream_unpin.rs index 303ef6e32f2..db0995f5740 100644 --- a/subxt/src/backend/chain_head/follow_stream_unpin.rs +++ b/subxt/src/backend/chain_head/follow_stream_unpin.rs @@ -5,7 +5,7 @@ use super::ChainHeadRpcMethods; use super::follow_stream::FollowStream; use crate::config::{Config, Hash, HashFor}; -use crate::error::Error; +use crate::error::BackendError; use futures::stream::{FuturesUnordered, Stream, StreamExt}; use subxt_rpcs::methods::chain_head::{ BestBlockChanged, Finalized, FollowEvent, Initialized, NewBlock, @@ -71,7 +71,7 @@ pub type UnpinFut = Pin + Send + 'static>>; impl std::marker::Unpin for FollowStreamUnpin {} impl Stream for FollowStreamUnpin { - type Item = Result>, Error>; + type Item = Result>, BackendError>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let mut this = self.as_mut(); @@ -482,7 +482,7 @@ pub(super) mod test_utils { where H: Hash + 'static, F: Fn() -> I + Send + 'static, - I: IntoIterator, Error>>, + I: IntoIterator, BackendError>>, { // Unpin requests will come here so that we can look out for them. let (unpin_tx, unpin_rx) = std::sync::mpsc::channel(); @@ -567,7 +567,7 @@ mod test { Ok(ev_new_block(0, 1)), Ok(ev_new_block(1, 2)), Ok(ev_new_block(2, 3)), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -593,7 +593,7 @@ mod test { [ Ok(ev_initialized(0)), Ok(ev_finalized([1], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 3, @@ -624,7 +624,7 @@ mod test { Ok(ev_finalized([3], [])), Ok(ev_finalized([4], [])), Ok(ev_finalized([5], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 3, @@ -663,7 +663,7 @@ mod test { Ok(ev_new_block(1, 2)), Ok(ev_finalized([1], [])), Ok(ev_finalized([2], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -711,7 +711,7 @@ mod test { Ok(ev_finalized([1], [])), Ok(ev_finalized([2], [3])), Ok(ev_finalized([4], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, @@ -771,7 +771,7 @@ mod test { Ok(ev_best_block(1)), Ok(ev_finalized([1], [])), Ok(ev_finalized([2], [])), - Err(Error::Other("ended".to_owned())), + Err(BackendError::Other("ended".to_owned())), ] }, 10, diff --git a/subxt/src/backend/chain_head/mod.rs b/subxt/src/backend/chain_head/mod.rs index 0d0024a4ee9..18521ce08ff 100644 --- a/subxt/src/backend/chain_head/mod.rs +++ b/subxt/src/backend/chain_head/mod.rs @@ -22,7 +22,7 @@ use crate::backend::{ TransactionStatus, utils::retry, }; use crate::config::{Config, Hash, HashFor}; -use crate::error::{Error, RpcError}; +use crate::error::{BackendError, RpcError}; use async_trait::async_trait; use follow_stream_driver::{FollowStreamDriver, FollowStreamDriverHandle}; use futures::future::Either; @@ -229,7 +229,7 @@ impl ChainHeadBackend { async fn stream_headers( &self, f: F, - ) -> Result>)>, Error> + ) -> Result>)>, BackendError> where F: Fn( FollowEvent>>, @@ -290,7 +290,7 @@ impl Backend for ChainHeadBackend { &self, keys: Vec>, at: HashFor, - ) -> Result, Error> { + ) -> Result, BackendError> { retry(|| async { let queries = keys.iter().map(|key| StorageQuery { key: &**key, @@ -325,7 +325,7 @@ impl Backend for ChainHeadBackend { &self, key: Vec, at: HashFor, - ) -> Result>, Error> { + ) -> Result>, BackendError> { retry(|| async { // Ask for hashes, and then just ignore them and return the keys that come back. let query = StorageQuery { @@ -351,7 +351,7 @@ impl Backend for ChainHeadBackend { &self, key: Vec, at: HashFor, - ) -> Result, Error> { + ) -> Result, BackendError> { retry(|| async { let query = StorageQuery { key: &*key, @@ -386,7 +386,7 @@ impl Backend for ChainHeadBackend { .await } - async fn genesis_hash(&self) -> Result, Error> { + async fn genesis_hash(&self) -> Result, BackendError> { retry(|| async { let genesis_hash = self.methods.chainspec_v1_genesis_hash().await?; Ok(genesis_hash) @@ -394,7 +394,7 @@ impl Backend for ChainHeadBackend { .await } - async fn block_header(&self, at: HashFor) -> Result, Error> { + async fn block_header(&self, at: HashFor) -> Result, BackendError> { retry(|| async { let sub_id = get_subscription_id(&self.follow_handle).await?; let header = self.methods.chainhead_v1_header(&sub_id, at).await?; @@ -403,7 +403,7 @@ impl Backend for ChainHeadBackend { .await } - async fn block_body(&self, at: HashFor) -> Result>>, Error> { + async fn block_body(&self, at: HashFor) -> Result>>, BackendError> { retry(|| async { let sub_id = get_subscription_id(&self.follow_handle).await?; @@ -432,7 +432,7 @@ impl Backend for ChainHeadBackend { .await } - async fn latest_finalized_block_ref(&self) -> Result>, Error> { + async fn latest_finalized_block_ref(&self) -> Result>, BackendError> { let next_ref: Option>> = self .follow_handle .subscribe() @@ -452,17 +452,19 @@ impl Backend for ChainHeadBackend { next_ref.ok_or_else(|| RpcError::SubscriptionDropped.into()) } - async fn current_runtime_version(&self) -> Result { + async fn current_runtime_version(&self) -> Result { // Just start a stream of version infos, and return the first value we get from it. let runtime_version = self.stream_runtime_version().await?.next().await; match runtime_version { - None => Err(Error::Rpc(RpcError::SubscriptionDropped)), + None => Err(BackendError::Rpc(RpcError::SubscriptionDropped)), Some(Err(e)) => Err(e), Some(Ok(version)) => Ok(version), } } - async fn stream_runtime_version(&self) -> Result, Error> { + async fn stream_runtime_version( + &self, + ) -> Result, BackendError> { // Keep track of runtime details announced in new blocks, and then when blocks // are finalized, find the latest of these that has runtime details, and clear the rest. let mut runtimes = HashMap::new(); @@ -526,7 +528,7 @@ impl Backend for ChainHeadBackend { let runtime_details = match runtime_event { RuntimeEvent::Invalid(err) => { - return std::future::ready(Some(Err(Error::Other(err.error)))) + return std::future::ready(Some(Err(BackendError::Other(format!("Invalid runtime error using chainHead RPCs: {}", err.error))))) } RuntimeEvent::Valid(ev) => ev, }; @@ -544,7 +546,7 @@ impl Backend for ChainHeadBackend { async fn stream_all_block_headers( &self, _hasher: T::Hasher, - ) -> Result>)>, Error> { + ) -> Result>)>, BackendError> { // TODO: https://github.com/paritytech/subxt/issues/1568 // // It's possible that blocks may be silently missed if @@ -562,7 +564,7 @@ impl Backend for ChainHeadBackend { async fn stream_best_block_headers( &self, _hasher: T::Hasher, - ) -> Result>)>, Error> { + ) -> Result>)>, BackendError> { // TODO: https://github.com/paritytech/subxt/issues/1568 // // It's possible that blocks may be silently missed if @@ -578,7 +580,7 @@ impl Backend for ChainHeadBackend { async fn stream_finalized_block_headers( &self, _hasher: T::Hasher, - ) -> Result>)>, Error> { + ) -> Result>)>, BackendError> { self.stream_headers(|ev| match ev { FollowEvent::Initialized(init) => init.finalized_block_hashes, FollowEvent::Finalized(ev) => ev.finalized_block_hashes, @@ -590,12 +592,12 @@ impl Backend for ChainHeadBackend { async fn submit_transaction( &self, extrinsic: &[u8], - ) -> Result>>, Error> { + ) -> Result>>, BackendError> { // Submit a transaction. This makes no attempt to sync with follow events, async fn submit_transaction_ignoring_follow_events( extrinsic: &[u8], methods: &ChainHeadRpcMethods, - ) -> Result>>, Error> { + ) -> Result>>, BackendError> { let tx_progress = methods .transactionwatch_v1_submit_and_watch(extrinsic) .await? @@ -637,7 +639,7 @@ impl Backend for ChainHeadBackend { transaction_timeout_secs: u64, methods: &ChainHeadRpcMethods, follow_handle: &FollowStreamDriverHandle>, - ) -> Result>>, Error> { + ) -> Result>>, BackendError> { // We care about new and finalized block hashes. enum SeenBlockMarker { New, @@ -664,7 +666,7 @@ impl Backend for ChainHeadBackend { let start_instant = web_time::Instant::now(); // A quick helper to return a generic error. - let err_other = |s: &str| Some(Err(Error::Other(s.into()))); + let err_other = |s: &str| Some(Err(BackendError::Other(s.into()))); // Now we can attempt to associate tx events with pinned blocks. let tx_stream = futures::stream::poll_fn(move |cx| { @@ -828,7 +830,7 @@ impl Backend for ChainHeadBackend { method: &str, call_parameters: Option<&[u8]>, at: HashFor, - ) -> Result, Error> { + ) -> Result, BackendError> { retry(|| async { let sub_id = get_subscription_id(&self.follow_handle).await?; @@ -867,7 +869,7 @@ impl Backend for ChainHeadBackend { /// A helper to obtain a subscription ID. async fn get_subscription_id( follow_handle: &FollowStreamDriverHandle, -) -> Result { +) -> Result { let Some(sub_id) = follow_handle.subscribe().subscription_id().await else { return Err(RpcError::SubscriptionDropped.into()); }; diff --git a/subxt/src/backend/chain_head/storage_items.rs b/subxt/src/backend/chain_head/storage_items.rs index 5a108b64985..6519e63a677 100644 --- a/subxt/src/backend/chain_head/storage_items.rs +++ b/subxt/src/backend/chain_head/storage_items.rs @@ -5,7 +5,7 @@ use super::follow_stream_driver::FollowStreamDriverHandle; use super::follow_stream_unpin::BlockRef; use crate::config::{Config, HashFor}; -use crate::error::{Error, RpcError}; +use crate::error::{BackendError, RpcError}; use futures::{FutureExt, Stream, StreamExt}; use std::collections::VecDeque; use std::future::Future; @@ -36,7 +36,7 @@ impl StorageItems { at: HashFor, follow_handle: &FollowStreamDriverHandle>, methods: ChainHeadRpcMethods, - ) -> Result { + ) -> Result { let sub_id = super::get_subscription_id(follow_handle).await?; // Subscribe to events and make the initial request to get an operation ID. @@ -92,10 +92,10 @@ impl StorageItems { pub type FollowEventStream = Pin>> + Send + 'static>>; pub type ContinueFutGetter = Box ContinueFut + Send + 'static>; -pub type ContinueFut = Pin> + Send + 'static>>; +pub type ContinueFut = Pin> + Send + 'static>>; impl Stream for StorageItems { - type Item = Result; + type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { loop { @@ -157,7 +157,7 @@ impl Stream for StorageItems { FollowEvent::OperationError(err) if err.operation_id == *self.operation_id => { // Something went wrong obtaining storage items; mark as done and return the error. self.done = true; - return Poll::Ready(Some(Err(Error::Other(err.error)))); + return Poll::Ready(Some(Err(BackendError::Other(err.error)))); } _ => { // We don't care about this event; wait for the next. diff --git a/subxt/src/backend/legacy.rs b/subxt/src/backend/legacy.rs index 34d5a0ffaea..d6edcdbd7d7 100644 --- a/subxt/src/backend/legacy.rs +++ b/subxt/src/backend/legacy.rs @@ -11,10 +11,8 @@ use crate::backend::{ Backend, BlockRef, RuntimeVersion, StorageResponse, StreamOf, StreamOfResults, TransactionStatus, }; -use crate::{ - Error, - config::{Config, HashFor, Header}, -}; +use crate::config::{Config, HashFor, Header}; +use crate::error::BackendError; use async_trait::async_trait; use futures::TryStreamExt; use futures::{Future, FutureExt, Stream, StreamExt, future, future::Either, stream}; @@ -101,12 +99,12 @@ impl Backend for LegacyBackend { &self, keys: Vec>, at: HashFor, - ) -> Result, Error> { + ) -> Result, BackendError> { fn get_entry( key: Vec, at: HashFor, methods: LegacyRpcMethods, - ) -> impl Future, Error>> { + ) -> impl Future, BackendError>> { retry(move || { let methods = methods.clone(); let key = key.clone(); @@ -138,7 +136,7 @@ impl Backend for LegacyBackend { &self, key: Vec, at: HashFor, - ) -> Result>, Error> { + ) -> Result>, BackendError> { let keys = StorageFetchDescendantKeysStream { at, key, @@ -169,7 +167,7 @@ impl Backend for LegacyBackend { &self, key: Vec, at: HashFor, - ) -> Result, Error> { + ) -> Result, BackendError> { let keys_stream = StorageFetchDescendantKeysStream { at, key, @@ -187,7 +185,7 @@ impl Backend for LegacyBackend { }))) } - async fn genesis_hash(&self) -> Result, Error> { + async fn genesis_hash(&self) -> Result, BackendError> { retry(|| async { let hash = self.methods.genesis_hash().await?; Ok(hash) @@ -195,7 +193,7 @@ impl Backend for LegacyBackend { .await } - async fn block_header(&self, at: HashFor) -> Result, Error> { + async fn block_header(&self, at: HashFor) -> Result, BackendError> { retry(|| async { let header = self.methods.chain_get_header(Some(at)).await?; Ok(header) @@ -203,7 +201,7 @@ impl Backend for LegacyBackend { .await } - async fn block_body(&self, at: HashFor) -> Result>>, Error> { + async fn block_body(&self, at: HashFor) -> Result>>, BackendError> { retry(|| async { let Some(details) = self.methods.chain_get_block(Some(at)).await? else { return Ok(None); @@ -215,7 +213,7 @@ impl Backend for LegacyBackend { .await } - async fn latest_finalized_block_ref(&self) -> Result>, Error> { + async fn latest_finalized_block_ref(&self) -> Result>, BackendError> { retry(|| async { let hash = self.methods.chain_get_finalized_head().await?; Ok(BlockRef::from_hash(hash)) @@ -223,7 +221,7 @@ impl Backend for LegacyBackend { .await } - async fn current_runtime_version(&self) -> Result { + async fn current_runtime_version(&self) -> Result { retry(|| async { let details = self.methods.state_get_runtime_version(None).await?; Ok(RuntimeVersion { @@ -234,7 +232,9 @@ impl Backend for LegacyBackend { .await } - async fn stream_runtime_version(&self) -> Result, Error> { + async fn stream_runtime_version( + &self, + ) -> Result, BackendError> { let methods = self.methods.clone(); let retry_sub = retry_stream(move || { @@ -274,7 +274,7 @@ impl Backend for LegacyBackend { async fn stream_all_block_headers( &self, hasher: T::Hasher, - ) -> Result>)>, Error> { + ) -> Result>)>, BackendError> { let methods = self.methods.clone(); let retry_sub = retry_stream(move || { let methods = methods.clone(); @@ -297,7 +297,7 @@ impl Backend for LegacyBackend { async fn stream_best_block_headers( &self, hasher: T::Hasher, - ) -> Result>)>, Error> { + ) -> Result>)>, BackendError> { let methods = self.methods.clone(); let retry_sub = retry_stream(move || { @@ -321,7 +321,7 @@ impl Backend for LegacyBackend { async fn stream_finalized_block_headers( &self, hasher: T::Hasher, - ) -> Result>)>, Error> { + ) -> Result>)>, BackendError> { let this = self.clone(); let retry_sub = retry_stream(move || { @@ -361,7 +361,7 @@ impl Backend for LegacyBackend { async fn submit_transaction( &self, extrinsic: &[u8], - ) -> Result>>, Error> { + ) -> Result>>, BackendError> { let sub = self .methods .author_submit_and_watch_extrinsic(extrinsic) @@ -423,7 +423,7 @@ impl Backend for LegacyBackend { method: &str, call_parameters: Option<&[u8]>, at: HashFor, - ) -> Result, Error> { + ) -> Result, BackendError> { retry(|| async { let res = self .methods @@ -442,11 +442,11 @@ pub fn subscribe_to_block_headers_filling_in_gaps( methods: LegacyRpcMethods, sub: S, mut last_block_num: Option, -) -> impl Stream> + Send +) -> impl Stream> + Send where T: Config, S: Stream> + Send, - E: Into + Send + 'static, + E: Into + Send + 'static, { sub.flat_map(move |s| { // Get the header, or return a stream containing just the error. @@ -470,7 +470,7 @@ where async move { let hash = methods.chain_get_block_hash(Some(n.into())).await?; let header = methods.chain_get_header(hash).await?; - Ok::<_, Error>(header) + Ok::<_, BackendError>(header) } }) .filter_map(async |h| h.transpose()); @@ -495,7 +495,8 @@ pub struct StorageFetchDescendantKeysStream { // What key do we start paginating from? None = from the beginning. pagination_start_key: Option>, // Keys, future and cached: - keys_fut: Option>, Error>> + Send + 'static>>>, + keys_fut: + Option>, BackendError>> + Send + 'static>>>, // Set to true when we're done: done: bool, } @@ -503,7 +504,7 @@ pub struct StorageFetchDescendantKeysStream { impl std::marker::Unpin for StorageFetchDescendantKeysStream {} impl Stream for StorageFetchDescendantKeysStream { - type Item = Result>, Error>; + type Item = Result>, BackendError>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let mut this = self.as_mut(); loop { @@ -584,7 +585,7 @@ pub struct StorageFetchDescendantValuesStream { results_fut: Option< Pin< Box< - dyn Future, Vec)>>, Error>> + dyn Future, Vec)>>, BackendError>> + Send + 'static, >, @@ -595,7 +596,7 @@ pub struct StorageFetchDescendantValuesStream { } impl Stream for StorageFetchDescendantValuesStream { - type Item = Result; + type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let mut this = self.as_mut(); loop { diff --git a/subxt/src/backend/mod.rs b/subxt/src/backend/mod.rs index 72549fc35c8..95395a2a297 100644 --- a/subxt/src/backend/mod.rs +++ b/subxt/src/backend/mod.rs @@ -11,14 +11,14 @@ pub mod legacy; pub mod utils; use crate::config::{Config, HashFor}; -use crate::error::Error; -use crate::metadata::Metadata; +use crate::error::BackendError; use async_trait::async_trait; use codec::{Decode, Encode}; use futures::{Stream, StreamExt}; use std::pin::Pin; use std::sync::Arc; use subxt_core::client::RuntimeVersion; +use subxt_metadata::Metadata; /// Some re-exports from the [`subxt_rpcs`] crate, also accessible in full via [`crate::ext::subxt_rpcs`]. pub mod rpc { @@ -82,66 +82,67 @@ pub trait Backend: sealed::Sealed + Send + Sync + 'static { &self, keys: Vec>, at: HashFor, - ) -> Result, Error>; + ) -> Result, BackendError>; /// Fetch keys underneath the given key from storage. async fn storage_fetch_descendant_keys( &self, key: Vec, at: HashFor, - ) -> Result>, Error>; + ) -> Result>, BackendError>; /// Fetch values underneath the given key from storage. async fn storage_fetch_descendant_values( &self, key: Vec, at: HashFor, - ) -> Result, Error>; + ) -> Result, BackendError>; /// Fetch the genesis hash - async fn genesis_hash(&self) -> Result, Error>; + async fn genesis_hash(&self) -> Result, BackendError>; /// Get a block header - async fn block_header(&self, at: HashFor) -> Result, Error>; + async fn block_header(&self, at: HashFor) -> Result, BackendError>; /// Return the extrinsics found in the block. Each extrinsic is represented /// by a vector of bytes which has _not_ been SCALE decoded (in other words, the /// first bytes in the vector will decode to the compact encoded length of the extrinsic) - async fn block_body(&self, at: HashFor) -> Result>>, Error>; + async fn block_body(&self, at: HashFor) -> Result>>, BackendError>; /// Get the most recent finalized block hash. /// Note: needed only in blocks client for finalized block stream; can prolly be removed. - async fn latest_finalized_block_ref(&self) -> Result>, Error>; + async fn latest_finalized_block_ref(&self) -> Result>, BackendError>; /// Get information about the current runtime. - async fn current_runtime_version(&self) -> Result; + async fn current_runtime_version(&self) -> Result; /// A stream of all new runtime versions as they occur. - async fn stream_runtime_version(&self) -> Result, Error>; + async fn stream_runtime_version(&self) + -> Result, BackendError>; /// A stream of all new block headers as they arrive. async fn stream_all_block_headers( &self, hasher: T::Hasher, - ) -> Result>)>, Error>; + ) -> Result>)>, BackendError>; /// A stream of best block headers. async fn stream_best_block_headers( &self, hasher: T::Hasher, - ) -> Result>)>, Error>; + ) -> Result>)>, BackendError>; /// A stream of finalized block headers. async fn stream_finalized_block_headers( &self, hasher: T::Hasher, - ) -> Result>)>, Error>; + ) -> Result>)>, BackendError>; /// Submit a transaction. This will return a stream of events about it. async fn submit_transaction( &self, bytes: &[u8], - ) -> Result>>, Error>; + ) -> Result>>, BackendError>; /// Make a call to some runtime API. async fn call( @@ -149,7 +150,7 @@ pub trait Backend: sealed::Sealed + Send + Sync + 'static { method: &str, call_parameters: Option<&[u8]>, at: HashFor, - ) -> Result, Error>; + ) -> Result, BackendError>; } /// helpful utility methods derived from those provided on [`Backend`] @@ -160,7 +161,7 @@ pub trait BackendExt: Backend { &self, key: Vec, at: HashFor, - ) -> Result>, Error> { + ) -> Result>, BackendError> { self.storage_fetch_values(vec![key], at) .await? .next() @@ -176,32 +177,39 @@ pub trait BackendExt: Backend { method: &str, call_parameters: Option<&[u8]>, at: HashFor, - ) -> Result { + ) -> Result { let bytes = self.call(method, call_parameters, at).await?; - let res = D::decode(&mut &*bytes)?; + let res = + D::decode(&mut &*bytes).map_err(BackendError::CouldNotScaleDecodeRuntimeResponse)?; Ok(res) } /// Return the metadata at some version. - async fn metadata_at_version(&self, version: u32, at: HashFor) -> Result { + async fn metadata_at_version( + &self, + version: u32, + at: HashFor, + ) -> Result { let param = version.encode(); let opaque: Option = self .call_decoding("Metadata_metadata_at_version", Some(¶m), at) .await?; let Some(opaque) = opaque else { - return Err(Error::Other("Metadata version not found".into())); + return Err(BackendError::MetadataVersionNotFound(version)); }; - let metadata: Metadata = Decode::decode(&mut &opaque.0[..])?; + let metadata: Metadata = + Decode::decode(&mut &opaque.0[..]).map_err(BackendError::CouldNotDecodeMetadata)?; Ok(metadata) } /// Return V14 metadata from the legacy `Metadata_metadata` call. - async fn legacy_metadata(&self, at: HashFor) -> Result { + async fn legacy_metadata(&self, at: HashFor) -> Result { let opaque: frame_metadata::OpaqueMetadata = self.call_decoding("Metadata_metadata", None, at).await?; - let metadata: Metadata = Decode::decode(&mut &opaque.0[..])?; + let metadata: Metadata = + Decode::decode(&mut &opaque.0[..]).map_err(BackendError::CouldNotDecodeMetadata)?; Ok(metadata) } } @@ -325,8 +333,8 @@ impl StreamOf { } } -/// A stream of [`Result`]. -pub type StreamOfResults = StreamOf>; +/// A stream of [`Result`]. +pub type StreamOfResults = StreamOf>; /// The status of the transaction. /// @@ -541,7 +549,7 @@ mod test { /// - `call` /// The test covers them because they follow the simple pattern of: /// ```rust,no_run,standalone_crate - /// async fn THE_THING(&self) -> Result, Error> { + /// async fn THE_THING(&self) -> Result, BackendError> { /// retry(|| ).await /// } /// ``` @@ -574,7 +582,7 @@ mod test { /// ```rust,no_run,standalone_crate /// async fn stream_the_thing( /// &self, - /// ) -> Result>)>, Error> { + /// ) -> Result>)>, BackendError> { /// let methods = self.methods.clone(); /// let retry_sub = retry_stream(move || { /// let methods = methods.clone(); @@ -635,7 +643,7 @@ mod test { ); assert!(matches!( results.next().await.unwrap(), - Err(Error::Rpc(RpcError::ClientError( + Err(BackendError::Rpc(RpcError::ClientError( subxt_rpcs::Error::Client(_) ))) )); @@ -644,7 +652,6 @@ mod test { } mod unstable_backend { - use crate::error::RpcError; use subxt_rpcs::methods::chain_head::{ self, Bytes, Initialized, MethodResponse, MethodResponseStarted, OperationError, OperationId, OperationStorageItems, RuntimeSpec, RuntimeVersionEvent, @@ -858,7 +865,7 @@ mod test { .next() .await .unwrap() - .is_err_and(|e| matches!(e, Error::Other(e) if e == "error")) + .is_err_and(|e| matches!(e, BackendError::Other(e) if e == "error")) ); assert!(response.next().await.is_none()); } @@ -1047,7 +1054,7 @@ mod test { let response = backend .storage_fetch_values(["ID1".into()].into(), random_hash()) .await; - assert!(matches!(response, Err(Error::Rpc(RpcError::LimitReached)))); + assert!(matches!(response, Err(e) if e.is_rpc_limit_reached())); // Advance the driver until a new chainHead_follow subscription has been started up. let _ = driver.next().await.unwrap(); diff --git a/subxt/src/backend/utils.rs b/subxt/src/backend/utils.rs index f18a9cf929a..5ead7056f99 100644 --- a/subxt/src/backend/utils.rs +++ b/subxt/src/backend/utils.rs @@ -1,7 +1,7 @@ //! RPC utils. use super::{StreamOf, StreamOfResults}; -use crate::error::Error; +use crate::error::BackendError; use futures::future::BoxFuture; use futures::{FutureExt, Stream, StreamExt}; use std::{future::Future, pin::Pin, task::Poll}; @@ -10,10 +10,11 @@ use std::{future::Future, pin::Pin, task::Poll}; type ResubscribeGetter = Box ResubscribeFuture + Send>; /// Future that resolves to a subscription stream. -type ResubscribeFuture = Pin, Error>> + Send>>; +type ResubscribeFuture = + Pin, BackendError>> + Send>>; pub(crate) enum PendingOrStream { - Pending(BoxFuture<'static, Result, Error>>), + Pending(BoxFuture<'static, Result, BackendError>>), Stream(StreamOfResults), } @@ -35,7 +36,7 @@ struct RetrySubscription { impl std::marker::Unpin for RetrySubscription {} impl Stream for RetrySubscription { - type Item = Result; + type Item = Result; fn poll_next( mut self: Pin<&mut Self>, @@ -92,7 +93,7 @@ impl Stream for RetrySubscription { /// ```rust,no_run,standalone_crate /// use subxt::backend::utils::retry; /// -/// async fn some_future() -> Result<(), subxt::error::Error> { +/// async fn some_future() -> Result<(), subxt::error::BackendError> { /// Ok(()) /// } /// @@ -101,10 +102,10 @@ impl Stream for RetrySubscription { /// let result = retry(|| some_future()).await; /// } /// ``` -pub async fn retry(mut retry_future: F) -> Result +pub async fn retry(mut retry_future: F) -> Result where F: FnMut() -> T, - T: Future>, + T: Future>, { const REJECTED_MAX_RETRIES: usize = 10; let mut rejected_retries = 0; @@ -163,7 +164,7 @@ where /// }).await; /// } /// ``` -pub async fn retry_stream(sub_stream: F) -> Result, Error> +pub async fn retry_stream(sub_stream: F) -> Result, BackendError> where F: FnMut() -> ResubscribeFuture + Send + 'static + Clone, R: Send + 'static, @@ -187,12 +188,12 @@ mod tests { use super::*; use crate::backend::StreamOf; - fn disconnect_err() -> Error { - Error::Rpc(subxt_rpcs::Error::DisconnectedWillReconnect(String::new()).into()) + fn disconnect_err() -> BackendError { + BackendError::Rpc(subxt_rpcs::Error::DisconnectedWillReconnect(String::new()).into()) } - fn custom_err() -> Error { - Error::Other(String::new()) + fn custom_err() -> BackendError { + BackendError::Other(String::new()) } #[tokio::test] @@ -213,7 +214,7 @@ mod tests { let result = retry_stream .take(5) - .collect::>>() + .collect::>>() .await; assert!(matches!(result[0], Ok(r) if r == 1)); @@ -270,6 +271,6 @@ mod tests { assert!(matches!(result[0], Ok(r) if r == 1)); assert!(matches!(result[1], Err(ref e) if e.is_disconnected_will_reconnect())); - assert!(matches!(result[2], Err(ref e) if matches!(e, Error::Other(_)))); + assert!(matches!(result[2], Err(ref e) if matches!(e, BackendError::Other(_)))); } } diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index 00326d7f4d7..cac88b254a4 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -7,10 +7,10 @@ use crate::{ blocks::Extrinsics, client::{OfflineClientT, OnlineClientT}, config::{Config, HashFor, Header}, - error::{BlockError, DecodeError, Error}, + error::{AccountNonceError, BlockError, EventsError, ExtrinsicError}, events, runtime_api::RuntimeApi, - storage::Storage, + storage::StorageClientAt, }; use codec::{Decode, Encode}; @@ -84,38 +84,51 @@ where C: OnlineClientT, { /// Return the events associated with the block, fetching them from the node if necessary. - pub async fn events(&self) -> Result, Error> { + pub async fn events(&self) -> Result, EventsError> { get_events(&self.client, self.hash(), &self.cached_events).await } /// Fetch and return the extrinsics in the block body. - pub async fn extrinsics(&self) -> Result, Error> { + pub async fn extrinsics(&self) -> Result, ExtrinsicError> { let block_hash = self.hash(); - let Some(extrinsics) = self.client.backend().block_body(block_hash).await? else { - return Err(BlockError::not_found(block_hash).into()); - }; - Extrinsics::new( + let extrinsics = self + .client + .backend() + .block_body(block_hash) + .await + .map_err(ExtrinsicError::CannotGetBlockBody)? + .ok_or_else(|| ExtrinsicError::BlockNotFound(block_hash.into()))?; + + let extrinsics = Extrinsics::new( self.client.clone(), extrinsics, self.cached_events.clone(), block_hash, - ) + )?; + + Ok(extrinsics) } /// Work with storage. - pub fn storage(&self) -> Storage { - Storage::new(self.client.clone(), self.block_ref.clone()) + pub fn storage(&self) -> StorageClientAt { + StorageClientAt::new(self.client.clone(), self.block_ref.clone()) } /// Execute a runtime API call at this block. - pub async fn runtime_api(&self) -> Result, Error> { - Ok(RuntimeApi::new(self.client.clone(), self.block_ref.clone())) + pub async fn runtime_api(&self) -> RuntimeApi { + RuntimeApi::new(self.client.clone(), self.block_ref.clone()) } /// Get the account nonce for a given account ID at this block. - pub async fn account_nonce(&self, account_id: &T::AccountId) -> Result { - get_account_nonce(&self.client, account_id, self.hash()).await + pub async fn account_nonce(&self, account_id: &T::AccountId) -> Result { + get_account_nonce(&self.client, account_id, self.hash()) + .await + .map_err(|e| BlockError::AccountNonceError { + block_hash: self.hash().into(), + account_id: account_id.encode().into(), + reason: e, + }) } } @@ -124,7 +137,7 @@ pub(crate) async fn get_events( client: &C, block_hash: HashFor, cached_events: &AsyncMutex>>, -) -> Result, Error> +) -> Result, EventsError> where T: Config, C: OnlineClientT, @@ -152,7 +165,7 @@ pub(crate) async fn get_account_nonce( client: &C, account_id: &T::AccountId, block_hash: HashFor, -) -> Result +) -> Result where C: OnlineClientT, T: Config, @@ -173,10 +186,9 @@ where 4 => u32::decode(cursor)?.into(), 8 => u64::decode(cursor)?, _ => { - return Err(Error::Decode(DecodeError::custom_string(format!( - "state call AccountNonceApi_account_nonce returned an unexpected number of bytes: {} (expected 2, 4 or 8)", - account_nonce_bytes.len() - )))); + return Err(AccountNonceError::WrongNumberOfBytes( + account_nonce_bytes.len(), + )); } }; Ok(account_nonce) diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index 62cad074d3b..87e5f556b56 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -7,7 +7,7 @@ use crate::{ backend::{BlockRef, StreamOfResults}, client::OnlineClientT, config::{Config, HashFor}, - error::{BlockError, Error}, + error::BlockError, utils::PhantomDataSendSync, }; use derive_where::derive_where; @@ -15,7 +15,7 @@ use futures::StreamExt; use std::future::Future; type BlockStream = StreamOfResults; -type BlockStreamRes = Result, Error>; +type BlockStreamRes = Result, BlockError>; /// A client for working with blocks. #[derive_where(Clone; Client)] @@ -49,14 +49,14 @@ where pub fn at( &self, block_ref: impl Into>>, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, BlockError>> + Send + 'static { self.at_or_latest(Some(block_ref.into())) } /// Obtain block details of the latest finalized block. pub fn at_latest( &self, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, BlockError>> + Send + 'static { self.at_or_latest(None) } @@ -65,18 +65,35 @@ where fn at_or_latest( &self, block_ref: Option>>, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, BlockError>> + Send + 'static { let client = self.client.clone(); async move { // If a block ref isn't provided, we'll get the latest finalized ref to use. let block_ref = match block_ref { Some(r) => r, - None => client.backend().latest_finalized_block_ref().await?, + None => client + .backend() + .latest_finalized_block_ref() + .await + .map_err(BlockError::CouldNotGetLatestBlock)?, }; - let block_header = match client.backend().block_header(block_ref.hash()).await? { + let maybe_block_header = client + .backend() + .block_header(block_ref.hash()) + .await + .map_err(|e| BlockError::CouldNotGetBlockHeader { + block_hash: block_ref.hash().into(), + reason: e, + })?; + + let block_header = match maybe_block_header { Some(header) => header, - None => return Err(BlockError::not_found(block_ref.hash()).into()), + None => { + return Err(BlockError::BlockNotFound { + block_hash: block_ref.hash().into(), + }); + } }; Ok(Block::new(block_header, block_ref, client)) @@ -89,14 +106,18 @@ where /// the time. pub fn subscribe_all( &self, - ) -> impl Future>, Error>> + Send + 'static + ) -> impl Future>, BlockError>> + Send + 'static where Client: Send + Sync + 'static, { let client = self.client.clone(); let hasher = client.hasher(); header_sub_fut_to_block_sub(self.clone(), async move { - let stream = client.backend().stream_all_block_headers(hasher).await?; + let stream = client + .backend() + .stream_all_block_headers(hasher) + .await + .map_err(BlockError::CouldNotSubscribeToAllBlocks)?; BlockStreamRes::Ok(stream) }) } @@ -107,14 +128,18 @@ where /// the time. pub fn subscribe_best( &self, - ) -> impl Future>, Error>> + Send + 'static + ) -> impl Future>, BlockError>> + Send + 'static where Client: Send + Sync + 'static, { let client = self.client.clone(); let hasher = client.hasher(); header_sub_fut_to_block_sub(self.clone(), async move { - let stream = client.backend().stream_best_block_headers(hasher).await?; + let stream = client + .backend() + .stream_best_block_headers(hasher) + .await + .map_err(BlockError::CouldNotSubscribeToBestBlocks)?; BlockStreamRes::Ok(stream) }) } @@ -122,7 +147,7 @@ where /// Subscribe to finalized blocks. pub fn subscribe_finalized( &self, - ) -> impl Future>, Error>> + Send + 'static + ) -> impl Future>, BlockError>> + Send + 'static where Client: Send + Sync + 'static, { @@ -132,7 +157,8 @@ where let stream = client .backend() .stream_finalized_block_headers(hasher) - .await?; + .await + .map_err(BlockError::CouldNotSubscribeToFinalizedBlocks)?; BlockStreamRes::Ok(stream) }) } @@ -143,10 +169,10 @@ where async fn header_sub_fut_to_block_sub( blocks_client: BlocksClient, sub: S, -) -> Result>, Error> +) -> Result>, BlockError> where T: Config, - S: Future>)>, Error>> + S: Future>)>, BlockError>> + Send + 'static, Client: OnlineClientT + Send + Sync + 'static, diff --git a/subxt/src/blocks/extrinsic_types.rs b/subxt/src/blocks/extrinsic_types.rs index 4ba491a7ba7..3be678ed582 100644 --- a/subxt/src/blocks/extrinsic_types.rs +++ b/subxt/src/blocks/extrinsic_types.rs @@ -6,18 +6,16 @@ use crate::{ blocks::block_types::{CachedEvents, get_events}, client::{OfflineClientT, OnlineClientT}, config::{Config, HashFor}, - error::Error, + error::{EventsError, ExtrinsicDecodeErrorAt, ExtrinsicError}, events, }; - use derive_where::derive_where; -use scale_decode::DecodeAsType; +use scale_decode::{DecodeAsFields, DecodeAsType}; use subxt_core::blocks::{ExtrinsicDetails as CoreExtrinsicDetails, Extrinsics as CoreExtrinsics}; // Re-export anything that's directly returned/used in the APIs below. pub use subxt_core::blocks::{ - ExtrinsicMetadataDetails, ExtrinsicTransactionExtension, ExtrinsicTransactionExtensions, - StaticExtrinsic, + ExtrinsicTransactionExtension, ExtrinsicTransactionExtensions, StaticExtrinsic, }; /// The body of a block. @@ -38,7 +36,7 @@ where extrinsics: Vec>, cached_events: CachedEvents, hash: HashFor, - ) -> Result { + ) -> Result { let inner = CoreExtrinsics::decode_from(extrinsics, client.metadata())?; Ok(Self { inner, @@ -81,10 +79,10 @@ where /// If an error occurs, all subsequent iterations return `None`. pub fn find( &self, - ) -> impl Iterator, Error>> { + ) -> impl Iterator, ExtrinsicError>> { self.inner.find::().map(|res| { match res { - Err(e) => Err(Error::from(e)), + Err(e) => Err(ExtrinsicError::from(e)), Ok(ext) => { // Wrap details from subxt-core into what we want here: let details = ExtrinsicDetails::new( @@ -105,18 +103,22 @@ where /// Iterate through the extrinsics using metadata to dynamically decode and skip /// them, and return the first extrinsic found which decodes to the provided `E` type. - pub fn find_first(&self) -> Result>, Error> { + pub fn find_first( + &self, + ) -> Result>, ExtrinsicError> { self.find::().next().transpose() } /// Iterate through the extrinsics using metadata to dynamically decode and skip /// them, and return the last extrinsic found which decodes to the provided `Ev` type. - pub fn find_last(&self) -> Result>, Error> { + pub fn find_last( + &self, + ) -> Result>, ExtrinsicError> { self.find::().last().transpose() } /// Find an extrinsics that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { + pub fn has(&self) -> Result { Ok(self.find::().next().transpose()?.is_some()) } } @@ -207,38 +209,33 @@ where self.inner.pallet_index() } - /// See [`subxt_core::blocks::ExtrinsicDetails::variant_index()`]. - pub fn variant_index(&self) -> u8 { - self.inner.variant_index() + /// See [`subxt_core::blocks::ExtrinsicDetails::call_index()`]. + pub fn call_index(&self) -> u8 { + self.inner.call_index() } /// See [`subxt_core::blocks::ExtrinsicDetails::pallet_name()`]. - pub fn pallet_name(&self) -> Result<&str, Error> { - self.inner.pallet_name().map_err(Into::into) - } - - /// See [`subxt_core::blocks::ExtrinsicDetails::variant_name()`]. - pub fn variant_name(&self) -> Result<&str, Error> { - self.inner.variant_name().map_err(Into::into) + pub fn pallet_name(&self) -> &str { + self.inner.pallet_name() } - /// See [`subxt_core::blocks::ExtrinsicDetails::extrinsic_metadata()`]. - pub fn extrinsic_metadata(&self) -> Result, Error> { - self.inner.extrinsic_metadata().map_err(Into::into) + /// See [`subxt_core::blocks::ExtrinsicDetails::call_name()`]. + pub fn call_name(&self) -> &str { + self.inner.call_name() } - /// See [`subxt_core::blocks::ExtrinsicDetails::field_values()`]. - pub fn field_values(&self) -> Result, Error> { - self.inner.field_values().map_err(Into::into) + /// See [`subxt_core::blocks::ExtrinsicDetails::decode_as_fields()`]. + pub fn decode_as_fields(&self) -> Result { + self.inner.decode_as_fields().map_err(Into::into) } /// See [`subxt_core::blocks::ExtrinsicDetails::as_extrinsic()`]. - pub fn as_extrinsic(&self) -> Result, Error> { + pub fn as_extrinsic(&self) -> Result, ExtrinsicError> { self.inner.as_extrinsic::().map_err(Into::into) } /// See [`subxt_core::blocks::ExtrinsicDetails::as_root_extrinsic()`]. - pub fn as_root_extrinsic(&self) -> Result { + pub fn as_root_extrinsic(&self) -> Result { self.inner.as_root_extrinsic::().map_err(Into::into) } } @@ -249,7 +246,7 @@ where C: OnlineClientT, { /// The events associated with the extrinsic. - pub async fn events(&self) -> Result, Error> { + pub async fn events(&self) -> Result, EventsError> { let events = get_events(&self.client, self.block_hash, &self.cached_events).await?; let ext_hash = self.inner.hash(); Ok(ExtrinsicEvents::new(ext_hash, self.index(), events)) @@ -308,7 +305,7 @@ impl ExtrinsicEvents { /// /// This works in the same way that [`events::Events::iter()`] does, with the /// exception that it filters out events not related to the submitted extrinsic. - pub fn iter(&self) -> impl Iterator, Error>> { + pub fn iter(&self) -> impl Iterator, EventsError>> { self.events.iter().filter(|ev| { ev.as_ref() .map(|ev| ev.phase() == events::Phase::ApplyExtrinsic(self.idx)) @@ -320,7 +317,7 @@ impl ExtrinsicEvents { /// /// This works in the same way that [`events::Events::find()`] does, with the /// exception that it filters out events not related to the submitted extrinsic. - pub fn find(&self) -> impl Iterator> { + pub fn find(&self) -> impl Iterator> { self.iter() .filter_map(|ev| ev.and_then(|ev| ev.as_event::()).transpose()) } @@ -330,7 +327,7 @@ impl ExtrinsicEvents { /// /// This works in the same way that [`events::Events::find_first()`] does, with the /// exception that it ignores events not related to the submitted extrinsic. - pub fn find_first(&self) -> Result, Error> { + pub fn find_first(&self) -> Result, EventsError> { self.find::().next().transpose() } @@ -339,7 +336,7 @@ impl ExtrinsicEvents { /// /// This works in the same way that [`events::Events::find_last()`] does, with the /// exception that it ignores events not related to the submitted extrinsic. - pub fn find_last(&self) -> Result, Error> { + pub fn find_last(&self) -> Result, EventsError> { self.find::().last().transpose() } @@ -347,7 +344,7 @@ impl ExtrinsicEvents { /// /// This works in the same way that [`events::Events::has()`] does, with the /// exception that it ignores events not related to the submitted extrinsic. - pub fn has(&self) -> Result { + pub fn has(&self) -> Result { Ok(self.find::().next().transpose()?.is_some()) } } diff --git a/subxt/src/book/usage/blocks.rs b/subxt/src/book/usage/blocks.rs index e6e714a649c..ac690167cb7 100644 --- a/subxt/src/book/usage/blocks.rs +++ b/subxt/src/book/usage/blocks.rs @@ -12,11 +12,11 @@ //! - Subscribe to [all](crate::blocks::BlocksClient::subscribe_all()), //! [best](crate::blocks::BlocksClient::subscribe_best()) or //! [finalized](crate::blocks::BlocksClient::subscribe_finalized()) blocks as they are produced. -//! Prefer to subscribe to finalized blocks unless you know what you're doing. +//! **Prefer to subscribe to finalized blocks unless you know what you're doing.** //! //! In either case, you'll end up with [`crate::blocks::Block`]'s, from which you can access various -//! information about the block, such a the [header](crate::blocks::Block::header()), [block -//! number](crate::blocks::Block::number()) and [body (the extrinsics)](crate::blocks::Block::extrinsics()). +//! information about the block, such a the [header](crate::blocks::Block::header()), +//! [block number](crate::blocks::Block::number()) and [body (the extrinsics)](crate::blocks::Block::extrinsics()). //! [`crate::blocks::Block`]'s also provide shortcuts to other Subxt APIs that will operate at the //! given block: //! @@ -29,8 +29,8 @@ //! //! ## Decoding Extrinsics //! -//! Given a block, you can [download the block body](crate::blocks::Block::extrinsics()) and [iterate over -//! the extrinsics](crate::blocks::Extrinsics::iter()) stored within it. The extrinsics yielded are of type +//! Given a block, you can [download the block body](crate::blocks::Block::extrinsics()) and +//! [iterate over the extrinsics](crate::blocks::Extrinsics::iter) stored within it. The extrinsics yielded are of type //! [ExtrinsicDetails](crate::blocks::ExtrinsicDetails), which is just a blob of bytes that also stores which //! pallet and call in that pallet it belongs to. It also contains information about signed extensions that //! have been used for submitting this extrinsic. @@ -64,8 +64,8 @@ //! get only [the first one](crate::blocks::Extrinsics::find_first), or [the last one](crate::blocks::Extrinsics::find_last). //! //! The following example monitors `TransferKeepAlive` extrinsics on the Polkadot network. -//! We statically decode them and access the [tip](crate::blocks::ExtrinsicTransactionExtensions::tip()) and [account nonce](crate::blocks::ExtrinsicTransactionExtensions::nonce()) -//! transaction extensions. +//! We statically decode them and access the [tip](crate::blocks::ExtrinsicTransactionExtensions::tip()) and +//! [account nonce](crate::blocks::ExtrinsicTransactionExtensions::nonce()) transaction extensions. //! //! ```rust,ignore #![doc = include_str!("../../../examples/block_decoding_static.rs")] @@ -73,11 +73,13 @@ //! //! ### Dynamically decode the extrinsic //! -//! Sometimes you might use subxt with metadata that is not known at compile time. In this case, you do not have access to a statically generated -//! interface module that contains the relevant Rust types. You can [decode ExtrinsicDetails dynamically](crate::blocks::ExtrinsicDetails::field_values()), -//! which gives you access to it's fields as a [scale value composite](scale_value::Composite). -//! The following example looks for signed extrinsics on the Polkadot network and retrieves their pallet name, variant name, data fields and transaction extensions dynamically. -//! Notice how we do not need to use code generation via the subxt macro. The only fixed component we provide is the [PolkadotConfig](crate::config::PolkadotConfig). +//! Sometimes you might use subxt with metadata that is not known at compile time. In this case, you do not +//! have access to a statically generated interface module that contains the relevant Rust types. You can +//! [decode ExtrinsicDetails dynamically](crate::blocks::ExtrinsicDetails::decode_as_fields()), which gives +//! you access to it's fields as a [scale value composite](scale_value::Composite). The following example +//! looks for signed extrinsics on the Polkadot network and retrieves their pallet name, variant name, data +//! fields and transaction extensions dynamically. Notice how we do not need to use code generation via the +//! subxt macro. The only fixed component we provide is the [PolkadotConfig](crate::config::PolkadotConfig). //! Other than that it works in a chain-agnostic way: //! //! ```rust,ignore @@ -90,10 +92,12 @@ //! The [Config](crate::Config) implementation for your chain defines which transaction extensions you expect. //! Once you get hold of the [ExtrinsicDetails](crate::blocks::ExtrinsicDetails) for an extrinsic you are interested in, //! you can try to [get its transaction extensions](crate::blocks::ExtrinsicDetails::transaction_extensions()). -//! These are only available on V4 signed extrinsics or V5 general extrinsics. You can try to [find a specific transaction extension](crate::blocks::ExtrinsicTransactionExtensions::find), -//! in the returned [transaction extensions](crate::blocks::ExtrinsicTransactionExtensions). -//! -//! Subxt also provides utility functions to get the [tip](crate::blocks::ExtrinsicTransactionExtensions::tip()) and the -//! [account nonce](crate::blocks::ExtrinsicTransactionExtensions::tip()) associated with an extrinsic, given its transaction extensions. -//! If you prefer to do things dynamically you can get the data of the transaction extension as a [scale value](crate::blocks::ExtrinsicTransactionExtension::value()). +//! These are only available on V4 signed extrinsics or V5 general extrinsics. You can try to +//! [find a specific transaction extension](crate::blocks::ExtrinsicTransactionExtensions::find), in the returned +//! [transaction extensions](crate::blocks::ExtrinsicTransactionExtensions). +//! +//! Subxt also provides utility functions to get the [tip](crate::blocks::ExtrinsicTransactionExtensions::tip()) and +//! the [account nonce](crate::blocks::ExtrinsicTransactionExtensions::nonce()) associated with an extrinsic, given +//! its transaction extensions. If you prefer to do things dynamically you can get the data of the transaction extension +//! as a [scale value](crate::blocks::ExtrinsicTransactionExtension::value()). //! diff --git a/subxt/src/book/usage/constants.rs b/subxt/src/book/usage/constants.rs index 4b08f768bf3..2fade787854 100644 --- a/subxt/src/book/usage/constants.rs +++ b/subxt/src/book/usage/constants.rs @@ -22,23 +22,22 @@ //! let constant_query = polkadot::constants().system().block_length(); //! ``` //! -//! Alternately, we can dynamically construct a constant query: +//! Alternately, we can dynamically construct a constant query. A dynamic query needs the return +//! type to be specified, where we can use [`crate::dynamic::Value`] if unsure: //! //! ```rust,no_run,standalone_crate //! use subxt::dynamic::Value; //! -//! let storage_query = subxt::dynamic::constant("System", "BlockLength"); +//! let storage_query = subxt::dynamic::constant::("System", "BlockLength"); //! ``` //! -//! Static queries also have a static return type, so the constant is decoded appropriately. In -//! addition, they are validated at runtime to ensure that they align with the current node state. -//! Dynamic queries must be decoded into some static type manually, or into the dynamic -//! [`crate::dynamic::Value`] type. -//! //! ## Submitting it //! -//! Constant queries are handed to Subxt via [`crate::constants::ConstantsClient::at()`]. It's worth -//! noting that constant values are pulled directly out of the node metadata which Subxt has +//! Call [`crate::constants::ConstantsClient::at()`] to return and decode the constant into the +//! type given by the address, or [`crate::constants::ConstantsClient::bytes_at()`] to return the +//! raw bytes for some constant. +//! +//! Constant values are pulled directly out of the node metadata which Subxt has //! already acquired, and so this function requires no network access and is available from a //! [`crate::OfflineClient`]. //! diff --git a/subxt/src/book/usage/custom_values.rs b/subxt/src/book/usage/custom_values.rs index 5838d71fbf2..8f27e9fe7fa 100644 --- a/subxt/src/book/usage/custom_values.rs +++ b/subxt/src/book/usage/custom_values.rs @@ -13,13 +13,32 @@ //! //! ## Getting a custom value //! -//! Custom values can be accessed via a [`CustomValuesClient`](crate::custom_values::CustomValuesClient). -//! The client exposes an `at` function by which a custom value can be fetched, given an address to this custom value. -//! An address can be as simple as the aforementioned __name__ as a [str]. This will return a dynamic value, that you can manually decode into the type you want. -//! Suppose, the custom types contain a value of type `Foo` under the name `"foo"` you can access it like in this example: +//! First, you must construct an address to access a custom value. This can be either: +//! - a raw [`str`] which assumes the return type to be the dynamic [`crate::dynamic::Value`] type, +//! - created via [`dynamic`](crate::custom_values::dynamic) function whereby you set the return type +//! that you want back, +//! - created via statically generated addresses as part of the `#[subxt]` macro which define the return type. +//! +//! With an address, use [`at`](crate::custom_values::CustomValuesClient::at) to access and decode specific values, and +//! [`bytes_at`](crate::custom_values::CustomValuesClient::bytes_at) to access the raw bytes. +//! +//! ## Examples +//! +//! Dynamically accessing a custom value using a [`str`] to select which one: //! //! ```rust,ignore -//! use subxt::{OnlineClient, PolkadotConfig, ext::{codec::Decode, scale_decode::DecodeAsType}}; +//! use subxt::{OnlineClient, PolkadotConfig, ext::scale_decode::DecodeAsType}; +//! use subxt::dynamic::Value; +//! +//! let api = OnlineClient::::new().await?; +//! let custom_value_client = api.custom_values(); +//! let foo: Value = custom_value_client.at("foo")?; +//! ``` +//! +//! Use the [`dynamic`](crate::custom_values::dynamic) function to select the return type: +//! +//! ```rust,ignore +//! use subxt::{OnlineClient, PolkadotConfig, ext::scale_decode::DecodeAsType}; //! //! #[derive(Decode, DecodeAsType, Debug)] //! struct Foo { @@ -29,9 +48,8 @@ //! //! let api = OnlineClient::::new().await?; //! let custom_value_client = api.custom_values(); -//! let foo_dynamic = custom_value_client.at("foo")?; -//! let foo: Foo = foo_dynamic.as_type()?; -//! +//! let custom_value_addr = subxt::custom_values::dynamic::("foo"); +//! let foo: Foo = custom_value_client.at(&custom_value_addr)?; //! ``` //! //! Alternatively we also provide a statically generated api for custom values: @@ -49,6 +67,3 @@ //! let foo = custom_value_client.at(&static_address)?; //! ``` //! -//! Note: Names of custom values are converted to __snake_case__ to produce a valid function name during code generation. -//! If there are multiple values where the names would be equal when converted to __snake_case__, functions might not be statically generated for some of them, because of naming conflicts. -//! Make sure names in the custom values of your metadata differ significantly. diff --git a/subxt/src/book/usage/runtime_apis.rs b/subxt/src/book/usage/runtime_apis.rs index 7485a8d2a8f..d944e051ac2 100644 --- a/subxt/src/book/usage/runtime_apis.rs +++ b/subxt/src/book/usage/runtime_apis.rs @@ -28,15 +28,17 @@ //! let runtime_call = polkadot::apis().metadata().metadata_versions(); //! ``` //! -//! Alternately, we can dynamically construct a runtime call: +//! Alternately, we can dynamically construct a runtime call. The input type can be a tuple or +//! vec or valid types implementing [`scale_encode::EncodeAsType`], and the output can be anything +//! implementing [`scale_decode::DecodeAsType`]: //! //! ```rust,no_run //! use subxt::dynamic::Value; //! -//! let runtime_call = subxt::dynamic::runtime_api_call( +//! let runtime_call = subxt::dynamic::runtime_api_call::<(), Vec>( //! "Metadata", //! "metadata_versions", -//! Vec::>::new() +//! () //! ); //! ``` //! diff --git a/subxt/src/book/usage/storage.rs b/subxt/src/book/usage/storage.rs index a76003c4a94..eba52250522 100644 --- a/subxt/src/book/usage/storage.rs +++ b/subxt/src/book/usage/storage.rs @@ -9,90 +9,57 @@ //! node storage. With Subxt, you can query this key/value storage with the following steps: //! //! 1. [Constructing a storage query](#constructing-a-storage-query). -//! 2. [Submitting the query to get back the associated values](#submitting-it). +//! 2. [Submitting the query to get back the associated entry](#submitting-it). +//! 3. [Fetching](#fetching-storage-entries) or [iterating](#iterating-storage-entries) over that +//! entry to retrieve the value or values within it. //! //! ## Constructing a storage query //! //! We can use the statically generated interface to build storage queries: //! //! ```rust,no_run,standalone_crate -//! use subxt_signer::sr25519::dev; -//! //! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] //! pub mod polkadot {} //! -//! let account = dev::alice().public_key().into(); -//! let storage_query = polkadot::storage().system().account(account); +//! let storage_query = polkadot::storage().system().account(); //! ``` //! -//! Alternately, we can dynamically construct a storage query. This will not be type checked or -//! validated until it's submitted: +//! Alternately, we can dynamically construct a storage query. A dynamic query needs the input +//! and return value types to be specified, where we can use [`crate::dynamic::Value`] if unsure. //! //! ```rust,no_run,standalone_crate -//! use subxt_signer::sr25519::dev; //! use subxt::dynamic::Value; //! -//! let account = dev::alice().public_key(); -//! let storage_query = subxt::dynamic::storage("System", "Account", vec![ -//! Value::from_bytes(account) -//! ]); +//! let storage_query = subxt::dynamic::storage::<(Value,), Value>("System", "Account"); //! ``` //! -//! As well as accessing specific entries, some storage locations can also be iterated over (such as -//! the map of account information). To do this, suffix `_iter` onto the query constructor (this -//! will only be available on static constructors when iteration is actually possible): -//! -//! ```rust,no_run,standalone_crate -//! #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")] -//! pub mod polkadot {} -//! -//! // A static query capable of iterating over accounts: -//! let storage_query = polkadot::storage().system().account_iter(); -//! // A dynamic query to do the same: -//! let storage_query = subxt::dynamic::storage("System", "Account", ()); -//! ``` -//! -//! Some storage entries are maps with multiple keys. As an example, we might end up with -//! an API like `runtime::storage().foo().bar(u8, bool, u16, String)` to fetch some entry "bar". -//! When this is the case, the codegen will generate multiple iterator query functions alongside -//! the function to fetch an individual value: -//! -//! - `runtime::storage().foo().bar(u8, bool, u16, String)`: fetch a single entry from the "bar" map. -//! - `runtime::storage().foo().bar_iter()`: iterate over all of the entries in the "bar" map. -//! - `runtime::storage().foo().bar_iter1(u8)`: iterate over all of the entries in the "bar" map under -//! a given `u8`. -//! - `runtime::storage().foo().bar_iter2(u8, bool)`: iterate over all of the entries in the "bar" map under -//! a given `u8` and `bool` value. -//! - `runtime::storage().foo().bar_iter3(u8, bool, u16)`: iterate over all of the entries in the "bar" map under -//! a given `u8`, `bool` and `u16` value. -//! -//! All valid storage queries implement [`crate::storage::Address`]. As well as describing -//! how to build a valid storage query, this trait also has some associated types that determine the -//! shape of the result you'll get back, and determine what you can do with it (ie, can you iterate -//! over storage entries using it). -//! -//! Static queries set appropriate values for these associated types, and can therefore only be used -//! where it makes sense. Dynamic queries don't know any better and can be used in more places, but -//! may fail at runtime instead if they are invalid in those places. -//! //! ## Submitting it //! -//! Storage queries can be handed to various functions in [`crate::storage::Storage`] in order to +//! Storage queries can be handed to various functions in [`crate::storage::StorageClientAt`] in order to //! obtain the associated values (also referred to as storage entries) back. //! +//! The core API here is [`crate::storage::StorageClientAt::entry()`], which takes a query and looks up the +//! corresponding storage entry, from which you can then fetch or iterate over the values contained within. +//! [`crate::storage::StorageClientAt::fetch()`] and [`crate::storage::StorageClientAt::iter()`] are shorthand +//! for this. +//! +//! When you wish to manually query some entry, [`crate::storage::StorageClientAt::fetch_raw()`] exists to take +//! in raw bytes pointing at some storage value, and return the value bytes if possible. [`crate::storage::StorageClientAt::storage_version()`] +//! and [`crate::storage::StorageClientAt::runtime_wasm_code()`] use this to retrieve the version of some storage API +//! and the current Runtime WASM blob respectively. +//! //! ### Fetching storage entries //! //! The simplest way to access storage entries is to construct a query and then call either -//! [`crate::storage::Storage::fetch()`] or [`crate::storage::Storage::fetch_or_default()`] (the -//! latter will only work for storage queries that have a default value when empty): +//! [`crate::storage::StorageClientAt::fetch()`]: //! //! ```rust,ignore #![doc = include_str!("../../../examples/storage_fetch.rs")] //! ``` //! -//! For completeness, below is an example using a dynamic query instead. The return type from a -//! dynamic query is a [`crate::dynamic::DecodedValueThunk`], which can be decoded into a -//! [`crate::dynamic::Value`], or else the raw bytes can be accessed instead. +//! For completeness, below is an example using a dynamic query instead. Dynamic queries can define the types that +//! they wish to accept inputs and decode the return value into ([`crate::dynamic::Value`] can be used here anywhere we +//! are not sure of the specific types). //! //! ```rust,ignore #![doc = include_str!("../../../examples/storage_fetch_dynamic.rs")] @@ -113,18 +80,3 @@ #![doc = include_str!("../../../examples/storage_iterating_dynamic.rs")] //! ``` //! -//! Here is an example of iterating over partial keys. In this example some multi-signature operations -//! are sent to the node. We can iterate over the pending multisig operations of a single multisig account: -//! -//! ```rust,ignore -#![doc = include_str!("../../../examples/storage_iterating_partial.rs")] -//! ``` -//! -//! ### Advanced -//! -//! For more advanced use cases, have a look at [`crate::storage::Storage::fetch_raw`] and -//! [`crate::storage::Storage::fetch_raw_keys`]. Both of these take raw bytes as arguments, which can be -//! obtained from a [`crate::storage::Address`] by using -//! [`crate::storage::StorageClient::address_bytes()`] or -//! [`crate::storage::StorageClient::address_root_bytes()`]. -//! diff --git a/subxt/src/client/mod.rs b/subxt/src/client/mod.rs index 3ca69b11576..8b9c917eec6 100644 --- a/subxt/src/client/mod.rs +++ b/subxt/src/client/mod.rs @@ -13,6 +13,6 @@ mod online_client; pub use offline_client::{OfflineClient, OfflineClientT}; pub use online_client::{ - ClientRuntimeUpdater, OnlineClient, OnlineClientT, RuntimeUpdaterStream, Update, UpgradeError, + ClientRuntimeUpdater, OnlineClient, OnlineClientT, RuntimeUpdaterStream, Update, }; pub use subxt_core::client::{ClientState, RuntimeVersion}; diff --git a/subxt/src/client/online_client.rs b/subxt/src/client/online_client.rs index 849b006b698..bdc9b03e69b 100644 --- a/subxt/src/client/online_client.rs +++ b/subxt/src/client/online_client.rs @@ -10,7 +10,7 @@ use crate::{ blocks::{BlockRef, BlocksClient}, config::{Config, HashFor}, constants::ConstantsClient, - error::Error, + error::{BackendError, OnlineClientError, RuntimeUpdateeApplyError, RuntimeUpdaterError}, events::EventsClient, runtime_api::RuntimeApiClient, storage::StorageClient, @@ -18,6 +18,7 @@ use crate::{ view_functions::ViewFunctionsClient, }; use derive_where::derive_where; +use futures::TryFutureExt; use futures::future; use std::sync::{Arc, RwLock}; use subxt_core::client::{ClientState, RuntimeVersion}; @@ -60,13 +61,13 @@ impl std::fmt::Debug for OnlineClient { impl OnlineClient { /// Construct a new [`OnlineClient`] using default settings which /// point to a locally running node on `ws://127.0.0.1:9944`. - pub async fn new() -> Result, Error> { + pub async fn new() -> Result, OnlineClientError> { let url = "ws://127.0.0.1:9944"; OnlineClient::from_url(url).await } /// Construct a new [`OnlineClient`], providing a URL to connect to. - pub async fn from_url(url: impl AsRef) -> Result, Error> { + pub async fn from_url(url: impl AsRef) -> Result, OnlineClientError> { subxt_rpcs::utils::validate_url_is_secure(url.as_ref())?; OnlineClient::from_insecure_url(url).await } @@ -74,7 +75,9 @@ impl OnlineClient { /// Construct a new [`OnlineClient`], providing a URL to connect to. /// /// Allows insecure URLs without SSL encryption, e.g. (http:// and ws:// URLs). - pub async fn from_insecure_url(url: impl AsRef) -> Result, Error> { + pub async fn from_insecure_url( + url: impl AsRef, + ) -> Result, OnlineClientError> { let client = RpcClient::from_insecure_url(url).await?; let backend = LegacyBackend::builder().build(client); OnlineClient::from_backend(Arc::new(backend)).await @@ -86,7 +89,7 @@ impl OnlineClient { /// This will use the current default [`Backend`], which may change in future releases. pub async fn from_rpc_client( rpc_client: impl Into, - ) -> Result, Error> { + ) -> Result, OnlineClientError> { let rpc_client = rpc_client.into(); let backend = Arc::new(LegacyBackend::builder().build(rpc_client)); OnlineClient::from_backend(backend).await @@ -110,7 +113,7 @@ impl OnlineClient { runtime_version: RuntimeVersion, metadata: impl Into, rpc_client: impl Into, - ) -> Result, Error> { + ) -> Result, OnlineClientError> { let rpc_client = rpc_client.into(); let backend = Arc::new(LegacyBackend::builder().build(rpc_client)); OnlineClient::from_backend_with(genesis_hash, runtime_version, metadata, backend) @@ -118,13 +121,23 @@ impl OnlineClient { /// Construct a new [`OnlineClient`] by providing an underlying [`Backend`] /// implementation to power it. Other details will be obtained from the chain. - pub async fn from_backend>(backend: Arc) -> Result, Error> { - let latest_block = backend.latest_finalized_block_ref().await?; + pub async fn from_backend>( + backend: Arc, + ) -> Result, OnlineClientError> { + let latest_block = backend + .latest_finalized_block_ref() + .await + .map_err(OnlineClientError::CannotGetLatestFinalizedBlock)?; let (genesis_hash, runtime_version, metadata) = future::join3( - backend.genesis_hash(), - backend.current_runtime_version(), - OnlineClient::fetch_metadata(&*backend, latest_block.hash()), + backend + .genesis_hash() + .map_err(OnlineClientError::CannotGetGenesisHash), + backend + .current_runtime_version() + .map_err(OnlineClientError::CannotGetCurrentRuntimeVersion), + OnlineClient::fetch_metadata(&*backend, latest_block.hash()) + .map_err(OnlineClientError::CannotFetchMetadata), ) .await; @@ -148,7 +161,7 @@ impl OnlineClient { runtime_version: RuntimeVersion, metadata: impl Into, backend: Arc, - ) -> Result, Error> { + ) -> Result, OnlineClientError> { use subxt_core::config::Hasher; let metadata = metadata.into(); @@ -169,7 +182,7 @@ impl OnlineClient { async fn fetch_metadata( backend: &dyn Backend, block_hash: HashFor, - ) -> Result { + ) -> Result { #[cfg(feature = "unstable-metadata")] { /// The unstable metadata version number. @@ -194,7 +207,7 @@ impl OnlineClient { async fn fetch_latest_stable_metadata( backend: &dyn Backend, block_hash: HashFor, - ) -> Result { + ) -> Result { // The metadata versions we support in Subxt, from newest to oldest. use subxt_metadata::SUPPORTED_METADATA_VERSIONS; @@ -235,7 +248,7 @@ impl OnlineClient { /// tokio::spawn(async move { /// let mut update_stream = updater.runtime_updates().await.unwrap(); /// - /// while let Some(Ok(update)) = update_stream.next().await { + /// while let Ok(update) = update_stream.next().await { /// let version = update.runtime_version().spec_version; /// /// match updater.apply_update(update) { @@ -416,9 +429,9 @@ impl ClientRuntimeUpdater { } /// Tries to apply a new update. - pub fn apply_update(&self, update: Update) -> Result<(), UpgradeError> { + pub fn apply_update(&self, update: Update) -> Result<(), RuntimeUpdateeApplyError> { if !self.is_runtime_version_different(&update.runtime_version) { - return Err(UpgradeError::SameVersion); + return Err(RuntimeUpdateeApplyError::SameVersion); } self.do_update(update); @@ -430,12 +443,12 @@ impl ClientRuntimeUpdater { /// /// *Note:* This will run indefinitely until it errors, so the typical usage /// would be to run it in a separate background task. - pub async fn perform_runtime_updates(&self) -> Result<(), Error> { + pub async fn perform_runtime_updates(&self) -> Result<(), RuntimeUpdaterError> { // Obtain an update subscription to further detect changes in the runtime version of the node. let mut runtime_version_stream = self.runtime_updates().await?; - while let Some(update) = runtime_version_stream.next().await { - let update = update?; + loop { + let update = runtime_version_stream.next().await?; // This only fails if received the runtime version is the same the current runtime version // which might occur because that runtime subscriptions in substrate sends out the initial @@ -443,8 +456,6 @@ impl ClientRuntimeUpdater { // Thus, fine to ignore here as it strictly speaking isn't really an error let _ = self.apply_update(update); } - - Ok(()) } /// Low-level API to get runtime updates as a stream but it's doesn't check if the @@ -452,9 +463,16 @@ impl ClientRuntimeUpdater { /// /// Instead that's up to the user of this API to decide when to update and /// to perform the actual updating. - pub async fn runtime_updates(&self) -> Result, Error> { + pub async fn runtime_updates(&self) -> Result, RuntimeUpdaterError> { + let stream = self + .0 + .backend() + .stream_runtime_version() + .await + .map_err(RuntimeUpdaterError::CannotStreamRuntimeVersion)?; + Ok(RuntimeUpdaterStream { - stream: self.0.backend().stream_runtime_version().await?, + stream, client: self.0.clone(), }) } @@ -468,38 +486,27 @@ pub struct RuntimeUpdaterStream { impl RuntimeUpdaterStream { /// Wait for the next runtime update. - pub async fn next(&mut self) -> Option> { - let runtime_version = match self.stream.next().await? { - Ok(runtime_version) => runtime_version, - Err(err) => return Some(Err(err)), - }; - - let at = - match wait_runtime_upgrade_in_finalized_block(&self.client, &runtime_version).await? { - Ok(at) => at, - Err(err) => return Some(Err(err)), - }; - - let metadata = match OnlineClient::fetch_metadata(self.client.backend(), at.hash()).await { - Ok(metadata) => metadata, - Err(err) => return Some(Err(err)), - }; - - Some(Ok(Update { + pub async fn next(&mut self) -> Result { + let runtime_version = self + .stream + .next() + .await + .ok_or(RuntimeUpdaterError::UnexpectedEndOfUpdateStream)? + .map_err(RuntimeUpdaterError::CannotGetNextRuntimeVersion)?; + + let at = wait_runtime_upgrade_in_finalized_block(&self.client, &runtime_version).await?; + + let metadata = OnlineClient::fetch_metadata(self.client.backend(), at.hash()) + .await + .map_err(RuntimeUpdaterError::CannotFetchNewMetadata)?; + + Ok(Update { metadata, runtime_version, - })) + }) } } -/// Error that can occur during upgrade. -#[non_exhaustive] -#[derive(Debug, Clone)] -pub enum UpgradeError { - /// The version is the same as the current version. - SameVersion, -} - /// Represents the state when a runtime upgrade occurred. pub struct Update { runtime_version: RuntimeVersion, @@ -522,64 +529,52 @@ impl Update { async fn wait_runtime_upgrade_in_finalized_block( client: &OnlineClient, runtime_version: &RuntimeVersion, -) -> Option>, Error>> { - use scale_value::At; - +) -> Result>, RuntimeUpdaterError> { let hasher = client .inner .read() .expect("Lock shouldn't be poisoned") .hasher; - let mut block_sub = match client + let mut block_sub = client .backend() .stream_finalized_block_headers(hasher) .await - { - Ok(s) => s, - Err(err) => return Some(Err(err)), - }; + .map_err(RuntimeUpdaterError::CannotStreamFinalizedBlocks)?; let block_ref = loop { - let (_, block_ref) = match block_sub.next().await? { - Ok(n) => n, - Err(err) => return Some(Err(err)), - }; - - let key: Vec = vec![]; - let addr = crate::dynamic::storage("System", "LastRuntimeUpgrade", key); - - let chunk = match client.storage().at(block_ref.hash()).fetch(&addr).await { - Ok(Some(v)) => v, - Ok(None) => { - // The storage `system::lastRuntimeUpgrade` should always exist. - // - unreachable!("The storage item `system::lastRuntimeUpgrade` should always exist") - } - Err(e) => return Some(Err(e)), - }; - - let scale_val = match chunk.to_value() { - Ok(v) => v, - Err(e) => return Some(Err(e.into())), - }; - - let Some(Ok(spec_version)) = scale_val - .at("spec_version") - .and_then(|v| v.as_u128()) - .map(u32::try_from) - else { - return Some(Err(Error::Other( - "Decoding `RuntimeVersion::spec_version` as u32 failed".to_string(), - ))); - }; + let (_, block_ref) = block_sub + .next() + .await + .ok_or(RuntimeUpdaterError::UnexpectedEndOfBlockStream)? + .map_err(RuntimeUpdaterError::CannotGetNextFinalizedBlock)?; + + let addr = + crate::dynamic::storage::<(), scale_value::Value>("System", "LastRuntimeUpgrade"); + + let client_at = client.storage().at(block_ref.hash()); + let value = client_at + .entry(addr) + // The storage `system::lastRuntimeUpgrade` should always exist. + // + .map_err(|_| RuntimeUpdaterError::CantFindSystemLastRuntimeUpgrade)? + .fetch(()) + .await + .map_err(RuntimeUpdaterError::CantFetchLastRuntimeUpgrade)? + .decode_as::() + .map_err(RuntimeUpdaterError::CannotDecodeLastRuntimeUpgrade)?; + + #[derive(scale_decode::DecodeAsType)] + struct LastRuntimeUpgrade { + spec_version: u32, + } // We are waiting for the chain to have the same spec version // as sent out via the runtime subscription. - if spec_version == runtime_version.spec_version { + if value.spec_version == runtime_version.spec_version { break block_ref; } }; - Some(Ok(block_ref)) + Ok(block_ref) } diff --git a/subxt/src/constants/constants_client.rs b/subxt/src/constants/constants_client.rs index b098e0684a6..26baa4ab493 100644 --- a/subxt/src/constants/constants_client.rs +++ b/subxt/src/constants/constants_client.rs @@ -2,7 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::{Config, client::OfflineClientT, error::Error}; +use crate::{Config, client::OfflineClientT, error::ConstantError}; use derive_where::derive_where; use subxt_core::constants::address::Address; @@ -28,16 +28,22 @@ impl> ConstantsClient { /// if the address is valid (or if it's not possible to check since the address has no validation hash). /// Return an error if the address was not valid or something went wrong trying to validate it (ie /// the pallet or constant in question do not exist at all). - pub fn validate(&self, address: &Addr) -> Result<(), Error> { + pub fn validate(&self, address: Addr) -> Result<(), ConstantError> { let metadata = self.client.metadata(); - subxt_core::constants::validate(address, &metadata).map_err(Error::from) + subxt_core::constants::validate(address, &metadata) } /// Access the constant at the address given, returning the type defined by this address. /// This is probably used with addresses given from static codegen, although you can manually /// construct your own, too. - pub fn at(&self, address: &Addr) -> Result { + pub fn at(&self, address: Addr) -> Result { let metadata = self.client.metadata(); - subxt_core::constants::get(address, &metadata).map_err(Error::from) + subxt_core::constants::get(address, &metadata) + } + + /// Access the bytes of a constant by the address it is registered under. + pub fn bytes_at(&self, address: Addr) -> Result, ConstantError> { + let metadata = self.client.metadata(); + subxt_core::constants::get_bytes(address, &metadata) } } diff --git a/subxt/src/constants/mod.rs b/subxt/src/constants/mod.rs index dd7b45138fe..b9b3e9380af 100644 --- a/subxt/src/constants/mod.rs +++ b/subxt/src/constants/mod.rs @@ -7,6 +7,4 @@ mod constants_client; pub use constants_client::ConstantsClient; -pub use subxt_core::constants::address::{ - Address, DefaultAddress, DynamicAddress, StaticAddress, dynamic, -}; +pub use subxt_core::constants::address::{Address, DynamicAddress, StaticAddress, dynamic}; diff --git a/subxt/src/custom_values/custom_values_client.rs b/subxt/src/custom_values/custom_values_client.rs index 5141f150c31..0414b0a2d1d 100644 --- a/subxt/src/custom_values/custom_values_client.rs +++ b/subxt/src/custom_values/custom_values_client.rs @@ -1,8 +1,8 @@ use crate::client::OfflineClientT; -use crate::{Config, Error}; +use crate::{Config, error::CustomValueError}; use derive_where::derive_where; -use subxt_core::custom_values::address::{Address, Yes}; +use subxt_core::custom_values::address::{Address, Maybe}; /// A client for accessing custom values stored in the metadata. #[derive_where(Clone; Client)] @@ -24,29 +24,29 @@ impl CustomValuesClient { impl> CustomValuesClient { /// Access a custom value by the address it is registered under. This can be just a [str] to get back a dynamic value, /// or a static address from the generated static interface to get a value of a static type returned. - pub fn at + ?Sized>( + pub fn at>( &self, - address: &Addr, - ) -> Result { - subxt_core::custom_values::get(address, &self.client.metadata()).map_err(Into::into) + address: Addr, + ) -> Result { + subxt_core::custom_values::get(address, &self.client.metadata()) } /// Access the bytes of a custom value by the address it is registered under. - pub fn bytes_at(&self, address: &Addr) -> Result, Error> { - subxt_core::custom_values::get_bytes(address, &self.client.metadata()).map_err(Into::into) + pub fn bytes_at(&self, address: Addr) -> Result, CustomValueError> { + subxt_core::custom_values::get_bytes(address, &self.client.metadata()) } /// Run the validation logic against some custom value address you'd like to access. Returns `Ok(())` /// if the address is valid (or if it's not possible to check since the address has no validation hash). /// Returns an error if the address was not valid (wrong name, type or raw bytes) - pub fn validate(&self, address: &Addr) -> Result<(), Error> { - subxt_core::custom_values::validate(address, &self.client.metadata()).map_err(Into::into) + pub fn validate(&self, address: Addr) -> Result<(), CustomValueError> { + subxt_core::custom_values::validate(address, &self.client.metadata()) } } #[cfg(test)] mod tests { - use crate::custom_values::CustomValuesClient; + use crate::custom_values::{self, CustomValuesClient}; use crate::{Metadata, OfflineClient, SubstrateConfig}; use codec::Encode; use scale_decode::DecodeAsType; @@ -104,7 +104,7 @@ mod tests { }; let metadata: subxt_metadata::Metadata = frame_metadata.try_into().unwrap(); - Metadata::from(metadata) + metadata } #[test] @@ -117,10 +117,12 @@ mod tests { }, mock_metadata(), ); + let custom_value_client = CustomValuesClient::new(client); assert!(custom_value_client.at("No one").is_err()); - let person_decoded_value_thunk = custom_value_client.at("Person").unwrap(); - let person: Person = person_decoded_value_thunk.as_type().unwrap(); + + let person_addr = custom_values::dynamic::("Person"); + let person = custom_value_client.at(&person_addr).unwrap(); assert_eq!( person, Person { diff --git a/subxt/src/custom_values/mod.rs b/subxt/src/custom_values/mod.rs index 25103e9c31b..e1f5d3a0d06 100644 --- a/subxt/src/custom_values/mod.rs +++ b/subxt/src/custom_values/mod.rs @@ -7,4 +7,4 @@ mod custom_values_client; pub use custom_values_client::CustomValuesClient; -pub use subxt_core::custom_values::address::{Address, StaticAddress, Yes}; +pub use subxt_core::custom_values::address::{Address, DynamicAddress, StaticAddress, dynamic}; diff --git a/subxt/src/error/dispatch_error.rs b/subxt/src/error/dispatch_error.rs index c63211fbbfc..4b27e63dfde 100644 --- a/subxt/src/error/dispatch_error.rs +++ b/subxt/src/error/dispatch_error.rs @@ -5,16 +5,15 @@ //! A representation of the dispatch error; an error returned when //! something fails in trying to submit/execute a transaction. -use crate::metadata::{DecodeWithMetadata, Metadata}; +use super::{DispatchErrorDecodeError, ModuleErrorDecodeError, ModuleErrorDetailsError}; +use crate::metadata::Metadata; use core::fmt::Debug; use scale_decode::{DecodeAsType, TypeResolver, visitor::DecodeAsTypeResult}; - use std::{borrow::Cow, marker::PhantomData}; -use super::{Error, MetadataError}; - /// An error dispatching a transaction. #[derive(Debug, thiserror::Error, PartialEq, Eq)] +#[allow(clippy::large_enum_variant)] #[non_exhaustive] pub enum DispatchError { /// Some error occurred. @@ -169,11 +168,20 @@ impl std::fmt::Display for ModuleError { impl ModuleError { /// Return more details about this error. - pub fn details(&self) -> Result, MetadataError> { - let pallet = self.metadata.pallet_by_index_err(self.pallet_index())?; + pub fn details(&self) -> Result, ModuleErrorDetailsError> { + let pallet = self + .metadata + .pallet_by_error_index(self.pallet_index()) + .ok_or(ModuleErrorDetailsError::PalletNotFound { + pallet_index: self.pallet_index(), + })?; + let variant = pallet .error_variant_by_index(self.error_index()) - .ok_or_else(|| MetadataError::VariantIndexNotFound(self.error_index()))?; + .ok_or_else(|| ModuleErrorDetailsError::ErrorVariantNotFound { + pallet_name: pallet.name().into(), + error_index: self.error_index(), + })?; Ok(ModuleErrorDetails { pallet, variant }) } @@ -209,12 +217,13 @@ impl ModuleError { } /// Attempts to decode the ModuleError into the top outer Error enum. - pub fn as_root_error(&self) -> Result { + pub fn as_root_error(&self) -> Result { let decoded = E::decode_as_type( &mut &self.bytes[..], self.metadata.outer_enums().error_enum_ty(), self.metadata.types(), - )?; + ) + .map_err(ModuleErrorDecodeError)?; Ok(decoded) } @@ -223,7 +232,7 @@ impl ModuleError { /// Details about the module error. pub struct ModuleErrorDetails<'a> { /// The pallet that the error is in - pub pallet: crate::metadata::types::PalletMetadata<'a>, + pub pallet: subxt_metadata::PalletMetadata<'a>, /// The variant representing the error pub variant: &'a scale_info::Variant, } @@ -234,11 +243,11 @@ impl DispatchError { pub fn decode_from<'a>( bytes: impl Into>, metadata: Metadata, - ) -> Result { + ) -> Result { let bytes = bytes.into(); let dispatch_error_ty_id = metadata .dispatch_error_ty() - .ok_or(MetadataError::DispatchErrorNotFound)?; + .ok_or(DispatchErrorDecodeError::DispatchErrorTypeIdNotFound)?; // The aim is to decode our bytes into roughly this shape. This is copied from // `sp_runtime::DispatchError`; we need the variant names and any inner variant @@ -290,11 +299,12 @@ impl DispatchError { } // Decode into our temporary error: - let decoded_dispatch_err = DecodedDispatchError::decode_with_metadata( + let decoded_dispatch_err = DecodedDispatchError::decode_as_type( &mut &*bytes, dispatch_error_ty_id, - &metadata, - )?; + metadata.types(), + ) + .map_err(DispatchErrorDecodeError::CouldNotDecodeDispatchError)?; // Convert into the outward-facing error, mainly by handling the Module variant. let dispatch_error = match decoded_dispatch_err { @@ -333,7 +343,9 @@ impl DispatchError { "Can't decode error sp_runtime::DispatchError: bytes do not match known shapes" ); // Return _all_ of the bytes; every "unknown" return should be consistent. - return Err(super::Error::Unknown(bytes.to_vec())); + return Err(DispatchErrorDecodeError::CouldNotDecodeModuleError { + bytes: bytes.to_vec(), + }); }; // And return our outward-facing version: diff --git a/subxt/src/error/hex.rs b/subxt/src/error/hex.rs new file mode 100644 index 00000000000..01d67a998ea --- /dev/null +++ b/subxt/src/error/hex.rs @@ -0,0 +1,15 @@ +/// Display hex strings. +#[derive(PartialEq, Eq, Clone, Debug, PartialOrd, Ord)] +pub struct Hex(String); + +impl> From for Hex { + fn from(value: T) -> Self { + Hex(hex::encode(value.as_ref())) + } +} + +impl std::fmt::Display for Hex { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } +} diff --git a/subxt/src/error/mod.rs b/subxt/src/error/mod.rs index d19bdba1988..52349f42da2 100644 --- a/subxt/src/error/mod.rs +++ b/subxt/src/error/mod.rs @@ -5,8 +5,7 @@ //! Types representing the errors that can be returned. mod dispatch_error; - -use subxt_core::error::{BlockError as CoreBlockError, Error as CoreError}; +mod hex; crate::macros::cfg_unstable_light_client! { pub use subxt_lightclient::LightClientError; @@ -18,120 +17,183 @@ pub use dispatch_error::{ }; // Re-expose the errors we use from other crates here: -pub use crate::metadata::Metadata; +pub use crate::Metadata; +pub use hex::Hex; pub use scale_decode::Error as DecodeError; pub use scale_encode::Error as EncodeError; -pub use subxt_core::error::{ExtrinsicError, MetadataError, StorageAddressError}; pub use subxt_metadata::TryFromError as MetadataTryFromError; -/// The underlying error enum, generic over the type held by the `Runtime` -/// variant. Prefer to use the [`Error`] and [`Error`] aliases over -/// using this type directly. +// Re-export core error types we're just reusing. +pub use subxt_core::error::{ + ConstantError, + CustomValueError, + EventsError as CoreEventsError, + // These errors are exposed as-is: + ExtrinsicDecodeErrorAt, + // These errors are wrapped: + ExtrinsicError as CoreExtrinsicError, + RuntimeApiError as CoreRuntimeApiError, + StorageError as CoreStorageError, + StorageKeyError, + StorageValueError, + ViewFunctionError as CoreViewFunctionError, +}; + +/// A global error type. Any of the errors exposed here can convert into this +/// error via `.into()`, but this error isn't itself exposed from anything. #[derive(Debug, thiserror::Error)] #[non_exhaustive] +#[allow(missing_docs)] pub enum Error { - /// Io error. - #[error("Io error: {0}")] - Io(#[from] std::io::Error), - /// Codec error. - #[error("Scale codec error: {0}")] - Codec(#[from] codec::Error), - /// Rpc error. #[error(transparent)] - Rpc(#[from] RpcError), - /// Serde serialization error - #[error("Serde json error: {0}")] - Serialization(#[from] serde_json::error::Error), - /// Error working with metadata. - #[error("Metadata error: {0}")] - Metadata(#[from] MetadataError), - /// Error decoding metadata. - #[error("Metadata Decoding error: {0}")] - MetadataDecoding(#[from] MetadataTryFromError), - /// Runtime error. - #[error("Runtime error: {0}")] - Runtime(#[from] DispatchError), - /// Error decoding to a [`crate::dynamic::Value`]. - #[error("Error decoding into dynamic value: {0}")] - Decode(#[from] DecodeError), - /// Error encoding from a [`crate::dynamic::Value`]. - #[error("Error encoding from dynamic value: {0}")] - Encode(#[from] EncodeError), - /// Transaction progress error. - #[error("Transaction error: {0}")] - Transaction(#[from] TransactionError), - /// Error constructing the appropriate extrinsic params. - #[error("Extrinsic params error: {0}")] - Extrinsic(#[from] ExtrinsicError), - /// Block related error. - #[error("Block error: {0}")] - Block(#[from] BlockError), - /// An error encoding a storage address. - #[error("Error encoding storage address: {0}")] - StorageAddress(#[from] StorageAddressError), - /// The bytes representing an error that we were unable to decode. - #[error("An error occurred but it could not be decoded: {0:?}")] - Unknown(Vec), - /// Light client error. + ExtrinsicDecodeErrorAt(#[from] ExtrinsicDecodeErrorAt), + #[error(transparent)] + ConstantError(#[from] ConstantError), + #[error(transparent)] + CustomValueError(#[from] CustomValueError), + #[error(transparent)] + StorageKeyError(#[from] StorageKeyError), + #[error(transparent)] + StorageValueError(#[from] StorageValueError), + #[error(transparent)] + BackendError(#[from] BackendError), + #[error(transparent)] + BlockError(#[from] BlockError), + #[error(transparent)] + AccountNonceError(#[from] AccountNonceError), + #[error(transparent)] + OnlineClientError(#[from] OnlineClientError), + #[error(transparent)] + RuntimeUpdaterError(#[from] RuntimeUpdaterError), + #[error(transparent)] + RuntimeUpdateeApplyError(#[from] RuntimeUpdateeApplyError), + #[error(transparent)] + RuntimeApiError(#[from] RuntimeApiError), + #[error(transparent)] + EventsError(#[from] EventsError), + #[error(transparent)] + ExtrinsicError(#[from] ExtrinsicError), + #[error(transparent)] + ViewFunctionError(#[from] ViewFunctionError), + #[error(transparent)] + TransactionProgressError(#[from] TransactionProgressError), + #[error(transparent)] + TransactionStatusError(#[from] TransactionStatusError), + #[error(transparent)] + TransactionEventsError(#[from] TransactionEventsError), + #[error(transparent)] + TransactionFinalizedSuccessError(#[from] TransactionFinalizedSuccessError), + #[error(transparent)] + ModuleErrorDetailsError(#[from] ModuleErrorDetailsError), + #[error(transparent)] + ModuleErrorDecodeError(#[from] ModuleErrorDecodeError), + #[error(transparent)] + DispatchErrorDecodeError(#[from] DispatchErrorDecodeError), + #[error(transparent)] + StorageError(#[from] StorageError), + // Dev note: Subxt doesn't directly return Raw* errors. These exist so that when + // users use common crates (like parity-scale-codec and subxt-rpcs), errors returned + // there can be handled automatically using ? when the expected error is subxt::Error. + #[error("Other RPC client error: {0}")] + OtherRpcClientError(#[from] subxt_rpcs::Error), + #[error("Other codec error: {0}")] + OtherCodecError(#[from] codec::Error), #[cfg(feature = "unstable-light-client")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-light-client")))] - #[error("An error occurred but it could not be decoded: {0}")] - LightClient(#[from] LightClientError), - /// Other error. + #[error("Other light client error: {0}")] + OtherLightClientError(#[from] subxt_lightclient::LightClientError), + #[cfg(feature = "unstable-light-client")] + #[error("Other light client RPC error: {0}")] + OtherLightClientRpcError(#[from] subxt_lightclient::LightClientRpcError), + // Dev note: Nothing in subxt should ever emit this error. It can instead be used + // to easily map other errors into a subxt::Error for convenience. Some From impls + // make this automatic for common "other" error types. #[error("Other error: {0}")] - Other(String), + Other(Box), } -impl From for Error { - fn from(value: CoreError) -> Self { - match value { - CoreError::Codec(e) => Error::Codec(e), - CoreError::Metadata(e) => Error::Metadata(e), - CoreError::StorageAddress(e) => Error::StorageAddress(e), - CoreError::Decode(e) => Error::Decode(e), - CoreError::Encode(e) => Error::Encode(e), - CoreError::Extrinsic(e) => Error::Extrinsic(e), - CoreError::Block(e) => Error::Block(e.into()), - } +impl From for Error { + fn from(value: std::convert::Infallible) -> Self { + match value {} } } -impl<'a> From<&'a str> for Error { - fn from(error: &'a str) -> Self { - Error::Other(error.into()) +impl Error { + /// Create a generic error. This is a quick workaround when you are using + /// [`Error`] and have a non-Subxt error to return. + pub fn other(error: E) -> Error { + Error::Other(Box::new(error)) } -} -impl From for Error { - fn from(error: String) -> Self { - Error::Other(error) + /// Create a generic error from a string. This is a quick workaround when you are using + /// [`Error`] and have a non-Subxt error to return. + pub fn other_str(error: impl Into) -> Error { + #[derive(thiserror::Error, Debug, Clone)] + #[error("{0}")] + struct StrError(String); + Error::Other(Box::new(StrError(error.into()))) } -} -impl From for Error { - fn from(value: std::convert::Infallible) -> Self { - match value {} + /// Checks whether the error was caused by a RPC re-connection. + pub fn is_disconnected_will_reconnect(&self) -> bool { + matches!( + self.backend_error(), + Some(BackendError::Rpc(RpcError::ClientError( + subxt_rpcs::Error::DisconnectedWillReconnect(_) + ))) + ) } -} -impl From for Error { - fn from(value: scale_decode::visitor::DecodeError) -> Self { - Error::Decode(value.into()) + /// Checks whether the error was caused by a RPC request being rejected. + pub fn is_rpc_limit_reached(&self) -> bool { + matches!( + self.backend_error(), + Some(BackendError::Rpc(RpcError::LimitReached)) + ) } -} -impl From for Error { - fn from(value: subxt_rpcs::Error) -> Self { - Error::Rpc(value.into()) + fn backend_error(&self) -> Option<&BackendError> { + match self { + Error::BlockError(e) => e.backend_error(), + Error::AccountNonceError(e) => e.backend_error(), + Error::OnlineClientError(e) => e.backend_error(), + Error::RuntimeUpdaterError(e) => e.backend_error(), + Error::RuntimeApiError(e) => e.backend_error(), + Error::EventsError(e) => e.backend_error(), + Error::ExtrinsicError(e) => e.backend_error(), + Error::ViewFunctionError(e) => e.backend_error(), + Error::TransactionProgressError(e) => e.backend_error(), + Error::TransactionEventsError(e) => e.backend_error(), + Error::TransactionFinalizedSuccessError(e) => e.backend_error(), + Error::StorageError(e) => e.backend_error(), + // Any errors that **don't** return a BackendError anywhere will return None: + _ => None, + } } } -impl Error { +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum BackendError { + #[error("Backend error: RPC error: {0}")] + Rpc(#[from] RpcError), + #[error("Backend error: Could not find metadata version {0}")] + MetadataVersionNotFound(u32), + #[error("Backend error: Could not codec::Decode Runtime API response: {0}")] + CouldNotScaleDecodeRuntimeResponse(codec::Error), + #[error("Backend error: Could not codec::Decode metadata bytes into subxt::Metadata: {0}")] + CouldNotDecodeMetadata(codec::Error), + // This is for errors in `Backend` implementations which aren't any of the "pre-defined" set above: + #[error("Custom backend error: {0}")] + Other(String), +} + +impl BackendError { /// Checks whether the error was caused by a RPC re-connection. pub fn is_disconnected_will_reconnect(&self) -> bool { matches!( self, - Error::Rpc(RpcError::ClientError( + BackendError::Rpc(RpcError::ClientError( subxt_rpcs::Error::DisconnectedWillReconnect(_) )) ) @@ -139,7 +201,13 @@ impl Error { /// Checks whether the error was caused by a RPC request being rejected. pub fn is_rpc_limit_reached(&self) -> bool { - matches!(self, Error::Rpc(RpcError::LimitReached)) + matches!(self, BackendError::Rpc(RpcError::LimitReached)) + } +} + +impl From for BackendError { + fn from(value: subxt_rpcs::Error) -> Self { + BackendError::Rpc(RpcError::ClientError(value)) } } @@ -148,8 +216,6 @@ impl Error { #[derive(Debug, thiserror::Error)] #[non_exhaustive] pub enum RpcError { - // Dev note: We need the error to be safely sent between threads - // for `subscribe_to_block_headers_filling_in_gaps` and friends. /// Error related to the RPC client. #[error("RPC error: {0}")] ClientError(#[from] subxt_rpcs::Error), @@ -157,77 +223,318 @@ pub enum RpcError { /// which is not technically an RPC error but is treated as an error in our own APIs. #[error("RPC error: limit reached")] LimitReached, - /// The RPC subscription dropped. + /// The RPC subscription was dropped. #[error("RPC error: subscription dropped.")] SubscriptionDropped, } /// Block error -#[derive(Clone, Debug, thiserror::Error)] +#[derive(Debug, thiserror::Error)] #[non_exhaustive] +#[allow(missing_docs)] pub enum BlockError { - /// An error containing the hash of the block that was not found. - #[error("Could not find a block with hash {0} (perhaps it was on a non-finalized fork?)")] - NotFound(String), - /// Leftover bytes found after decoding the extrinsic. #[error( - "After decoding the exntrinsic at index {extrinsic_index}, {num_leftover_bytes} bytes were left, suggesting that decoding may have failed" + "Could not find the block body with hash {block_hash} (perhaps it was on a non-finalized fork?)" )] - LeftoverBytes { - /// Index of the extrinsic that failed to decode. - extrinsic_index: usize, - /// Number of bytes leftover after decoding the extrinsic. - num_leftover_bytes: usize, + BlockNotFound { block_hash: Hex }, + #[error("Could not download the block header with hash {block_hash}: {reason}")] + CouldNotGetBlockHeader { + block_hash: Hex, + reason: BackendError, }, - /// Decoding error. - #[error("Cannot decode extrinsic at index {extrinsic_index}: {error}")] - ExtrinsicDecodeError { - /// Index of the extrinsic that failed to decode. - extrinsic_index: usize, - /// The decode error. - error: subxt_core::error::ExtrinsicDecodeError, + #[error("Could not download the latest block header: {0}")] + CouldNotGetLatestBlock(BackendError), + #[error("Could not subscribe to all blocks: {0}")] + CouldNotSubscribeToAllBlocks(BackendError), + #[error("Could not subscribe to best blocks: {0}")] + CouldNotSubscribeToBestBlocks(BackendError), + #[error("Could not subscribe to finalized blocks: {0}")] + CouldNotSubscribeToFinalizedBlocks(BackendError), + #[error("Error getting account nonce at block {block_hash}")] + AccountNonceError { + block_hash: Hex, + account_id: Hex, + reason: AccountNonceError, }, } -impl From for BlockError { - fn from(value: CoreBlockError) -> Self { - match value { - CoreBlockError::LeftoverBytes { - extrinsic_index, - num_leftover_bytes, - } => BlockError::LeftoverBytes { - extrinsic_index, - num_leftover_bytes, - }, - CoreBlockError::ExtrinsicDecodeError { - extrinsic_index, - error, - } => BlockError::ExtrinsicDecodeError { - extrinsic_index, - error, - }, +impl BlockError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + BlockError::CouldNotGetBlockHeader { reason: e, .. } + | BlockError::CouldNotGetLatestBlock(e) + | BlockError::CouldNotSubscribeToAllBlocks(e) + | BlockError::CouldNotSubscribeToBestBlocks(e) + | BlockError::CouldNotSubscribeToFinalizedBlocks(e) => Some(e), + _ => None, } } } -impl BlockError { - /// Produce an error that a block with the given hash cannot be found. - pub fn not_found(hash: impl AsRef<[u8]>) -> BlockError { - let hash = format!("0x{}", hex::encode(hash)); - BlockError::NotFound(hash) +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum AccountNonceError { + #[error("Could not retrieve account nonce: {0}")] + CouldNotRetrieve(#[from] BackendError), + #[error("Could not decode account nonce: {0}")] + CouldNotDecode(#[from] codec::Error), + #[error("Wrong number of account nonce bytes returned: {0} (expected 2, 4 or 8)")] + WrongNumberOfBytes(usize), +} + +impl AccountNonceError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + AccountNonceError::CouldNotRetrieve(e) => Some(e), + _ => None, + } } } -/// Transaction error. -#[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum OnlineClientError { + #[error("Cannot construct OnlineClient: {0}")] + RpcError(#[from] subxt_rpcs::Error), + #[error( + "Cannot construct OnlineClient: Cannot fetch latest finalized block to obtain init details from: {0}" + )] + CannotGetLatestFinalizedBlock(BackendError), + #[error("Cannot construct OnlineClient: Cannot fetch genesis hash: {0}")] + CannotGetGenesisHash(BackendError), + #[error("Cannot construct OnlineClient: Cannot fetch current runtime version: {0}")] + CannotGetCurrentRuntimeVersion(BackendError), + #[error("Cannot construct OnlineClient: Cannot fetch metadata: {0}")] + CannotFetchMetadata(BackendError), +} + +impl OnlineClientError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + OnlineClientError::CannotGetLatestFinalizedBlock(e) + | OnlineClientError::CannotGetGenesisHash(e) + | OnlineClientError::CannotGetCurrentRuntimeVersion(e) + | OnlineClientError::CannotFetchMetadata(e) => Some(e), + _ => None, + } + } +} + +#[derive(Debug, thiserror::Error)] #[non_exhaustive] -pub enum TransactionError { - /// The block hash that the transaction was added to could not be found. - /// This is probably because the block was retracted before being finalized. +#[allow(missing_docs)] +pub enum RuntimeUpdaterError { + #[error("Error subscribing to runtime updates: The update stream ended unexpectedly")] + UnexpectedEndOfUpdateStream, + #[error("Error subscribing to runtime updates: The finalized block stream ended unexpectedly")] + UnexpectedEndOfBlockStream, + #[error("Error subscribing to runtime updates: Can't stream runtime version: {0}")] + CannotStreamRuntimeVersion(BackendError), + #[error("Error subscribing to runtime updates: Can't get next runtime version in stream: {0}")] + CannotGetNextRuntimeVersion(BackendError), + #[error("Error subscribing to runtime updates: Cannot stream finalized blocks: {0}")] + CannotStreamFinalizedBlocks(BackendError), + #[error("Error subscribing to runtime updates: Cannot get next finalized block in stream: {0}")] + CannotGetNextFinalizedBlock(BackendError), + #[error("Cannot fetch new metadata for runtime update: {0}")] + CannotFetchNewMetadata(BackendError), #[error( - "The block containing the transaction can no longer be found (perhaps it was on a non-finalized fork?)" + "Error subscribing to runtime updates: Cannot find the System.LastRuntimeUpgrade storage entry" )] - BlockNotFound, + CantFindSystemLastRuntimeUpgrade, + #[error("Error subscribing to runtime updates: Cannot fetch last runtime upgrade: {0}")] + CantFetchLastRuntimeUpgrade(StorageError), + #[error("Error subscribing to runtime updates: Cannot decode last runtime upgrade: {0}")] + CannotDecodeLastRuntimeUpgrade(StorageValueError), +} + +impl RuntimeUpdaterError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + RuntimeUpdaterError::CannotStreamRuntimeVersion(e) + | RuntimeUpdaterError::CannotGetNextRuntimeVersion(e) + | RuntimeUpdaterError::CannotStreamFinalizedBlocks(e) + | RuntimeUpdaterError::CannotGetNextFinalizedBlock(e) + | RuntimeUpdaterError::CannotFetchNewMetadata(e) => Some(e), + _ => None, + } + } +} + +/// Error that can occur during upgrade. +#[non_exhaustive] +#[derive(Debug, thiserror::Error)] +#[allow(missing_docs)] +pub enum RuntimeUpdateeApplyError { + #[error("The proposed runtime update is the same as the current version")] + SameVersion, +} + +/// Error working with Runtime APIs +#[non_exhaustive] +#[derive(Debug, thiserror::Error)] +#[allow(missing_docs)] +pub enum RuntimeApiError { + #[error("Cannot access Runtime APIs at latest block: Cannot fetch latest finalized block: {0}")] + CannotGetLatestFinalizedBlock(BackendError), + #[error("{0}")] + OfflineError(#[from] CoreRuntimeApiError), + #[error("Cannot call the Runtime API: {0}")] + CannotCallApi(BackendError), +} + +impl RuntimeApiError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + RuntimeApiError::CannotGetLatestFinalizedBlock(e) + | RuntimeApiError::CannotCallApi(e) => Some(e), + _ => None, + } + } +} + +/// Error working with events. +#[non_exhaustive] +#[derive(Debug, thiserror::Error)] +#[allow(missing_docs)] +pub enum EventsError { + #[error("{0}")] + OfflineError(#[from] CoreEventsError), + #[error("Cannot access events at latest block: Cannot fetch latest finalized block: {0}")] + CannotGetLatestFinalizedBlock(BackendError), + #[error("Cannot fetch event bytes: {0}")] + CannotFetchEventBytes(BackendError), +} + +impl EventsError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + EventsError::CannotGetLatestFinalizedBlock(e) + | EventsError::CannotFetchEventBytes(e) => Some(e), + _ => None, + } + } +} + +/// Error working with extrinsics. +#[non_exhaustive] +#[derive(Debug, thiserror::Error)] +#[allow(missing_docs)] +pub enum ExtrinsicError { + #[error("{0}")] + OfflineError(#[from] CoreExtrinsicError), + #[error("Could not download block body to extract extrinsics from: {0}")] + CannotGetBlockBody(BackendError), + #[error("Block not found: {0}")] + BlockNotFound(Hex), + #[error("{0}")] + CouldNotDecodeExtrinsics(#[from] ExtrinsicDecodeErrorAt), + #[error( + "Extrinsic submission error: Cannot get latest finalized block to grab account nonce at: {0}" + )] + CannotGetLatestFinalizedBlock(BackendError), + #[error("Cannot find block header for block {block_hash}")] + CannotFindBlockHeader { block_hash: Hex }, + #[error("Error getting account nonce at block {block_hash}")] + AccountNonceError { + block_hash: Hex, + account_id: Hex, + reason: AccountNonceError, + }, + #[error("Cannot submit extrinsic: {0}")] + ErrorSubmittingTransaction(BackendError), + #[error("A transaction status error was returned while submitting the extrinsic: {0}")] + TransactionStatusError(TransactionStatusError), + #[error( + "The transaction status stream encountered an error while submitting the extrinsic: {0}" + )] + TransactionStatusStreamError(BackendError), + #[error( + "The transaction status stream unexpectedly ended, so we don't know the status of the submitted extrinsic" + )] + UnexpectedEndOfTransactionStatusStream, + #[error("Cannot get fee info from Runtime API: {0}")] + CannotGetFeeInfo(BackendError), + #[error("Cannot get validation info from Runtime API: {0}")] + CannotGetValidationInfo(BackendError), + #[error("Cannot decode ValidationResult bytes: {0}")] + CannotDecodeValidationResult(codec::Error), + #[error("ValidationResult bytes could not be decoded")] + UnexpectedValidationResultBytes(Vec), +} + +impl ExtrinsicError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + ExtrinsicError::CannotGetBlockBody(e) + | ExtrinsicError::CannotGetLatestFinalizedBlock(e) + | ExtrinsicError::ErrorSubmittingTransaction(e) + | ExtrinsicError::TransactionStatusStreamError(e) + | ExtrinsicError::CannotGetFeeInfo(e) + | ExtrinsicError::CannotGetValidationInfo(e) => Some(e), + ExtrinsicError::AccountNonceError { reason, .. } => reason.backend_error(), + _ => None, + } + } +} + +/// Error working with View Functions. +#[non_exhaustive] +#[derive(Debug, thiserror::Error)] +#[allow(missing_docs)] +pub enum ViewFunctionError { + #[error("{0}")] + OfflineError(#[from] CoreViewFunctionError), + #[error( + "Cannot access View Functions at latest block: Cannot fetch latest finalized block: {0}" + )] + CannotGetLatestFinalizedBlock(BackendError), + #[error("Cannot call the View Function Runtime API: {0}")] + CannotCallApi(BackendError), +} + +impl ViewFunctionError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + ViewFunctionError::CannotGetLatestFinalizedBlock(e) + | ViewFunctionError::CannotCallApi(e) => Some(e), + _ => None, + } + } +} + +/// Error during the transaction progress. +#[non_exhaustive] +#[derive(Debug, thiserror::Error)] +#[allow(missing_docs)] +pub enum TransactionProgressError { + #[error("Cannot get the next transaction progress update: {0}")] + CannotGetNextProgressUpdate(BackendError), + #[error("Error during transaction progress: {0}")] + TransactionStatusError(#[from] TransactionStatusError), + #[error( + "The transaction status stream unexpectedly ended, so we have no further transaction progress updates" + )] + UnexpectedEndOfTransactionStatusStream, +} + +impl TransactionProgressError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + TransactionProgressError::CannotGetNextProgressUpdate(e) => Some(e), + TransactionProgressError::TransactionStatusError(_) => None, + TransactionProgressError::UnexpectedEndOfTransactionStatusStream => None, + } + } +} + +/// An error emitted as the result of a transaction progress update. +#[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum TransactionStatusError { /// An error happened on the node that the transaction was submitted to. #[error("Error handling transaction: {0}")] Error(String), @@ -238,3 +545,158 @@ pub enum TransactionError { #[error("The transaction was dropped: {0}")] Dropped(String), } + +/// Error fetching events for a just-submitted transaction +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum TransactionEventsError { + #[error( + "The block containing the submitted transaction ({block_hash}) could not be downloaded: {error}" + )] + CannotFetchBlockBody { + block_hash: Hex, + error: BackendError, + }, + #[error( + "Cannot find the the submitted transaction (hash: {transaction_hash}) in the block (hash: {block_hash}) it is supposed to be in." + )] + CannotFindTransactionInBlock { + block_hash: Hex, + transaction_hash: Hex, + }, + #[error("The block containing the submitted transaction ({block_hash}) could not be found")] + BlockNotFound { block_hash: Hex }, + #[error( + "Could not decode event at index {event_index} for the submitted transaction at block {block_hash}: {error}" + )] + CannotDecodeEventInBlock { + event_index: usize, + block_hash: Hex, + error: EventsError, + }, + #[error("Could not fetch events for the submitted transaction: {error}")] + CannotFetchEventsForTransaction { + block_hash: Hex, + transaction_hash: Hex, + error: EventsError, + }, + #[error("The transaction led to a DispatchError, but we failed to decode it: {error}")] + CannotDecodeDispatchError { + error: DispatchErrorDecodeError, + bytes: Vec, + }, + #[error("The transaction failed with the following dispatch error: {0}")] + ExtrinsicFailed(#[from] DispatchError), +} + +impl TransactionEventsError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + TransactionEventsError::CannotFetchBlockBody { error, .. } => Some(error), + TransactionEventsError::CannotDecodeEventInBlock { error, .. } + | TransactionEventsError::CannotFetchEventsForTransaction { error, .. } => { + error.backend_error() + } + _ => None, + } + } +} + +/// Error waiting for the transaction to be finalized and successful. +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs, clippy::large_enum_variant)] +pub enum TransactionFinalizedSuccessError { + #[error("Could not finalize the transaction: {0}")] + FinalizationError(#[from] TransactionProgressError), + #[error("The transaction did not succeed: {0}")] + SuccessError(#[from] TransactionEventsError), +} + +impl TransactionFinalizedSuccessError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + TransactionFinalizedSuccessError::FinalizationError(e) => e.backend_error(), + TransactionFinalizedSuccessError::SuccessError(e) => e.backend_error(), + } + } +} + +/// Error decoding the [`DispatchError`] +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum ModuleErrorDetailsError { + #[error( + "Could not get details for the DispatchError: could not find pallet index {pallet_index}" + )] + PalletNotFound { pallet_index: u8 }, + #[error( + "Could not get details for the DispatchError: could not find error index {error_index} in pallet {pallet_name}" + )] + ErrorVariantNotFound { + pallet_name: String, + error_index: u8, + }, +} + +/// Error decoding the [`ModuleError`] +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +#[error("Could not decode the DispatchError::Module payload into the given type: {0}")] +pub struct ModuleErrorDecodeError(scale_decode::Error); + +/// Error decoding the [`DispatchError`] +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum DispatchErrorDecodeError { + #[error( + "Could not decode the DispatchError: could not find the corresponding type ID in the metadata" + )] + DispatchErrorTypeIdNotFound, + #[error("Could not decode the DispatchError: {0}")] + CouldNotDecodeDispatchError(scale_decode::Error), + #[error("Could not decode the DispatchError::Module variant")] + CouldNotDecodeModuleError { + /// The bytes corresponding to the Module variant we were unable to decode: + bytes: Vec, + }, +} + +/// Error working with storage. +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +#[allow(missing_docs)] +pub enum StorageError { + #[error("{0}")] + Offline(#[from] CoreStorageError), + #[error("Cannot access storage at latest block: Cannot fetch latest finalized block: {0}")] + CannotGetLatestFinalizedBlock(BackendError), + #[error( + "No storage value found at the given address, and no default value to fall back to using." + )] + NoValueFound, + #[error("Cannot fetch the storage value: {0}")] + CannotFetchValue(BackendError), + #[error("Cannot iterate storage values: {0}")] + CannotIterateValues(BackendError), + #[error("Encountered an error iterating over storage values: {0}")] + StreamFailure(BackendError), + #[error("Cannot decode the storage version for a given entry: {0}")] + CannotDecodeStorageVersion(codec::Error), +} + +impl StorageError { + fn backend_error(&self) -> Option<&BackendError> { + match self { + StorageError::CannotGetLatestFinalizedBlock(e) + | StorageError::CannotFetchValue(e) + | StorageError::CannotIterateValues(e) + | StorageError::StreamFailure(e) => Some(e), + _ => None, + } + } +} diff --git a/subxt/src/events/events_client.rs b/subxt/src/events/events_client.rs index 354e93840a0..dc0ee1924c1 100644 --- a/subxt/src/events/events_client.rs +++ b/subxt/src/events/events_client.rs @@ -6,7 +6,7 @@ use crate::backend::{Backend, BackendExt, BlockRef}; use crate::{ client::OnlineClientT, config::{Config, HashFor}, - error::Error, + error::EventsError, events::Events, }; use derive_where::derive_where; @@ -44,12 +44,14 @@ where pub fn at( &self, block_ref: impl Into>>, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, EventsError>> + Send + 'static { self.at_or_latest(Some(block_ref.into())) } /// Obtain events for the latest finalized block. - pub fn at_latest(&self) -> impl Future, Error>> + Send + 'static { + pub fn at_latest( + &self, + ) -> impl Future, EventsError>> + Send + 'static { self.at_or_latest(None) } @@ -57,7 +59,7 @@ where fn at_or_latest( &self, block_ref: Option>>, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, EventsError>> + Send + 'static { // Clone and pass the client in like this so that we can explicitly // return a Future that's Send + 'static, rather than tied to &self. let client = self.client.clone(); @@ -65,7 +67,11 @@ where // If a block ref isn't provided, we'll get the latest finalized block to use. let block_ref = match block_ref { Some(r) => r, - None => client.backend().latest_finalized_block_ref().await?, + None => client + .backend() + .latest_finalized_block_ref() + .await + .map_err(EventsError::CannotGetLatestFinalizedBlock)?, }; let event_bytes = get_event_bytes(client.backend(), block_ref.hash()).await?; @@ -88,9 +94,11 @@ fn system_events_key() -> [u8; 32] { pub(crate) async fn get_event_bytes( backend: &dyn Backend, block_hash: HashFor, -) -> Result, Error> { - Ok(backend +) -> Result, EventsError> { + let bytes = backend .storage_fetch_value(system_events_key().to_vec(), block_hash) - .await? - .unwrap_or_default()) + .await + .map_err(EventsError::CannotFetchEventBytes)? + .unwrap_or_default(); + Ok(bytes) } diff --git a/subxt/src/events/events_type.rs b/subxt/src/events/events_type.rs index b3bc52c094a..04b706656e6 100644 --- a/subxt/src/events/events_type.rs +++ b/subxt/src/events/events_type.rs @@ -1,9 +1,10 @@ use crate::{ - Error, Metadata, + Metadata, config::{Config, HashFor}, + error::EventsError, }; use derive_where::derive_where; -use scale_decode::DecodeAsType; +use scale_decode::{DecodeAsFields, DecodeAsType}; use subxt_core::events::{EventDetails as CoreEventDetails, Events as CoreEvents}; pub use subxt_core::events::{EventMetadataDetails, Phase, StaticEvent}; @@ -49,7 +50,7 @@ impl Events { // use of it with our `FilterEvents` stuff. pub fn iter( &self, - ) -> impl Iterator, Error>> + Send + Sync + 'static { + ) -> impl Iterator, EventsError>> + Send + Sync + 'static { self.inner .iter() .map(|item| item.map(|e| EventDetails { inner: e }).map_err(Into::into)) @@ -58,24 +59,24 @@ impl Events { /// Iterate through the events using metadata to dynamically decode and skip /// them, and return only those which should decode to the provided `Ev` type. /// If an error occurs, all subsequent iterations return `None`. - pub fn find(&self) -> impl Iterator> { + pub fn find(&self) -> impl Iterator> { self.inner.find::().map(|item| item.map_err(Into::into)) } /// Iterate through the events using metadata to dynamically decode and skip /// them, and return the first event found which decodes to the provided `Ev` type. - pub fn find_first(&self) -> Result, Error> { + pub fn find_first(&self) -> Result, EventsError> { self.inner.find_first::().map_err(Into::into) } /// Iterate through the events using metadata to dynamically decode and skip /// them, and return the last event found which decodes to the provided `Ev` type. - pub fn find_last(&self) -> Result, Error> { + pub fn find_last(&self) -> Result, EventsError> { self.inner.find_last::().map_err(Into::into) } /// Find an event that decodes to the type provided. Returns true if it was found. - pub fn has(&self) -> Result { + pub fn has(&self) -> Result { self.inner.has::().map_err(Into::into) } } @@ -138,20 +139,20 @@ impl EventDetails { /// Decode and provide the event fields back in the form of a [`scale_value::Composite`] /// type which represents the named or unnamed fields that were present in the event. - pub fn field_values(&self) -> Result, Error> { - self.inner.field_values().map_err(Into::into) + pub fn decode_as_fields(&self) -> Result { + self.inner.decode_as_fields().map_err(Into::into) } /// Attempt to decode these [`EventDetails`] into a type representing the event fields. /// Such types are exposed in the codegen as `pallet_name::events::EventName` types. - pub fn as_event(&self) -> Result, Error> { + pub fn as_event(&self) -> Result, EventsError> { self.inner.as_event::().map_err(Into::into) } /// Attempt to decode these [`EventDetails`] into a root event type (which includes /// the pallet and event enum variants as well as the event fields). A compatible /// type for this is exposed via static codegen as a root level `Event` type. - pub fn as_root_event(&self) -> Result { + pub fn as_root_event(&self) -> Result { self.inner.as_root_event::().map_err(Into::into) } diff --git a/subxt/src/events/mod.rs b/subxt/src/events/mod.rs index e9a807ee126..185cafa2508 100644 --- a/subxt/src/events/mod.rs +++ b/subxt/src/events/mod.rs @@ -9,8 +9,8 @@ mod events_client; mod events_type; -use crate::Error; use crate::client::OnlineClientT; +use crate::error::EventsError; use subxt_core::{ Metadata, config::{Config, HashFor}, @@ -24,7 +24,7 @@ pub async fn new_events_from_client( metadata: Metadata, block_hash: HashFor, client: C, -) -> Result, Error> +) -> Result, EventsError> where T: Config, C: OnlineClientT, diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index b6b872952bc..dfcb6aa8827 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -68,17 +68,12 @@ pub mod config { /// Types representing the metadata obtained from a node. pub mod metadata { - pub use subxt_core::metadata::{DecodeWithMetadata, EncodeWithMetadata, Metadata}; - // Expose metadata types under a sub module in case somebody needs to reference them: - pub use subxt_metadata as types; + pub use subxt_metadata::*; } /// Submit dynamic transactions. pub mod dynamic { - pub use subxt_core::dynamic::{ - At, DecodedValue, DecodedValueThunk, Value, constant, runtime_api_call, storage, tx, - view_function_call, - }; + pub use subxt_core::dynamic::*; } // Expose light client bits diff --git a/subxt/src/runtime_api/mod.rs b/subxt/src/runtime_api/mod.rs index 3c58c5b2352..f6dafb31cba 100644 --- a/subxt/src/runtime_api/mod.rs +++ b/subxt/src/runtime_api/mod.rs @@ -9,6 +9,4 @@ mod runtime_types; pub use runtime_client::RuntimeApiClient; pub use runtime_types::RuntimeApi; -pub use subxt_core::runtime_api::payload::{ - DefaultPayload, DynamicPayload, Payload, StaticPayload, dynamic, -}; +pub use subxt_core::runtime_api::payload::{DynamicPayload, Payload, StaticPayload, dynamic}; diff --git a/subxt/src/runtime_api/runtime_client.rs b/subxt/src/runtime_api/runtime_client.rs index 9597b031a1b..6412468be76 100644 --- a/subxt/src/runtime_api/runtime_client.rs +++ b/subxt/src/runtime_api/runtime_client.rs @@ -8,7 +8,7 @@ use crate::{ backend::BlockRef, client::OnlineClientT, config::{Config, HashFor}, - error::Error, + error::RuntimeApiError, }; use derive_where::derive_where; use std::{future::Future, marker::PhantomData}; @@ -43,13 +43,17 @@ where /// Obtain a runtime API interface at the latest finalized block. pub fn at_latest( &self, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, RuntimeApiError>> + Send + 'static { // Clone and pass the client in like this so that we can explicitly // return a Future that's Send + 'static, rather than tied to &self. let client = self.client.clone(); async move { // get the ref for the latest finalized block and use that. - let block_ref = client.backend().latest_finalized_block_ref().await?; + let block_ref = client + .backend() + .latest_finalized_block_ref() + .await + .map_err(RuntimeApiError::CannotGetLatestFinalizedBlock)?; Ok(RuntimeApi::new(client, block_ref)) } diff --git a/subxt/src/runtime_api/runtime_types.rs b/subxt/src/runtime_api/runtime_types.rs index 86254b359d2..6b0ee009358 100644 --- a/subxt/src/runtime_api/runtime_types.rs +++ b/subxt/src/runtime_api/runtime_types.rs @@ -7,7 +7,7 @@ use crate::{ backend::BlockRef, client::OnlineClientT, config::{Config, HashFor}, - error::Error, + error::RuntimeApiError, }; use derive_where::derive_where; use std::{future::Future, marker::PhantomData}; @@ -40,7 +40,7 @@ where /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). /// Return an error if the payload was not valid or something went wrong trying to validate it (ie /// the runtime API in question do not exist at all) - pub fn validate(&self, payload: &Call) -> Result<(), Error> { + pub fn validate(&self, payload: Call) -> Result<(), RuntimeApiError> { subxt_core::runtime_api::validate(payload, &self.client.metadata()).map_err(Into::into) } @@ -50,7 +50,7 @@ where &self, function: &'a str, call_parameters: Option<&'a [u8]>, - ) -> impl Future, Error>> + use<'a, Client, T> { + ) -> impl Future, RuntimeApiError>> + use<'a, Client, T> { let client = self.client.clone(); let block_hash = self.block_ref.hash(); // Ensure that the returned future doesn't have a lifetime tied to api.runtime_api(), @@ -59,7 +59,8 @@ where let data = client .backend() .call(function, call_parameters, block_hash) - .await?; + .await + .map_err(RuntimeApiError::CannotCallApi)?; Ok(data) } } @@ -68,7 +69,8 @@ where pub fn call( &self, payload: Call, - ) -> impl Future> + use { + ) -> impl Future> + use + { let client = self.client.clone(); let block_hash = self.block_ref.hash(); // Ensure that the returned future doesn't have a lifetime tied to api.runtime_api(), @@ -87,7 +89,8 @@ where let bytes = client .backend() .call(&call_name, Some(call_args.as_slice()), block_hash) - .await?; + .await + .map_err(RuntimeApiError::CannotCallApi)?; // Decode the response. let value = subxt_core::runtime_api::decode_value(&mut &*bytes, &payload, &metadata)?; diff --git a/subxt/src/storage/mod.rs b/subxt/src/storage/mod.rs index e7867c8b1c1..c62718d7099 100644 --- a/subxt/src/storage/mod.rs +++ b/subxt/src/storage/mod.rs @@ -5,10 +5,8 @@ //! Types associated with accessing and working with storage items. mod storage_client; -mod storage_type; +mod storage_client_at; pub use storage_client::StorageClient; -pub use storage_type::{Storage, StorageKeyValuePair}; -pub use subxt_core::storage::address::{ - Address, DefaultAddress, DynamicAddress, StaticAddress, StaticStorageKey, StorageKey, dynamic, -}; +pub use storage_client_at::{StorageClientAt, StorageEntryClient, StorageKeyValue, StorageValue}; +pub use subxt_core::storage::address::{Address, DynamicAddress, StaticAddress, dynamic}; diff --git a/subxt/src/storage/storage_client.rs b/subxt/src/storage/storage_client.rs index c02a4ba1577..ca6fcffa57a 100644 --- a/subxt/src/storage/storage_client.rs +++ b/subxt/src/storage/storage_client.rs @@ -2,12 +2,12 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use super::storage_type::Storage; +use super::storage_client_at::StorageClientAt; use crate::{ backend::BlockRef, client::{OfflineClientT, OnlineClientT}, config::{Config, HashFor}, - error::Error, + error::StorageError, }; use derive_where::derive_where; use std::{future::Future, marker::PhantomData}; @@ -39,24 +39,9 @@ where /// if the address is valid (or if it's not possible to check since the address has no validation hash). /// Return an error if the address was not valid or something went wrong trying to validate it (ie /// the pallet or storage entry in question do not exist at all). - pub fn validate(&self, address: &Addr) -> Result<(), Error> { + pub fn validate(&self, address: &Addr) -> Result<(), StorageError> { subxt_core::storage::validate(address, &self.client.metadata()).map_err(Into::into) } - - /// Convert some storage address into the raw bytes that would be submitted to the node in order - /// to retrieve the entries at the root of the associated address. - pub fn address_root_bytes(&self, address: &Addr) -> Vec { - subxt_core::storage::get_address_root_bytes(address) - } - - /// Convert some storage address into the raw bytes that would be submitted to the node in order - /// to retrieve an entry. This fails if [`Address::append_entry_bytes`] does; in the built-in - /// implementation this would be if the pallet and storage entry being asked for is not available on the - /// node you're communicating with, or if the metadata is missing some type information (which should not - /// happen). - pub fn address_bytes(&self, address: &Addr) -> Result, Error> { - subxt_core::storage::get_address_bytes(address, &self.client.metadata()).map_err(Into::into) - } } impl StorageClient @@ -65,22 +50,27 @@ where Client: OnlineClientT, { /// Obtain storage at some block hash. - pub fn at(&self, block_ref: impl Into>>) -> Storage { - Storage::new(self.client.clone(), block_ref.into()) + pub fn at(&self, block_ref: impl Into>>) -> StorageClientAt { + StorageClientAt::new(self.client.clone(), block_ref.into()) } /// Obtain storage at the latest finalized block. pub fn at_latest( &self, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, StorageError>> + Send + 'static + { // Clone and pass the client in like this so that we can explicitly // return a Future that's Send + 'static, rather than tied to &self. let client = self.client.clone(); async move { // get the ref for the latest finalized block and use that. - let block_ref = client.backend().latest_finalized_block_ref().await?; + let block_ref = client + .backend() + .latest_finalized_block_ref() + .await + .map_err(StorageError::CannotGetLatestFinalizedBlock)?; - Ok(Storage::new(client, block_ref)) + Ok(StorageClientAt::new(client, block_ref)) } } } diff --git a/subxt/src/storage/storage_client_at.rs b/subxt/src/storage/storage_client_at.rs new file mode 100644 index 00000000000..605c8e38d55 --- /dev/null +++ b/subxt/src/storage/storage_client_at.rs @@ -0,0 +1,383 @@ +// Copyright 2019-2025 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use crate::{ + backend::{BackendExt, BlockRef}, + client::{OfflineClientT, OnlineClientT}, + config::{Config, HashFor}, + error::StorageError, +}; +use derive_where::derive_where; +use futures::StreamExt; +use std::marker::PhantomData; +use subxt_core::Metadata; +use subxt_core::storage::{PrefixOf, address::Address}; +use subxt_core::utils::{Maybe, Yes}; + +pub use subxt_core::storage::{StorageKeyValue, StorageValue}; + +/// Query the runtime storage. +#[derive_where(Clone; Client)] +pub struct StorageClientAt { + client: Client, + metadata: Metadata, + block_ref: BlockRef>, + _marker: PhantomData, +} + +impl StorageClientAt +where + T: Config, + Client: OfflineClientT, +{ + /// Create a new [`StorageClientAt`]. + pub(crate) fn new(client: Client, block_ref: BlockRef>) -> Self { + // Retrieve and store metadata here so that we can borrow it in + // subsequent structs, and thus also borrow storage info and + // things that borrow from metadata. + let metadata = client.metadata(); + + Self { + client, + metadata, + block_ref, + _marker: PhantomData, + } + } +} + +impl StorageClientAt +where + T: Config, + Client: OfflineClientT, +{ + /// This returns a [`StorageEntryClient`], which allows working with the storage entry at the provided address. + pub fn entry( + &self, + address: Addr, + ) -> Result, StorageError> { + let inner = subxt_core::storage::entry(address, &self.metadata)?; + Ok(StorageEntryClient { + inner, + client: self.client.clone(), + block_ref: self.block_ref.clone(), + _marker: core::marker::PhantomData, + }) + } +} + +impl StorageClientAt +where + T: Config, + Client: OnlineClientT, +{ + /// This is essentially a shorthand for `client.entry(addr)?.fetch(key_parts)`. See [`StorageEntryClient::fetch()`]. + pub async fn fetch( + &self, + addr: Addr, + key_parts: Addr::KeyParts, + ) -> Result, StorageError> { + let entry = subxt_core::storage::entry(addr, &self.metadata)?; + fetch(&entry, &self.client, self.block_ref.hash(), key_parts).await + } + + /// This is essentially a shorthand for `client.entry(addr)?.try_fetch(key_parts)`. See [`StorageEntryClient::try_fetch()`]. + pub async fn try_fetch( + &self, + addr: Addr, + key_parts: Addr::KeyParts, + ) -> Result>, StorageError> { + let entry = subxt_core::storage::entry(addr, &self.metadata)?; + try_fetch(&entry, &self.client, self.block_ref.hash(), key_parts).await + } + + /// This is essentially a shorthand for `client.entry(addr)?.iter(key_parts)`. See [`StorageEntryClient::iter()`]. + pub async fn iter>( + &'_ self, + addr: Addr, + key_parts: KeyParts, + ) -> Result< + impl futures::Stream, StorageError>> + + use<'_, Addr, Client, T, KeyParts>, + StorageError, + > { + let entry = subxt_core::storage::entry(addr, &self.metadata)?; + iter(entry, &self.client, self.block_ref.hash(), key_parts).await + } + + /// In rare cases, you may wish to fetch a storage value that does not live at a typical address. This method + /// is a fallback for those cases, and allows you to provide the raw storage key bytes corresponding to the + /// entry you wish to obtain. The response will either be the bytes for the value found at that location, or + /// otherwise an error. [`StorageError::NoValueFound`] will be returned in the event that the request was valid + /// but no value lives at the given location). + pub async fn fetch_raw(&self, key_bytes: Vec) -> Result, StorageError> { + let block_hash = self.block_ref.hash(); + let value = self + .client + .backend() + .storage_fetch_value(key_bytes, block_hash) + .await + .map_err(StorageError::CannotFetchValue)? + .ok_or(StorageError::NoValueFound)?; + + Ok(value) + } + + /// The storage version of a pallet. + /// The storage version refers to the `frame_support::traits::Metadata::StorageVersion` type. + pub async fn storage_version(&self, pallet_name: impl AsRef) -> Result { + // construct the storage key. This is done similarly in + // `frame_support::traits::metadata::StorageVersion::storage_key()`: + let mut key_bytes: Vec = vec![]; + key_bytes.extend(&sp_crypto_hashing::twox_128( + pallet_name.as_ref().as_bytes(), + )); + key_bytes.extend(&sp_crypto_hashing::twox_128(b":__STORAGE_VERSION__:")); + + // fetch the raw bytes and decode them into the StorageVersion struct: + let storage_version_bytes = self.fetch_raw(key_bytes).await?; + + ::decode(&mut &storage_version_bytes[..]) + .map_err(StorageError::CannotDecodeStorageVersion) + } + + /// Fetch the runtime WASM code. + pub async fn runtime_wasm_code(&self) -> Result, StorageError> { + // note: this should match the `CODE` constant in `sp_core::storage::well_known_keys` + self.fetch_raw(b":code".to_vec()).await + } +} + +/// This represents a single storage entry (be it a plain value or map) +/// and the operations that can be performed on it. +pub struct StorageEntryClient<'atblock, T: Config, Client, Addr, IsPlain> { + inner: subxt_core::storage::StorageEntry<'atblock, Addr>, + client: Client, + block_ref: BlockRef>, + _marker: PhantomData<(T, IsPlain)>, +} + +impl<'atblock, T, Client, Addr, IsPlain> StorageEntryClient<'atblock, T, Client, Addr, IsPlain> +where + T: Config, + Addr: Address, +{ + /// Name of the pallet containing this storage entry. + pub fn pallet_name(&self) -> &str { + self.inner.pallet_name() + } + + /// Name of the storage entry. + pub fn entry_name(&self) -> &str { + self.inner.entry_name() + } + + /// Is the storage entry a plain value? + pub fn is_plain(&self) -> bool { + self.inner.is_plain() + } + + /// Is the storage entry a map? + pub fn is_map(&self) -> bool { + self.inner.is_map() + } + + /// Return the default value for this storage entry, if there is one. Returns `None` if there + /// is no default value. + pub fn default_value(&self) -> Option> { + self.inner.default_value() + } +} + +// Plain values get a fetch method with no extra arguments. +impl<'atblock, T, Client, Addr> StorageEntryClient<'atblock, T, Client, Addr, Yes> +where + T: Config, + Addr: Address, + Client: OnlineClientT, +{ + /// Fetch the storage value at this location. If no value is found, the default value will be returned + /// for this entry if one exists. If no value is found and no default value exists, an error will be returned. + pub async fn fetch(&self) -> Result, StorageError> { + let value = self.try_fetch().await?.map_or_else( + || self.inner.default_value().ok_or(StorageError::NoValueFound), + Ok, + )?; + + Ok(value) + } + + /// Fetch the storage value at this location. If no value is found, `None` will be returned. + pub async fn try_fetch( + &self, + ) -> Result>, StorageError> { + let value = self + .client + .backend() + .storage_fetch_value(self.key_prefix().to_vec(), self.block_ref.hash()) + .await + .map_err(StorageError::CannotFetchValue)? + .map(|bytes| self.inner.value(bytes)); + + Ok(value) + } + + /// This is identical to [`StorageEntryClient::key_prefix()`] and is the full + /// key for this storage entry. + pub fn key(&self) -> [u8; 32] { + self.inner.key_prefix() + } + + /// The keys for plain storage values are always 32 byte hashes. + pub fn key_prefix(&self) -> [u8; 32] { + self.inner.key_prefix() + } +} + +// When HasDefaultValue = Yes, we expect there to exist a valid default value and will use that +// if we fetch an entry and get nothing back. +impl<'atblock, T, Client, Addr> StorageEntryClient<'atblock, T, Client, Addr, Maybe> +where + T: Config, + Addr: Address, + Client: OnlineClientT, +{ + /// Fetch a storage value within this storage entry. + /// + /// This entry may be a map, and so you must provide the relevant values for each part of the storage + /// key that is required in order to point to a single value. + /// + /// If no value is found, the default value will be returned for this entry if one exists. If no value is + /// found and no default value exists, an error will be returned. + pub async fn fetch( + &self, + key_parts: Addr::KeyParts, + ) -> Result, StorageError> { + fetch(&self.inner, &self.client, self.block_ref.hash(), key_parts).await + } + + /// Fetch a storage value within this storage entry. + /// + /// This entry may be a map, and so you must provide the relevant values for each part of the storage + /// key that is required in order to point to a single value. + /// + /// If no value is found, `None` will be returned. + pub async fn try_fetch( + &self, + key_parts: Addr::KeyParts, + ) -> Result>, StorageError> { + try_fetch(&self.inner, &self.client, self.block_ref.hash(), key_parts).await + } + + /// Iterate over storage values within this storage entry. + /// + /// You may provide any prefix of the values needed to point to a single value. Normally you will + /// provide `()` to iterate over _everything_, or `(first_key,)` to iterate over everything underneath + /// `first_key` in the map, or `(first_key, second_key)` to iterate over everything underneath `first_key` + /// and `second_key` in the map, and so on, up to the actual depth of the map - 1. + pub async fn iter>( + &self, + key_parts: KeyParts, + ) -> Result< + impl futures::Stream, StorageError>> + + use<'atblock, Addr, Client, T, KeyParts>, + StorageError, + > { + iter( + self.inner.clone(), + &self.client, + self.block_ref.hash(), + key_parts, + ) + .await + } + + /// This returns a full key to a single value in this storage entry. + pub fn key(&self, key_parts: Addr::KeyParts) -> Result, StorageError> { + let key = self.inner.fetch_key(key_parts)?; + Ok(key) + } + + /// This returns valid keys to iterate over the storage entry at the available levels. + pub fn iter_key>( + &self, + key_parts: KeyParts, + ) -> Result, StorageError> { + let key = self.inner.iter_key(key_parts)?; + Ok(key) + } + + /// The first 32 bytes of the storage entry key, which points to the entry but not necessarily + /// a single storage value (unless the entry is a plain value). + pub fn key_prefix(&self) -> [u8; 32] { + self.inner.key_prefix() + } +} + +async fn fetch<'atblock, T: Config, Client: OnlineClientT, Addr: Address>( + entry: &subxt_core::storage::StorageEntry<'atblock, Addr>, + client: &Client, + block_hash: HashFor, + key_parts: Addr::KeyParts, +) -> Result, StorageError> { + let value = try_fetch(entry, client, block_hash, key_parts) + .await? + .or_else(|| entry.default_value()) + .unwrap(); + + Ok(value) +} + +async fn try_fetch<'atblock, T: Config, Client: OnlineClientT, Addr: Address>( + entry: &subxt_core::storage::StorageEntry<'atblock, Addr>, + client: &Client, + block_hash: HashFor, + key_parts: Addr::KeyParts, +) -> Result>, StorageError> { + let key = entry.fetch_key(key_parts)?; + + let value = client + .backend() + .storage_fetch_value(key, block_hash) + .await + .map_err(StorageError::CannotFetchValue)? + .map(|bytes| entry.value(bytes)) + .or_else(|| entry.default_value()); + + Ok(value) +} + +async fn iter< + 'atblock, + T: Config, + Client: OnlineClientT, + Addr: Address, + KeyParts: PrefixOf, +>( + entry: subxt_core::storage::StorageEntry<'atblock, Addr>, + client: &Client, + block_hash: HashFor, + key_parts: KeyParts, +) -> Result< + impl futures::Stream, StorageError>> + + use<'atblock, Addr, Client, T, KeyParts>, + StorageError, +> { + let key_bytes = entry.iter_key(key_parts)?; + + let stream = client + .backend() + .storage_fetch_descendant_values(key_bytes, block_hash) + .await + .map_err(StorageError::CannotIterateValues)? + .map(move |kv| { + let kv = match kv { + Ok(kv) => kv, + Err(e) => return Err(StorageError::StreamFailure(e)), + }; + Ok(entry.key_value(kv.key, kv.value)) + }); + + Ok(Box::pin(stream)) +} diff --git a/subxt/src/storage/storage_type.rs b/subxt/src/storage/storage_type.rs deleted file mode 100644 index b82539dc839..00000000000 --- a/subxt/src/storage/storage_type.rs +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright 2019-2025 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{ - backend::{BackendExt, BlockRef}, - client::OnlineClientT, - config::{Config, HashFor}, - error::{Error, MetadataError, StorageAddressError}, - metadata::DecodeWithMetadata, -}; -use codec::Decode; -use derive_where::derive_where; -use futures::StreamExt; -use std::{future::Future, marker::PhantomData}; -use subxt_core::storage::address::{Address, StorageHashers, StorageKey}; -use subxt_core::utils::Yes; - -/// This is returned from a couple of storage functions. -pub use crate::backend::StreamOfResults; - -/// Query the runtime storage. -#[derive_where(Clone; Client)] -pub struct Storage { - client: Client, - block_ref: BlockRef>, - _marker: PhantomData, -} - -impl Storage { - /// Create a new [`Storage`] - pub(crate) fn new(client: Client, block_ref: BlockRef>) -> Self { - Self { - client, - block_ref, - _marker: PhantomData, - } - } -} - -impl Storage -where - T: Config, - Client: OnlineClientT, -{ - /// Fetch the raw encoded value at the key given. - pub fn fetch_raw( - &self, - key: impl Into>, - ) -> impl Future>, Error>> + 'static { - let client = self.client.clone(); - let key = key.into(); - // Keep this alive until the call is complete: - let block_ref = self.block_ref.clone(); - // Manual future so lifetime not tied to api.storage(). - async move { - let data = client - .backend() - .storage_fetch_value(key, block_ref.hash()) - .await?; - Ok(data) - } - } - - /// Stream all of the raw keys underneath the key given - pub fn fetch_raw_keys( - &self, - key: impl Into>, - ) -> impl Future>, Error>> + 'static { - let client = self.client.clone(); - let block_hash = self.block_ref.hash(); - let key = key.into(); - // Manual future so lifetime not tied to api.storage(). - async move { - let keys = client - .backend() - .storage_fetch_descendant_keys(key, block_hash) - .await?; - Ok(keys) - } - } - - /// Fetch a decoded value from storage at a given address. - /// - /// # Example - /// - /// ```rust,no_run,standalone_crate - /// use subxt::{ PolkadotConfig, OnlineClient }; - /// - /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] - /// pub mod polkadot {} - /// - /// # #[tokio::main] - /// # async fn main() { - /// let api = OnlineClient::::new().await.unwrap(); - /// - /// // Address to a storage entry we'd like to access. - /// let address = polkadot::storage().xcm_pallet().queries(12345); - /// - /// // Fetch just the keys, returning up to 10 keys. - /// let value = api - /// .storage() - /// .at_latest() - /// .await - /// .unwrap() - /// .fetch(&address) - /// .await - /// .unwrap(); - /// - /// println!("Value: {:?}", value); - /// # } - /// ``` - pub fn fetch<'address, Addr>( - &self, - address: &'address Addr, - ) -> impl Future, Error>> + use<'address, Addr, Client, T> - where - Addr: Address + 'address, - { - let client = self.clone(); - async move { - let metadata = client.client.metadata(); - - // Metadata validation checks whether the static address given - // is likely to actually correspond to a real storage entry or not. - // if not, it means static codegen doesn't line up with runtime - // metadata. - subxt_core::storage::validate(address, &metadata)?; - - // Look up the return type ID to enable DecodeWithMetadata: - let lookup_bytes = subxt_core::storage::get_address_bytes(address, &metadata)?; - if let Some(data) = client.fetch_raw(lookup_bytes).await? { - let val = subxt_core::storage::decode_value(&mut &*data, address, &metadata)?; - Ok(Some(val)) - } else { - Ok(None) - } - } - } - - /// Fetch a StorageKey that has a default value with an optional block hash. - pub fn fetch_or_default<'address, Addr>( - &self, - address: &'address Addr, - ) -> impl Future> + use<'address, Addr, Client, T> - where - Addr: Address + 'address, - { - let client = self.clone(); - async move { - // Metadata validation happens via .fetch(): - if let Some(data) = client.fetch(address).await? { - Ok(data) - } else { - let metadata = client.client.metadata(); - let val = subxt_core::storage::default_value(address, &metadata)?; - Ok(val) - } - } - } - - /// Returns an iterator of key value pairs. - /// - /// ```rust,no_run,standalone_crate - /// use subxt::{ PolkadotConfig, OnlineClient }; - /// - /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")] - /// pub mod polkadot {} - /// - /// # #[tokio::main] - /// # async fn main() { - /// let api = OnlineClient::::new().await.unwrap(); - /// - /// // Address to the root of a storage entry that we'd like to iterate over. - /// let address = polkadot::storage().xcm_pallet().version_notifiers_iter(); - /// - /// // Iterate over keys and values at that address. - /// let mut iter = api - /// .storage() - /// .at_latest() - /// .await - /// .unwrap() - /// .iter(address) - /// .await - /// .unwrap(); - /// - /// while let Some(Ok(kv)) = iter.next().await { - /// println!("Key bytes: 0x{}", hex::encode(&kv.key_bytes)); - /// println!("Value: {}", kv.value); - /// } - /// # } - /// ``` - pub fn iter( - &self, - address: Addr, - ) -> impl Future>, Error>> + 'static - where - Addr: Address + 'static, - Addr::Keys: 'static + Sized, - { - let client = self.client.clone(); - let block_ref = self.block_ref.clone(); - async move { - let metadata = client.metadata(); - let (_pallet, entry) = subxt_core::storage::lookup_storage_entry_details( - address.pallet_name(), - address.entry_name(), - &metadata, - )?; - - // Metadata validation checks whether the static address given - // is likely to actually correspond to a real storage entry or not. - // if not, it means static codegen doesn't line up with runtime - // metadata. - subxt_core::storage::validate(&address, &metadata)?; - - // Look up the return type for flexible decoding. Do this once here to avoid - // potentially doing it every iteration if we used `decode_storage_with_metadata` - // in the iterator. - let entry = entry.entry_type(); - - let return_type_id = entry.value_ty(); - let hashers = StorageHashers::new(entry, metadata.types())?; - - // The address bytes of this entry: - let address_bytes = subxt_core::storage::get_address_bytes(&address, &metadata)?; - let s = client - .backend() - .storage_fetch_descendant_values(address_bytes, block_ref.hash()) - .await? - .map(move |kv| { - let kv = match kv { - Ok(kv) => kv, - Err(e) => return Err(e), - }; - let value = Addr::Target::decode_with_metadata( - &mut &*kv.value, - return_type_id, - &metadata, - )?; - - let key_bytes = kv.key; - let cursor = &mut &key_bytes[..]; - strip_storage_address_root_bytes(cursor)?; - - let keys = ::decode_storage_key( - cursor, - &mut hashers.iter(), - metadata.types(), - )?; - - Ok(StorageKeyValuePair:: { - keys, - key_bytes, - value, - }) - }); - - let s = StreamOfResults::new(Box::pin(s)); - Ok(s) - } - } - - /// The storage version of a pallet. - /// The storage version refers to the `frame_support::traits::Metadata::StorageVersion` type. - pub async fn storage_version(&self, pallet_name: impl AsRef) -> Result { - // check that the pallet exists in the metadata: - self.client - .metadata() - .pallet_by_name(pallet_name.as_ref()) - .ok_or_else(|| MetadataError::PalletNameNotFound(pallet_name.as_ref().into()))?; - - // construct the storage key. This is done similarly in `frame_support::traits::metadata::StorageVersion::storage_key()`. - pub const STORAGE_VERSION_STORAGE_KEY_POSTFIX: &[u8] = b":__STORAGE_VERSION__:"; - let mut key_bytes: Vec = vec![]; - key_bytes.extend(&sp_crypto_hashing::twox_128( - pallet_name.as_ref().as_bytes(), - )); - key_bytes.extend(&sp_crypto_hashing::twox_128( - STORAGE_VERSION_STORAGE_KEY_POSTFIX, - )); - - // fetch the raw bytes and decode them into the StorageVersion struct: - let storage_version_bytes = self.fetch_raw(key_bytes).await?.ok_or_else(|| { - format!( - "Unexpected: entry for storage version in pallet \"{}\" not found", - pallet_name.as_ref() - ) - })?; - u16::decode(&mut &storage_version_bytes[..]).map_err(Into::into) - } - - /// Fetch the runtime WASM code. - pub async fn runtime_wasm_code(&self) -> Result, Error> { - // note: this should match the `CODE` constant in `sp_core::storage::well_known_keys` - const CODE: &str = ":code"; - self.fetch_raw(CODE.as_bytes()).await?.ok_or_else(|| { - format!("Unexpected: entry for well known key \"{CODE}\" not found").into() - }) - } -} - -/// Strips the first 32 bytes (16 for the pallet hash, 16 for the entry hash) off some storage address bytes. -fn strip_storage_address_root_bytes(address_bytes: &mut &[u8]) -> Result<(), StorageAddressError> { - if address_bytes.len() >= 32 { - *address_bytes = &address_bytes[32..]; - Ok(()) - } else { - Err(StorageAddressError::UnexpectedAddressBytes) - } -} - -/// A pair of keys and values together with all the bytes that make up the storage address. -/// `keys` is `None` if non-concat hashers are used. In this case the keys could not be extracted back from the key_bytes. -#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] -pub struct StorageKeyValuePair { - /// The bytes that make up the address of the storage entry. - pub key_bytes: Vec, - /// The keys that can be used to construct the address of this storage entry. - pub keys: T::Keys, - /// The value of the storage entry. - pub value: T::Target, -} diff --git a/subxt/src/tx/tx_client.rs b/subxt/src/tx/tx_client.rs index 6c26c357416..030846a9986 100644 --- a/subxt/src/tx/tx_client.rs +++ b/subxt/src/tx/tx_client.rs @@ -6,13 +6,13 @@ use crate::{ backend::{BackendExt, BlockRef, TransactionStatus}, client::{OfflineClientT, OnlineClientT}, config::{Config, ExtrinsicParams, HashFor, Header}, - error::{BlockError, Error}, + error::{ExtrinsicError, TransactionStatusError}, tx::{Payload, Signer as SignerT, TxProgress}, utils::PhantomDataSendSync, }; use codec::{Compact, Decode, Encode}; use derive_where::derive_where; -use futures::future::try_join; +use futures::future::{TryFutureExt, try_join}; use subxt_core::tx::TransactionVersion; /// A client for working with transactions. @@ -37,7 +37,7 @@ impl> TxClient { /// if the call is valid (or if it's not possible to check since the call has no validation hash). /// Return an error if the call was not valid or something went wrong trying to validate it (ie /// the pallet or call in question do not exist at all). - pub fn validate(&self, call: &Call) -> Result<(), Error> + pub fn validate(&self, call: &Call) -> Result<(), ExtrinsicError> where Call: Payload, { @@ -45,7 +45,7 @@ impl> TxClient { } /// Return the SCALE encoded bytes representing the call data of the transaction. - pub fn call_data(&self, call: &Call) -> Result, Error> + pub fn call_data(&self, call: &Call) -> Result, ExtrinsicError> where Call: Payload, { @@ -55,7 +55,10 @@ impl> TxClient { /// Creates an unsigned transaction without submitting it. Depending on the metadata, we might end /// up constructing either a v4 or v5 transaction. See [`Self::create_v4_unsigned`] or /// [`Self::create_v5_bare`] if you'd like to explicitly create an unsigned transaction of a certain version. - pub fn create_unsigned(&self, call: &Call) -> Result, Error> + pub fn create_unsigned( + &self, + call: &Call, + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -78,7 +81,7 @@ impl> TxClient { pub fn create_v4_unsigned( &self, call: &Call, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -95,7 +98,10 @@ impl> TxClient { /// /// Prefer [`Self::create_unsigned()`] if you don't know which version to create; this will pick the /// most suitable one for the given chain. - pub fn create_v5_bare(&self, call: &Call) -> Result, Error> + pub fn create_v5_bare( + &self, + call: &Call, + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -117,7 +123,7 @@ impl> TxClient { &self, call: &Call, params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -148,7 +154,7 @@ impl> TxClient { &self, call: &Call, params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -175,7 +181,7 @@ impl> TxClient { &self, call: &Call, params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -198,9 +204,21 @@ where C: OnlineClientT, { /// Get the account nonce for a given account ID. - pub async fn account_nonce(&self, account_id: &T::AccountId) -> Result { - let block_ref = self.client.backend().latest_finalized_block_ref().await?; - crate::blocks::get_account_nonce(&self.client, account_id, block_ref.hash()).await + pub async fn account_nonce(&self, account_id: &T::AccountId) -> Result { + let block_ref = self + .client + .backend() + .latest_finalized_block_ref() + .await + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; + + crate::blocks::get_account_nonce(&self.client, account_id, block_ref.hash()) + .await + .map_err(|e| ExtrinsicError::AccountNonceError { + block_hash: block_ref.hash().into(), + account_id: account_id.encode().into(), + reason: e, + }) } /// Creates a partial transaction, without submitting it. This can then be signed and submitted. @@ -209,7 +227,7 @@ where call: &Call, account_id: &T::AccountId, mut params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -226,7 +244,7 @@ where call: &Call, account_id: &T::AccountId, mut params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -243,7 +261,7 @@ where call: &Call, account_id: &T::AccountId, mut params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, { @@ -257,7 +275,7 @@ where call: &Call, signer: &Signer, params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, Signer: SignerT, @@ -278,7 +296,7 @@ where &mut self, call: &Call, signer: &Signer, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, Signer: SignerT, @@ -297,7 +315,7 @@ where call: &Call, signer: &Signer, params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, Signer: SignerT, @@ -322,7 +340,7 @@ where &mut self, call: &Call, signer: &Signer, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, Signer: SignerT, @@ -345,7 +363,7 @@ where call: &Call, signer: &Signer, params: >::Params, - ) -> Result, Error> + ) -> Result, ExtrinsicError> where Call: Payload, Signer: SignerT, @@ -485,7 +503,7 @@ where /// /// Returns a [`TxProgress`], which can be used to track the status of the transaction /// and obtain details about it, once it has made it into a block. - pub async fn submit_and_watch(&self) -> Result, Error> { + pub async fn submit_and_watch(&self) -> Result, ExtrinsicError> { // Get a hash of the transaction (we'll need this later). let ext_hash = self.hash(); @@ -494,7 +512,8 @@ where .client .backend() .submit_transaction(self.encoded()) - .await?; + .await + .map_err(ExtrinsicError::ErrorSubmittingTransaction)?; Ok(TxProgress::new(sub, self.client.clone(), ext_hash)) } @@ -504,13 +523,14 @@ where /// It's usually better to call `submit_and_watch` to get an idea of the progress of the /// submission and whether it's eventually successful or not. This call does not guarantee /// success, and is just sending the transaction to the chain. - pub async fn submit(&self) -> Result, Error> { + pub async fn submit(&self) -> Result, ExtrinsicError> { let ext_hash = self.hash(); let mut sub = self .client .backend() .submit_transaction(self.encoded()) - .await?; + .await + .map_err(ExtrinsicError::ErrorSubmittingTransaction)?; // If we get a bad status or error back straight away then error, else return the hash. match sub.next().await { @@ -520,20 +540,22 @@ where | TransactionStatus::InBestBlock { .. } | TransactionStatus::NoLongerInBestBlock | TransactionStatus::InFinalizedBlock { .. } => Ok(ext_hash), - TransactionStatus::Error { message } => { - Err(Error::Other(format!("Transaction error: {message}"))) - } + TransactionStatus::Error { message } => Err( + ExtrinsicError::TransactionStatusError(TransactionStatusError::Error(message)), + ), TransactionStatus::Invalid { message } => { - Err(Error::Other(format!("Transaction invalid: {message}"))) + Err(ExtrinsicError::TransactionStatusError( + TransactionStatusError::Invalid(message), + )) } TransactionStatus::Dropped { message } => { - Err(Error::Other(format!("Transaction dropped: {message}"))) + Err(ExtrinsicError::TransactionStatusError( + TransactionStatusError::Dropped(message), + )) } }, - Some(Err(e)) => Err(e), - None => Err(Error::Other( - "Transaction broadcast was unsuccessful; stream terminated early".into(), - )), + Some(Err(e)) => Err(ExtrinsicError::TransactionStatusStreamError(e)), + None => Err(ExtrinsicError::UnexpectedEndOfTransactionStatusStream), } } @@ -541,8 +563,13 @@ where /// valid can be added to a block, but may still end up in an error state. /// /// Returns `Ok` with a [`ValidationResult`], which is the result of attempting to dry run the transaction. - pub async fn validate(&self) -> Result { - let latest_block_ref = self.client.backend().latest_finalized_block_ref().await?; + pub async fn validate(&self) -> Result { + let latest_block_ref = self + .client + .backend() + .latest_finalized_block_ref() + .await + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; self.validate_at(latest_block_ref).await } @@ -553,7 +580,7 @@ where pub async fn validate_at( &self, at: impl Into>>, - ) -> Result { + ) -> Result { let block_hash = at.into().hash(); // Approach taken from https://github.com/paritytech/json-rpc-interface-spec/issues/55. @@ -570,17 +597,23 @@ where Some(¶ms), block_hash, ) - .await?; + .await + .map_err(ExtrinsicError::CannotGetValidationInfo)?; ValidationResult::try_from_bytes(res) } /// This returns an estimate for what the transaction is expected to cost to execute, less any tips. /// The actual amount paid can vary from block to block based on node traffic and other factors. - pub async fn partial_fee_estimate(&self) -> Result { + pub async fn partial_fee_estimate(&self) -> Result { let mut params = self.encoded().to_vec(); (self.encoded().len() as u32).encode_to(&mut params); - let latest_block_ref = self.client.backend().latest_finalized_block_ref().await?; + let latest_block_ref = self + .client + .backend() + .latest_finalized_block_ref() + .await + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; // destructuring RuntimeDispatchInfo, see type information // data layout: {weight_ref_time: Compact, weight_proof_size: Compact, class: u8, partial_fee: u128} @@ -592,7 +625,9 @@ where Some(¶ms), latest_block_ref.hash(), ) - .await?; + .await + .map_err(ExtrinsicError::CannotGetFeeInfo)?; + Ok(partial_fee) } } @@ -602,19 +637,33 @@ async fn inject_account_nonce_and_block>( client: &Client, account_id: &T::AccountId, params: &mut >::Params, -) -> Result<(), Error> { +) -> Result<(), ExtrinsicError> { use subxt_core::config::transaction_extensions::Params; - let block_ref = client.backend().latest_finalized_block_ref().await?; + let block_ref = client + .backend() + .latest_finalized_block_ref() + .await + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock)?; let (block_header, account_nonce) = try_join( - client.backend().block_header(block_ref.hash()), - crate::blocks::get_account_nonce(client, account_id, block_ref.hash()), + client + .backend() + .block_header(block_ref.hash()) + .map_err(ExtrinsicError::CannotGetLatestFinalizedBlock), + crate::blocks::get_account_nonce(client, account_id, block_ref.hash()).map_err(|e| { + ExtrinsicError::AccountNonceError { + block_hash: block_ref.hash().into(), + account_id: account_id.encode().into(), + reason: e, + } + }), ) .await?; - let block_header = - block_header.ok_or_else(|| Error::Block(BlockError::not_found(block_ref.hash())))?; + let block_header = block_header.ok_or_else(|| ExtrinsicError::CannotFindBlockHeader { + block_hash: block_ref.hash().into(), + })?; params.inject_account_nonce(account_nonce); params.inject_block(block_header.number().into(), block_ref.hash()); @@ -624,26 +673,29 @@ async fn inject_account_nonce_and_block>( impl ValidationResult { #[allow(clippy::get_first)] - fn try_from_bytes(bytes: Vec) -> Result { + fn try_from_bytes(bytes: Vec) -> Result { // TaggedTransactionQueue_validate_transaction returns this: // https://github.com/paritytech/substrate/blob/0cdf7029017b70b7c83c21a4dc0aa1020e7914f6/primitives/runtime/src/transaction_validity.rs#L210 // We copy some of the inner types and put the three states (valid, invalid, unknown) into one enum, // because from our perspective, the call was successful regardless. if bytes.get(0) == Some(&0) { // ok: valid. Decode but, for now we discard most of the information - let res = TransactionValid::decode(&mut &bytes[1..])?; + let res = TransactionValid::decode(&mut &bytes[1..]) + .map_err(ExtrinsicError::CannotDecodeValidationResult)?; Ok(ValidationResult::Valid(res)) } else if bytes.get(0) == Some(&1) && bytes.get(1) == Some(&0) { // error: invalid - let res = TransactionInvalid::decode(&mut &bytes[2..])?; + let res = TransactionInvalid::decode(&mut &bytes[2..]) + .map_err(ExtrinsicError::CannotDecodeValidationResult)?; Ok(ValidationResult::Invalid(res)) } else if bytes.get(0) == Some(&1) && bytes.get(1) == Some(&1) { // error: unknown - let res = TransactionUnknown::decode(&mut &bytes[2..])?; + let res = TransactionUnknown::decode(&mut &bytes[2..]) + .map_err(ExtrinsicError::CannotDecodeValidationResult)?; Ok(ValidationResult::Unknown(res)) } else { // unable to decode the bytes; they aren't what we expect. - Err(crate::Error::Unknown(bytes)) + Err(ExtrinsicError::UnexpectedValidationResultBytes(bytes)) } } } diff --git a/subxt/src/tx/tx_progress.rs b/subxt/src/tx/tx_progress.rs index 0940e613de1..83126dcd3e2 100644 --- a/subxt/src/tx/tx_progress.rs +++ b/subxt/src/tx/tx_progress.rs @@ -10,7 +10,10 @@ use crate::{ backend::{BlockRef, StreamOfResults, TransactionStatus as BackendTxStatus}, client::OnlineClientT, config::{Config, HashFor}, - error::{DispatchError, Error, RpcError, TransactionError}, + error::{ + DispatchError, TransactionEventsError, TransactionFinalizedSuccessError, + TransactionProgressError, TransactionStatusError, + }, events::EventsClient, utils::strip_compact_prefix, }; @@ -67,7 +70,7 @@ where /// Return the next transaction status when it's emitted. This just delegates to the /// [`futures::Stream`] implementation for [`TxProgress`], but allows you to /// avoid importing that trait if you don't otherwise need it. - pub async fn next(&mut self) -> Option, Error>> { + pub async fn next(&mut self) -> Option, TransactionProgressError>> { StreamExt::next(self).await } @@ -81,24 +84,26 @@ where /// probability that the transaction will not make it into a block but there is no guarantee /// that this is true. In those cases the stream is closed however, so you currently have no way to find /// out if they finally made it into a block or not. - pub async fn wait_for_finalized(mut self) -> Result, Error> { + pub async fn wait_for_finalized(mut self) -> Result, TransactionProgressError> { while let Some(status) = self.next().await { match status? { // Finalized! Return. TxStatus::InFinalizedBlock(s) => return Ok(s), // Error scenarios; return the error. - TxStatus::Error { message } => return Err(TransactionError::Error(message).into()), + TxStatus::Error { message } => { + return Err(TransactionStatusError::Error(message).into()); + } TxStatus::Invalid { message } => { - return Err(TransactionError::Invalid(message).into()); + return Err(TransactionStatusError::Invalid(message).into()); } TxStatus::Dropped { message } => { - return Err(TransactionError::Dropped(message).into()); + return Err(TransactionStatusError::Dropped(message).into()); } // Ignore and wait for next status event: _ => continue, } } - Err(RpcError::SubscriptionDropped.into()) + Err(TransactionProgressError::UnexpectedEndOfTransactionStatusStream) } /// Wait for the transaction to be finalized, and for the transaction events to indicate @@ -114,14 +119,14 @@ where /// out if they finally made it into a block or not. pub async fn wait_for_finalized_success( self, - ) -> Result, Error> { + ) -> Result, TransactionFinalizedSuccessError> { let evs = self.wait_for_finalized().await?.wait_for_success().await?; Ok(evs) } } impl Stream for TxProgress { - type Item = Result, Error>; + type Item = Result, TransactionProgressError>; fn poll_next( mut self: std::pin::Pin<&mut Self>, @@ -132,37 +137,41 @@ impl Stream for TxProgress { None => return Poll::Ready(None), }; - sub.poll_next_unpin(cx).map_ok(|status| { - match status { - BackendTxStatus::Validated => TxStatus::Validated, - BackendTxStatus::Broadcasted => TxStatus::Broadcasted, - BackendTxStatus::NoLongerInBestBlock => TxStatus::NoLongerInBestBlock, - BackendTxStatus::InBestBlock { hash } => { - TxStatus::InBestBlock(TxInBlock::new(hash, self.ext_hash, self.client.clone())) - } - // These stream events mean that nothing further will be sent: - BackendTxStatus::InFinalizedBlock { hash } => { - self.sub = None; - TxStatus::InFinalizedBlock(TxInBlock::new( + sub.poll_next_unpin(cx) + .map_err(TransactionProgressError::CannotGetNextProgressUpdate) + .map_ok(|status| { + match status { + BackendTxStatus::Validated => TxStatus::Validated, + BackendTxStatus::Broadcasted => TxStatus::Broadcasted, + BackendTxStatus::NoLongerInBestBlock => TxStatus::NoLongerInBestBlock, + BackendTxStatus::InBestBlock { hash } => TxStatus::InBestBlock(TxInBlock::new( hash, self.ext_hash, self.client.clone(), - )) - } - BackendTxStatus::Error { message } => { - self.sub = None; - TxStatus::Error { message } - } - BackendTxStatus::Invalid { message } => { - self.sub = None; - TxStatus::Invalid { message } + )), + // These stream events mean that nothing further will be sent: + BackendTxStatus::InFinalizedBlock { hash } => { + self.sub = None; + TxStatus::InFinalizedBlock(TxInBlock::new( + hash, + self.ext_hash, + self.client.clone(), + )) + } + BackendTxStatus::Error { message } => { + self.sub = None; + TxStatus::Error { message } + } + BackendTxStatus::Invalid { message } => { + self.sub = None; + TxStatus::Invalid { message } + } + BackendTxStatus::Dropped { message } => { + self.sub = None; + TxStatus::Dropped { message } + } } - BackendTxStatus::Dropped { message } => { - self.sub = None; - TxStatus::Dropped { message } - } - } - }) + }) } } @@ -258,15 +267,27 @@ impl> TxInBlock { /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn wait_for_success(&self) -> Result, Error> { + pub async fn wait_for_success( + &self, + ) -> Result, TransactionEventsError> { let events = self.fetch_events().await?; // Try to find any errors; return the first one we encounter. - for ev in events.iter() { - let ev = ev?; + for (ev_idx, ev) in events.iter().enumerate() { + let ev = ev.map_err(|e| TransactionEventsError::CannotDecodeEventInBlock { + event_index: ev_idx, + block_hash: self.block_hash().into(), + error: e, + })?; + if ev.pallet_name() == "System" && ev.variant_name() == "ExtrinsicFailed" { let dispatch_error = - DispatchError::decode_from(ev.field_bytes(), self.client.metadata())?; + DispatchError::decode_from(ev.field_bytes(), self.client.metadata()).map_err( + |e| TransactionEventsError::CannotDecodeDispatchError { + error: e, + bytes: ev.field_bytes().to_vec(), + }, + )?; return Err(dispatch_error.into()); } } @@ -280,15 +301,23 @@ impl> TxInBlock { /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn fetch_events(&self) -> Result, Error> { + pub async fn fetch_events( + &self, + ) -> Result, TransactionEventsError> { let hasher = self.client.hasher(); let block_body = self .client .backend() .block_body(self.block_ref.hash()) - .await? - .ok_or(Error::Transaction(TransactionError::BlockNotFound))?; + .await + .map_err(|e| TransactionEventsError::CannotFetchBlockBody { + block_hash: self.block_hash().into(), + error: e, + })? + .ok_or_else(|| TransactionEventsError::BlockNotFound { + block_hash: self.block_hash().into(), + })?; let extrinsic_idx = block_body .iter() @@ -302,11 +331,21 @@ impl> TxInBlock { }) // If we successfully obtain the block hash we think contains our // extrinsic, the extrinsic should be in there somewhere.. - .ok_or(Error::Transaction(TransactionError::BlockNotFound))?; + .ok_or_else(|| TransactionEventsError::CannotFindTransactionInBlock { + block_hash: self.block_hash().into(), + transaction_hash: self.ext_hash.into(), + })?; let events = EventsClient::new(self.client.clone()) .at(self.block_ref.clone()) - .await?; + .await + .map_err( + |e| TransactionEventsError::CannotFetchEventsForTransaction { + block_hash: self.block_hash().into(), + transaction_hash: self.ext_hash.into(), + error: e, + }, + )?; Ok(crate::blocks::ExtrinsicEvents::new( self.ext_hash, @@ -318,10 +357,11 @@ impl> TxInBlock { #[cfg(test)] mod test { + use super::*; use subxt_core::client::RuntimeVersion; use crate::{ - Error, SubstrateConfig, + SubstrateConfig, backend::{StreamOfResults, TransactionStatus}, client::{OfflineClientT, OnlineClientT}, config::{Config, HashFor}, @@ -375,7 +415,7 @@ mod test { let finalized_result = tx_progress.wait_for_finalized().await; assert!(matches!( finalized_result, - Err(Error::Transaction(crate::error::TransactionError::Error(e))) if e == "err" + Err(TransactionProgressError::TransactionStatusError(TransactionStatusError::Error(e))) if e == "err" )); } @@ -390,7 +430,7 @@ mod test { let finalized_result = tx_progress.wait_for_finalized().await; assert!(matches!( finalized_result, - Err(Error::Transaction(crate::error::TransactionError::Invalid(e))) if e == "err" + Err(TransactionProgressError::TransactionStatusError(TransactionStatusError::Invalid(e))) if e == "err" )); } @@ -405,7 +445,7 @@ mod test { let finalized_result = tx_progress.wait_for_finalized().await; assert!(matches!( finalized_result, - Err(Error::Transaction(crate::error::TransactionError::Dropped(e))) if e == "err" + Err(TransactionProgressError::TransactionStatusError(TransactionStatusError::Dropped(e))) if e == "err" )); } diff --git a/subxt/src/view_functions/mod.rs b/subxt/src/view_functions/mod.rs index f544bf7818a..df095bfb093 100644 --- a/subxt/src/view_functions/mod.rs +++ b/subxt/src/view_functions/mod.rs @@ -7,8 +7,6 @@ mod view_function_types; mod view_functions_client; -pub use subxt_core::view_functions::payload::{ - DefaultPayload, DynamicPayload, Payload, StaticPayload, dynamic, -}; +pub use subxt_core::view_functions::payload::{DynamicPayload, Payload, StaticPayload, dynamic}; pub use view_function_types::ViewFunctionsApi; pub use view_functions_client::ViewFunctionsClient; diff --git a/subxt/src/view_functions/view_function_types.rs b/subxt/src/view_functions/view_function_types.rs index 62371e2487e..9860dca78ee 100644 --- a/subxt/src/view_functions/view_function_types.rs +++ b/subxt/src/view_functions/view_function_types.rs @@ -7,7 +7,7 @@ use crate::{ backend::BlockRef, client::OnlineClientT, config::{Config, HashFor}, - error::Error, + error::ViewFunctionError, }; use derive_where::derive_where; use std::{future::Future, marker::PhantomData}; @@ -40,7 +40,7 @@ where /// if the payload is valid (or if it's not possible to check since the payload has no validation hash). /// Return an error if the payload was not valid or something went wrong trying to validate it (ie /// the View Function in question do not exist at all) - pub fn validate(&self, payload: &Call) -> Result<(), Error> { + pub fn validate(&self, payload: Call) -> Result<(), ViewFunctionError> { subxt_core::view_functions::validate(payload, &self.client.metadata()).map_err(Into::into) } @@ -48,7 +48,8 @@ where pub fn call( &self, payload: Call, - ) -> impl Future> + use { + ) -> impl Future> + use + { let client = self.client.clone(); let block_hash = self.block_ref.hash(); // Ensure that the returned future doesn't have a lifetime tied to api.view_functions(), @@ -68,7 +69,8 @@ where let bytes = client .backend() .call(call_name, Some(call_args.as_slice()), block_hash) - .await?; + .await + .map_err(ViewFunctionError::CannotCallApi)?; // Decode the response. let value = diff --git a/subxt/src/view_functions/view_functions_client.rs b/subxt/src/view_functions/view_functions_client.rs index 5ce39179028..cdd0efe5c47 100644 --- a/subxt/src/view_functions/view_functions_client.rs +++ b/subxt/src/view_functions/view_functions_client.rs @@ -8,7 +8,7 @@ use crate::{ backend::BlockRef, client::OnlineClientT, config::{Config, HashFor}, - error::Error, + error::ViewFunctionError, }; use derive_where::derive_where; use std::{future::Future, marker::PhantomData}; @@ -43,13 +43,18 @@ where /// Obtain an interface to call View Functions at the latest finalized block. pub fn at_latest( &self, - ) -> impl Future, Error>> + Send + 'static { + ) -> impl Future, ViewFunctionError>> + Send + 'static + { // Clone and pass the client in like this so that we can explicitly // return a Future that's Send + 'static, rather than tied to &self. let client = self.client.clone(); async move { // get the ref for the latest finalized block and use that. - let block_ref = client.backend().latest_finalized_block_ref().await?; + let block_ref = client + .backend() + .latest_finalized_block_ref() + .await + .map_err(ViewFunctionError::CannotGetLatestFinalizedBlock)?; Ok(ViewFunctionsApi::new(client, block_ref)) } diff --git a/testing/integration-tests/src/full_client/blocks.rs b/testing/integration-tests/src/full_client/blocks.rs index e28db9daff6..770290a5fa5 100644 --- a/testing/integration-tests/src/full_client/blocks.rs +++ b/testing/integration-tests/src/full_client/blocks.rs @@ -158,7 +158,7 @@ async fn runtime_api_call() -> Result<(), subxt::Error> { let mut sub = api.blocks().subscribe_best().await?; let block = sub.next().await.unwrap()?; - let rt = block.runtime_api().await?; + let rt = block.runtime_api().await; // get metadata via raw state_call. let meta_bytes = rt.call_raw("Metadata_metadata", None).await?; @@ -401,7 +401,7 @@ async fn decode_block_mortality() { } // Explicit Mortal: - for for_n_blocks in [4, 16, 128] { + for for_n_blocks in [16, 64, 128] { let tx = submit_extrinsic_and_get_it_back( &api, DefaultExtrinsicParamsBuilder::new().mortal(for_n_blocks), diff --git a/testing/integration-tests/src/full_client/client/archive_rpcs.rs b/testing/integration-tests/src/full_client/client/archive_rpcs.rs index fcda7fc39b2..434c4a61ac5 100644 --- a/testing/integration-tests/src/full_client/client/archive_rpcs.rs +++ b/testing/integration-tests/src/full_client/client/archive_rpcs.rs @@ -75,7 +75,6 @@ async fn archive_v1_call() { let subxt_metadata_versions = block .runtime_api() .await - .unwrap() .call(node_runtime::apis().metadata().metadata_versions()) .await .unwrap() @@ -184,20 +183,15 @@ async fn archive_v1_storage() { while let Some(block) = blocks.next().await { let block_hash = block.hash(); - let account_info_addr = { - let alice: AccountId32 = dev::alice().public_key().into(); - let addr = node_runtime::storage().system().account(alice); - api.storage().address_bytes(&addr).unwrap() - }; - - // Fetch raw value using Subxt to compare against - let subxt_account_info = api - .storage() - .at(block.reference()) - .fetch_raw(account_info_addr.clone()) - .await - .unwrap() - .unwrap(); + let alice: AccountId32 = dev::alice().public_key().into(); + let addr = node_runtime::storage().system().account(); + + // Fetch value using Subxt to compare against + let storage_at = api.storage().at(block.reference()); + let storage_entry = storage_at.entry(addr).unwrap(); + let subxt_account_info = storage_entry.fetch((alice.clone(),)).await.unwrap(); + let subxt_account_info_bytes = subxt_account_info.bytes(); + let account_info_addr = storage_entry.key((alice,)).unwrap(); // Construct archive query; ask for item then hash of item. let storage_query = vec![ @@ -223,7 +217,7 @@ async fn archive_v1_storage() { query_item, ArchiveStorageEventItem { key: Bytes(account_info_addr.clone()), - value: Some(Bytes(subxt_account_info.clone())), + value: Some(Bytes(subxt_account_info_bytes.to_vec())), hash: None, closest_descendant_merkle_value: None, child_trie_key: None @@ -238,7 +232,7 @@ async fn archive_v1_storage() { ArchiveStorageEventItem { key: Bytes(account_info_addr), value: None, - hash: Some(hasher.hash(&subxt_account_info)), + hash: Some(hasher.hash(subxt_account_info_bytes)), closest_descendant_merkle_value: None, child_trie_key: None } diff --git a/testing/integration-tests/src/full_client/client/chain_head_rpcs.rs b/testing/integration-tests/src/full_client/client/chain_head_rpcs.rs index 29afda0b601..003dab7459e 100644 --- a/testing/integration-tests/src/full_client/client/chain_head_rpcs.rs +++ b/testing/integration-tests/src/full_client/client/chain_head_rpcs.rs @@ -134,8 +134,12 @@ async fn chainhead_v1_storage() { let sub_id = blocks.subscription_id().unwrap(); let alice: AccountId32 = dev::alice().public_key().into(); - let addr = node_runtime::storage().system().account(alice); - let addr_bytes = api.storage().address_bytes(&addr).unwrap(); + + let addr_bytes = { + let storage_at = api.storage().at_latest().await.unwrap(); + let addr = node_runtime::storage().system().account(); + storage_at.entry(addr).unwrap().key((alice,)).unwrap() + }; let items = vec![StorageQuery { key: addr_bytes.as_slice(), diff --git a/testing/integration-tests/src/full_client/client/mod.rs b/testing/integration-tests/src/full_client/client/mod.rs index c1897bccdc8..46e0619bfd0 100644 --- a/testing/integration-tests/src/full_client/client/mod.rs +++ b/testing/integration-tests/src/full_client/client/mod.rs @@ -13,7 +13,7 @@ use futures::StreamExt; use subxt::{ backend::BackendExt, - error::{DispatchError, Error}, + error::{DispatchError, TransactionEventsError, TransactionFinalizedSuccessError}, tx::{TransactionInvalid, ValidationResult}, }; use subxt_signer::sr25519::dev; @@ -27,42 +27,16 @@ mod chain_head_rpcs; #[cfg(fullclient)] #[subxt_test] -async fn storage_fetch_raw_keys() { +async fn storage_iter() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let addr = node_runtime::storage().system().account_iter(); - let len = api - .storage() - .at_latest() - .await - .unwrap() - .fetch_raw_keys(addr.to_root_bytes()) - .await - .unwrap() - .filter_map(async |r| r.ok()) - .count() - .await; - - assert_eq!(len, 17) -} + let addr = node_runtime::storage().system().account(); + let storage = api.storage().at_latest().await.unwrap(); + let entry = storage.entry(addr)?; -#[cfg(fullclient)] -#[subxt_test] -async fn storage_iter() { - let ctx = test_context().await; - let api = ctx.client(); - - let addr = node_runtime::storage().system().account_iter(); - let addr_bytes = api.storage().address_bytes(&addr).unwrap(); - assert_eq!(addr_bytes, addr.to_root_bytes()); - - let len = api - .storage() - .at_latest() - .await - .unwrap() - .iter(addr) + let len = entry + .iter(()) .await .unwrap() .filter_map(async |r| r.ok()) @@ -70,17 +44,18 @@ async fn storage_iter() { .await; assert_eq!(len, 17); + Ok(()) } #[cfg(fullclient)] #[subxt_test] -async fn storage_child_values_same_across_backends() { +async fn storage_child_values_same_across_backends() -> Result<(), subxt::Error> { let ctx = test_context().await; let chainhead_client = ctx.chainhead_backend().await; let legacy_client = ctx.legacy_backend().await; - let addr = node_runtime::storage().system().account_iter(); + let addr = node_runtime::storage().system().account(); let block_ref = legacy_client .blocks() .at_latest() @@ -88,18 +63,17 @@ async fn storage_child_values_same_across_backends() { .unwrap() .reference(); - let a: Vec<_> = chainhead_client - .storage() - .at(block_ref.clone()) - .iter(addr.clone()) + let chainhead_storage = chainhead_client.storage().at(block_ref.clone()); + let a: Vec<_> = chainhead_storage + .iter(&addr, ()) .await .unwrap() .collect() .await; - let b: Vec<_> = legacy_client - .storage() - .at(block_ref.clone()) - .iter(addr) + + let legacy_storage = legacy_client.storage().at(block_ref.clone()); + let b: Vec<_> = legacy_storage + .iter(&addr, ()) .await .unwrap() .collect() @@ -109,8 +83,10 @@ async fn storage_child_values_same_across_backends() { let a = a.unwrap(); let b = b.unwrap(); - assert_eq!(a, b); + assert_eq!(a.key_bytes(), b.key_bytes()); + assert_eq!(a.value().bytes(), b.value().bytes()); } + Ok(()) } #[subxt_test] @@ -273,7 +249,10 @@ async fn decode_a_module_error() { .await .expect_err("an 'unknown asset' error"); - let Error::Runtime(DispatchError::Module(module_err)) = err else { + let TransactionFinalizedSuccessError::SuccessError(TransactionEventsError::ExtrinsicFailed( + DispatchError::Module(module_err), + )) = err + else { panic!("Expected a ModuleError, got {err:?}"); }; diff --git a/testing/integration-tests/src/full_client/codegen/polkadot.rs b/testing/integration-tests/src/full_client/codegen/polkadot.rs index 8364e8627cd..fb499743f41 100644 --- a/testing/integration-tests/src/full_client/codegen/polkadot.rs +++ b/testing/integration-tests/src/full_client/codegen/polkadot.rs @@ -201,13 +201,13 @@ pub mod api { pub fn version( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::Version, - types::version::output::Output, + (), + version::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "Core", "version", - types::Version {}, + (), [ 79u8, 22u8, 137u8, 4u8, 40u8, 64u8, 30u8, 180u8, 49u8, 222u8, 114u8, 125u8, 44u8, 25u8, 33u8, 152u8, 98u8, 42u8, 72u8, 178u8, 240u8, 103u8, @@ -218,15 +218,15 @@ pub mod api { #[doc = " Execute the given block."] pub fn execute_block( &self, - block: types::execute_block::Block, + block: execute_block::Block, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ExecuteBlock, - types::execute_block::output::Output, + (execute_block::Block,), + execute_block::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "Core", "execute_block", - types::ExecuteBlock { block }, + (block,), [ 133u8, 135u8, 228u8, 65u8, 106u8, 27u8, 85u8, 158u8, 112u8, 254u8, 93u8, 26u8, 102u8, 201u8, 118u8, 216u8, 249u8, 247u8, 91u8, 74u8, 56u8, @@ -237,15 +237,15 @@ pub mod api { #[doc = " Initialize a block with the given header and return the runtime executive mode."] pub fn initialize_block( &self, - header: types::initialize_block::Header, + header: initialize_block::Header, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::InitializeBlock, - types::initialize_block::output::Output, + (initialize_block::Header,), + initialize_block::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "Core", "initialize_block", - types::InitializeBlock { header }, + (header,), [ 132u8, 169u8, 113u8, 112u8, 80u8, 139u8, 113u8, 35u8, 41u8, 81u8, 36u8, 35u8, 37u8, 202u8, 29u8, 207u8, 205u8, 229u8, 145u8, 7u8, 133u8, 94u8, @@ -254,71 +254,31 @@ pub mod api { ) } } - pub mod types { + pub mod version { + use super::root_mod; use super::runtime_types; - pub mod version { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_version::RuntimeVersion; - } + pub type Output = runtime_types::sp_version::RuntimeVersion; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Version {} - pub mod execute_block { + } + pub mod execute_block { + use super::root_mod; + use super::runtime_types; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; + pub mod output { use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; - pub mod output { - use super::runtime_types; - pub type Output = (); - } + pub type Output = (); } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ExecuteBlock { - pub block: execute_block::Block, - } - pub mod initialize_block { + } + pub mod initialize_block { + use super::root_mod; + use super::runtime_types; + pub type Header = + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub mod output { use super::runtime_types; - pub type Header = - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_runtime::ExtrinsicInclusionMode; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct InitializeBlock { - pub header: initialize_block::Header, + pub type Output = runtime_types::sp_runtime::ExtrinsicInclusionMode; } } } @@ -345,15 +305,15 @@ pub mod api { #[doc = " * `xcm_version`: Version."] pub fn query_acceptable_payment_assets( &self, - xcm_version: types::query_acceptable_payment_assets::XcmVersion, + xcm_version: query_acceptable_payment_assets::XcmVersion, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryAcceptablePaymentAssets, - types::query_acceptable_payment_assets::output::Output, + (query_acceptable_payment_assets::XcmVersion,), + query_acceptable_payment_assets::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "XcmPaymentApi", "query_acceptable_payment_assets", - types::QueryAcceptablePaymentAssets { xcm_version }, + (xcm_version,), [ 29u8, 81u8, 159u8, 80u8, 29u8, 95u8, 91u8, 180u8, 135u8, 23u8, 106u8, 224u8, 21u8, 102u8, 89u8, 89u8, 23u8, 72u8, 125u8, 136u8, 144u8, 136u8, @@ -368,15 +328,15 @@ pub mod api { #[doc = " * `message`: `VersionedXcm`."] pub fn query_xcm_weight( &self, - message: types::query_xcm_weight::Message, + message: query_xcm_weight::Message, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryXcmWeight, - types::query_xcm_weight::output::Output, + (query_xcm_weight::Message,), + query_xcm_weight::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "XcmPaymentApi", "query_xcm_weight", - types::QueryXcmWeight { message }, + (message,), [ 210u8, 246u8, 6u8, 74u8, 134u8, 215u8, 196u8, 176u8, 38u8, 218u8, 239u8, 142u8, 11u8, 235u8, 204u8, 218u8, 123u8, 66u8, 106u8, 60u8, @@ -393,16 +353,19 @@ pub mod api { #[doc = " * `asset`: `VersionedAssetId`."] pub fn query_weight_to_asset_fee( &self, - weight: types::query_weight_to_asset_fee::Weight, - asset: types::query_weight_to_asset_fee::Asset, + weight: query_weight_to_asset_fee::Weight, + asset: query_weight_to_asset_fee::Asset, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryWeightToAssetFee, - types::query_weight_to_asset_fee::output::Output, + ( + query_weight_to_asset_fee::Weight, + query_weight_to_asset_fee::Asset, + ), + query_weight_to_asset_fee::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "XcmPaymentApi", "query_weight_to_asset_fee", - types::QueryWeightToAssetFee { weight, asset }, + (weight, asset), [ 170u8, 180u8, 252u8, 70u8, 130u8, 183u8, 254u8, 104u8, 112u8, 235u8, 227u8, 117u8, 29u8, 40u8, 30u8, 158u8, 149u8, 222u8, 126u8, 30u8, 2u8, @@ -420,19 +383,19 @@ pub mod api { #[doc = " different senders that charge different fees."] pub fn query_delivery_fees( &self, - destination: types::query_delivery_fees::Destination, - message: types::query_delivery_fees::Message, + destination: query_delivery_fees::Destination, + message: query_delivery_fees::Message, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryDeliveryFees, - types::query_delivery_fees::output::Output, + ( + query_delivery_fees::Destination, + query_delivery_fees::Message, + ), + query_delivery_fees::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "XcmPaymentApi", "query_delivery_fees", - types::QueryDeliveryFees { - destination, - message, - }, + (destination, message), [ 102u8, 222u8, 158u8, 11u8, 13u8, 250u8, 188u8, 33u8, 75u8, 84u8, 128u8, 20u8, 186u8, 211u8, 253u8, 108u8, 133u8, 71u8, 236u8, 158u8, 147u8, @@ -442,113 +405,56 @@ pub mod api { ) } } - pub mod types { + pub mod query_acceptable_payment_assets { + use super::root_mod; use super::runtime_types; - pub mod query_acceptable_payment_assets { + pub type XcmVersion = ::core::primitive::u32; + pub mod output { use super::runtime_types; - pub type XcmVersion = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::xcm::VersionedAssetId, - >, - runtime_types::xcm_runtime_apis::fees::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryAcceptablePaymentAssets { - pub xcm_version: query_acceptable_payment_assets::XcmVersion, + pub type Output = ::core::result::Result< + ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::xcm::VersionedAssetId, + >, + runtime_types::xcm_runtime_apis::fees::Error, + >; } - pub mod query_xcm_weight { + } + pub mod query_xcm_weight { + use super::root_mod; + use super::runtime_types; + pub type Message = runtime_types::xcm::VersionedXcm; + pub mod output { use super::runtime_types; - pub type Message = runtime_types::xcm::VersionedXcm; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - runtime_types::sp_weights::weight_v2::Weight, - runtime_types::xcm_runtime_apis::fees::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryXcmWeight { - pub message: query_xcm_weight::Message, + pub type Output = ::core::result::Result< + runtime_types::sp_weights::weight_v2::Weight, + runtime_types::xcm_runtime_apis::fees::Error, + >; } - pub mod query_weight_to_asset_fee { + } + pub mod query_weight_to_asset_fee { + use super::root_mod; + use super::runtime_types; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + pub type Asset = runtime_types::xcm::VersionedAssetId; + pub mod output { use super::runtime_types; - pub type Weight = runtime_types::sp_weights::weight_v2::Weight; - pub type Asset = runtime_types::xcm::VersionedAssetId; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ::core::primitive::u128, - runtime_types::xcm_runtime_apis::fees::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryWeightToAssetFee { - pub weight: query_weight_to_asset_fee::Weight, - pub asset: query_weight_to_asset_fee::Asset, + pub type Output = ::core::result::Result< + ::core::primitive::u128, + runtime_types::xcm_runtime_apis::fees::Error, + >; } - pub mod query_delivery_fees { + } + pub mod query_delivery_fees { + use super::root_mod; + use super::runtime_types; + pub type Destination = runtime_types::xcm::VersionedLocation; + pub type Message = runtime_types::xcm::VersionedXcm; + pub mod output { use super::runtime_types; - pub type Destination = runtime_types::xcm::VersionedLocation; - pub type Message = runtime_types::xcm::VersionedXcm; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - runtime_types::xcm::VersionedAssets, - runtime_types::xcm_runtime_apis::fees::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryDeliveryFees { - pub destination: query_delivery_fees::Destination, - pub message: query_delivery_fees::Message, + pub type Output = ::core::result::Result< + runtime_types::xcm::VersionedAssets, + runtime_types::xcm_runtime_apis::fees::Error, + >; } } } @@ -569,21 +475,21 @@ pub mod api { #[doc = " Dry run call V2."] pub fn dry_run_call( &self, - origin: types::dry_run_call::Origin, - call: types::dry_run_call::Call, - result_xcms_version: types::dry_run_call::ResultXcmsVersion, + origin: dry_run_call::Origin, + call: dry_run_call::Call, + result_xcms_version: dry_run_call::ResultXcmsVersion, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::DryRunCall, - types::dry_run_call::output::Output, + ( + dry_run_call::Origin, + dry_run_call::Call, + dry_run_call::ResultXcmsVersion, + ), + dry_run_call::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "DryRunApi", "dry_run_call", - types::DryRunCall { - origin, - call, - result_xcms_version, - }, + (origin, call, result_xcms_version), [ 40u8, 38u8, 126u8, 49u8, 197u8, 238u8, 216u8, 241u8, 159u8, 127u8, 59u8, 226u8, 148u8, 145u8, 171u8, 208u8, 144u8, 48u8, 107u8, 203u8, @@ -595,19 +501,16 @@ pub mod api { #[doc = " Dry run XCM program"] pub fn dry_run_xcm( &self, - origin_location: types::dry_run_xcm::OriginLocation, - xcm: types::dry_run_xcm::Xcm, + origin_location: dry_run_xcm::OriginLocation, + xcm: dry_run_xcm::Xcm, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::DryRunXcm, - types::dry_run_xcm::output::Output, + (dry_run_xcm::OriginLocation, dry_run_xcm::Xcm), + dry_run_xcm::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "DryRunApi", "dry_run_xcm", - types::DryRunXcm { - origin_location, - xcm, - }, + (origin_location, xcm), [ 118u8, 151u8, 164u8, 99u8, 186u8, 178u8, 47u8, 236u8, 70u8, 95u8, 145u8, 237u8, 26u8, 142u8, 56u8, 139u8, 136u8, 84u8, 40u8, 218u8, 46u8, @@ -616,67 +519,35 @@ pub mod api { ) } } - pub mod types { + pub mod dry_run_call { + use super::root_mod; use super::runtime_types; - pub mod dry_run_call { + pub type Origin = runtime_types::rococo_runtime::OriginCaller; + pub type Call = runtime_types::rococo_runtime::RuntimeCall; + pub type ResultXcmsVersion = ::core::primitive::u32; + pub mod output { use super::runtime_types; - pub type Origin = runtime_types::rococo_runtime::OriginCaller; - pub type Call = runtime_types::rococo_runtime::RuntimeCall; - pub type ResultXcmsVersion = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - runtime_types::xcm_runtime_apis::dry_run::CallDryRunEffects< - runtime_types::rococo_runtime::RuntimeEvent, - >, - runtime_types::xcm_runtime_apis::dry_run::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct DryRunCall { - pub origin: dry_run_call::Origin, - pub call: dry_run_call::Call, - pub result_xcms_version: dry_run_call::ResultXcmsVersion, + pub type Output = ::core::result::Result< + runtime_types::xcm_runtime_apis::dry_run::CallDryRunEffects< + runtime_types::rococo_runtime::RuntimeEvent, + >, + runtime_types::xcm_runtime_apis::dry_run::Error, + >; } - pub mod dry_run_xcm { + } + pub mod dry_run_xcm { + use super::root_mod; + use super::runtime_types; + pub type OriginLocation = runtime_types::xcm::VersionedLocation; + pub type Xcm = runtime_types::xcm::VersionedXcm; + pub mod output { use super::runtime_types; - pub type OriginLocation = runtime_types::xcm::VersionedLocation; - pub type Xcm = runtime_types::xcm::VersionedXcm; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - runtime_types::xcm_runtime_apis::dry_run::XcmDryRunEffects< - runtime_types::rococo_runtime::RuntimeEvent, - >, - runtime_types::xcm_runtime_apis::dry_run::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct DryRunXcm { - pub origin_location: dry_run_xcm::OriginLocation, - pub xcm: dry_run_xcm::Xcm, + pub type Output = ::core::result::Result< + runtime_types::xcm_runtime_apis::dry_run::XcmDryRunEffects< + runtime_types::rococo_runtime::RuntimeEvent, + >, + runtime_types::xcm_runtime_apis::dry_run::Error, + >; } } } @@ -689,15 +560,15 @@ pub mod api { #[doc = " Converts `Location` to `AccountId`."] pub fn convert_location( &self, - location: types::convert_location::Location, + location: convert_location::Location, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ConvertLocation, - types::convert_location::output::Output, + (convert_location::Location,), + convert_location::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "LocationToAccountApi", "convert_location", - types::ConvertLocation { location }, + (location,), [ 179u8, 162u8, 1u8, 26u8, 111u8, 211u8, 90u8, 95u8, 137u8, 123u8, 87u8, 117u8, 40u8, 105u8, 246u8, 228u8, 103u8, 128u8, 236u8, 197u8, 187u8, @@ -707,32 +578,16 @@ pub mod api { ) } } - pub mod types { + pub mod convert_location { + use super::root_mod; use super::runtime_types; - pub mod convert_location { + pub type Location = runtime_types::xcm::VersionedLocation; + pub mod output { use super::runtime_types; - pub type Location = runtime_types::xcm::VersionedLocation; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::xcm_runtime_apis::conversions::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ConvertLocation { - pub location: convert_location::Location, + pub type Output = ::core::result::Result< + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::xcm_runtime_apis::conversions::Error, + >; } } } @@ -746,13 +601,13 @@ pub mod api { pub fn metadata( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::Metadata, - types::metadata::output::Output, + (), + metadata::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "Metadata", "metadata", - types::Metadata {}, + (), [ 231u8, 24u8, 67u8, 152u8, 23u8, 26u8, 188u8, 82u8, 229u8, 6u8, 185u8, 27u8, 175u8, 68u8, 83u8, 122u8, 69u8, 89u8, 185u8, 74u8, 248u8, 87u8, @@ -766,15 +621,15 @@ pub mod api { #[doc = " Use [`Self::metadata_versions`] to find out about supported metadata version of the runtime."] pub fn metadata_at_version( &self, - version: types::metadata_at_version::Version, + version: metadata_at_version::Version, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::MetadataAtVersion, - types::metadata_at_version::output::Output, + (metadata_at_version::Version,), + metadata_at_version::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "Metadata", "metadata_at_version", - types::MetadataAtVersion { version }, + (version,), [ 131u8, 53u8, 212u8, 234u8, 16u8, 25u8, 120u8, 252u8, 153u8, 153u8, 216u8, 28u8, 54u8, 113u8, 52u8, 236u8, 146u8, 68u8, 142u8, 8u8, 10u8, @@ -789,13 +644,13 @@ pub mod api { pub fn metadata_versions( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::MetadataVersions, - types::metadata_versions::output::Output, + (), + metadata_versions::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "Metadata", "metadata_versions", - types::MetadataVersions {}, + (), [ 23u8, 144u8, 137u8, 91u8, 188u8, 39u8, 231u8, 208u8, 252u8, 218u8, 224u8, 176u8, 77u8, 32u8, 130u8, 212u8, 223u8, 76u8, 100u8, 190u8, @@ -805,70 +660,32 @@ pub mod api { ) } } - pub mod types { + pub mod metadata { + use super::root_mod; use super::runtime_types; - pub mod metadata { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_core::OpaqueMetadata; - } + pub type Output = runtime_types::sp_core::OpaqueMetadata; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Metadata {} - pub mod metadata_at_version { + } + pub mod metadata_at_version { + use super::root_mod; + use super::runtime_types; + pub type Version = ::core::primitive::u32; + pub mod output { use super::runtime_types; - pub type Version = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = - ::core::option::Option; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct MetadataAtVersion { - pub version: metadata_at_version::Version, + pub type Output = + ::core::option::Option; } - pub mod metadata_versions { + } + pub mod metadata_versions { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u32>; - } + pub type Output = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u32>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct MetadataVersions {} } } pub mod block_builder { @@ -883,15 +700,15 @@ pub mod api { #[doc = " this block or not."] pub fn apply_extrinsic( &self, - extrinsic: types::apply_extrinsic::Extrinsic, + extrinsic: apply_extrinsic::Extrinsic, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ApplyExtrinsic, - types::apply_extrinsic::output::Output, + (apply_extrinsic::Extrinsic,), + apply_extrinsic::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BlockBuilder", "apply_extrinsic", - types::ApplyExtrinsic { extrinsic }, + (extrinsic,), [ 192u8, 184u8, 199u8, 4u8, 85u8, 136u8, 214u8, 205u8, 29u8, 29u8, 98u8, 145u8, 172u8, 92u8, 168u8, 161u8, 150u8, 133u8, 100u8, 243u8, 100u8, @@ -903,13 +720,13 @@ pub mod api { pub fn finalize_block( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::FinalizeBlock, - types::finalize_block::output::Output, + (), + finalize_block::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BlockBuilder", "finalize_block", - types::FinalizeBlock {}, + (), [ 244u8, 207u8, 24u8, 33u8, 13u8, 69u8, 9u8, 249u8, 145u8, 143u8, 122u8, 96u8, 197u8, 55u8, 64u8, 111u8, 238u8, 224u8, 34u8, 201u8, 27u8, 146u8, @@ -920,15 +737,15 @@ pub mod api { #[doc = " Generate inherent extrinsics. The inherent data will vary from chain to chain."] pub fn inherent_extrinsics( &self, - inherent: types::inherent_extrinsics::Inherent, + inherent: inherent_extrinsics::Inherent, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::InherentExtrinsics, - types::inherent_extrinsics::output::Output, + (inherent_extrinsics::Inherent,), + inherent_extrinsics::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BlockBuilder", "inherent_extrinsics", - types::InherentExtrinsics { inherent }, + (inherent,), [ 254u8, 110u8, 245u8, 201u8, 250u8, 192u8, 27u8, 228u8, 151u8, 213u8, 166u8, 89u8, 94u8, 81u8, 189u8, 234u8, 64u8, 18u8, 245u8, 80u8, 29u8, @@ -940,16 +757,16 @@ pub mod api { #[doc = " Check that the inherents are valid. The inherent data will vary from chain to chain."] pub fn check_inherents( &self, - block: types::check_inherents::Block, - data: types::check_inherents::Data, + block: check_inherents::Block, + data: check_inherents::Data, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CheckInherents, - types::check_inherents::output::Output, + (check_inherents::Block, check_inherents::Data), + check_inherents::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BlockBuilder", "check_inherents", - types::CheckInherents { block, data }, + (block, data), [ 153u8, 134u8, 1u8, 215u8, 139u8, 11u8, 53u8, 51u8, 210u8, 175u8, 197u8, 28u8, 38u8, 209u8, 175u8, 247u8, 142u8, 157u8, 50u8, 151u8, 164u8, @@ -959,96 +776,44 @@ pub mod api { ) } } - pub mod types { + pub mod apply_extrinsic { + use super::root_mod; use super::runtime_types; - pub mod apply_extrinsic { + pub type Extrinsic = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub mod output { use super::runtime_types; - pub type Extrinsic = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; - pub mod output { - use super::runtime_types; - pub type Output = :: core :: result :: Result < :: core :: result :: Result < () , runtime_types :: sp_runtime :: DispatchError > , runtime_types :: sp_runtime :: transaction_validity :: TransactionValidityError > ; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ApplyExtrinsic { - pub extrinsic: apply_extrinsic::Extrinsic, + pub type Output = ::core::result::Result< + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + runtime_types::sp_runtime::transaction_validity::TransactionValidityError, + >; } - pub mod finalize_block { + } + pub mod finalize_block { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - >; - } + pub type Output = + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct FinalizeBlock {} - pub mod inherent_extrinsics { + } + pub mod inherent_extrinsics { + use super::root_mod; + use super::runtime_types; + pub type Inherent = runtime_types::sp_inherents::InherentData; + pub mod output { use super::runtime_types; - pub type Inherent = runtime_types::sp_inherents::InherentData; - pub mod output { - use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct InherentExtrinsics { - pub inherent: inherent_extrinsics::Inherent, + pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; } - pub mod check_inherents { + } + pub mod check_inherents { + use super::root_mod; + use super::runtime_types; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; + pub type Data = runtime_types::sp_inherents::InherentData; + pub mod output { use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > > ; - pub type Data = runtime_types::sp_inherents::InherentData; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_inherents::CheckInherentsResult; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckInherents { - pub block: check_inherents::Block, - pub data: check_inherents::Data, + pub type Output = runtime_types::sp_inherents::CheckInherentsResult; } } } @@ -1069,21 +834,21 @@ pub mod api { #[doc = " might be verified in any possible order."] pub fn validate_transaction( &self, - source: types::validate_transaction::Source, - tx: types::validate_transaction::Tx, - block_hash: types::validate_transaction::BlockHash, + source: validate_transaction::Source, + tx: validate_transaction::Tx, + block_hash: validate_transaction::BlockHash, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ValidateTransaction, - types::validate_transaction::output::Output, + ( + validate_transaction::Source, + validate_transaction::Tx, + validate_transaction::BlockHash, + ), + validate_transaction::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "TaggedTransactionQueue", "validate_transaction", - types::ValidateTransaction { - source, - tx, - block_hash, - }, + (source, tx, block_hash), [ 19u8, 53u8, 170u8, 115u8, 75u8, 121u8, 231u8, 50u8, 199u8, 181u8, 243u8, 170u8, 163u8, 224u8, 213u8, 134u8, 206u8, 207u8, 88u8, 242u8, @@ -1093,34 +858,19 @@ pub mod api { ) } } - pub mod types { + pub mod validate_transaction { + use super::root_mod; use super::runtime_types; - pub mod validate_transaction { + pub type Source = + runtime_types::sp_runtime::transaction_validity::TransactionSource; + pub type Tx = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub type BlockHash = ::subxt::ext::subxt_core::utils::H256; + pub mod output { use super::runtime_types; - pub type Source = - runtime_types::sp_runtime::transaction_validity::TransactionSource; - pub type Tx = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; - pub type BlockHash = ::subxt::ext::subxt_core::utils::H256; - pub mod output { - use super::runtime_types; - pub type Output = :: core :: result :: Result < runtime_types :: sp_runtime :: transaction_validity :: ValidTransaction , runtime_types :: sp_runtime :: transaction_validity :: TransactionValidityError > ; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidateTransaction { - pub source: validate_transaction::Source, - pub tx: validate_transaction::Tx, - pub block_hash: validate_transaction::BlockHash, + pub type Output = ::core::result::Result< + runtime_types::sp_runtime::transaction_validity::ValidTransaction, + runtime_types::sp_runtime::transaction_validity::TransactionValidityError, + >; } } } @@ -1133,15 +883,15 @@ pub mod api { #[doc = " Starts the off-chain task for given block header."] pub fn offchain_worker( &self, - header: types::offchain_worker::Header, + header: offchain_worker::Header, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::OffchainWorker, - types::offchain_worker::output::Output, + (offchain_worker::Header,), + offchain_worker::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "OffchainWorkerApi", "offchain_worker", - types::OffchainWorker { header }, + (header,), [ 10u8, 135u8, 19u8, 153u8, 33u8, 216u8, 18u8, 242u8, 33u8, 140u8, 4u8, 223u8, 200u8, 130u8, 103u8, 118u8, 137u8, 24u8, 19u8, 127u8, 161u8, @@ -1150,30 +900,14 @@ pub mod api { ) } } - pub mod types { + pub mod offchain_worker { + use super::root_mod; use super::runtime_types; - pub mod offchain_worker { + pub type Header = + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub mod output { use super::runtime_types; - pub type Header = - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; - pub mod output { - use super::runtime_types; - pub type Output = (); - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct OffchainWorker { - pub header: offchain_worker::Header, + pub type Output = (); } } } @@ -1187,13 +921,13 @@ pub mod api { pub fn validators( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::Validators, - types::validators::output::Output, + (), + validators::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "validators", - types::Validators {}, + (), [ 203u8, 103u8, 117u8, 19u8, 54u8, 45u8, 218u8, 47u8, 46u8, 93u8, 221u8, 120u8, 188u8, 43u8, 183u8, 253u8, 108u8, 177u8, 242u8, 168u8, 97u8, @@ -1208,13 +942,13 @@ pub mod api { pub fn validator_groups( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ValidatorGroups, - types::validator_groups::output::Output, + (), + validator_groups::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "validator_groups", - types::ValidatorGroups {}, + (), [ 89u8, 221u8, 163u8, 73u8, 194u8, 196u8, 136u8, 242u8, 249u8, 182u8, 239u8, 251u8, 157u8, 211u8, 41u8, 58u8, 242u8, 242u8, 177u8, 145u8, @@ -1228,13 +962,13 @@ pub mod api { pub fn availability_cores( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::AvailabilityCores, - types::availability_cores::output::Output, + (), + availability_cores::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "availability_cores", - types::AvailabilityCores {}, + (), [ 248u8, 76u8, 100u8, 121u8, 84u8, 19u8, 48u8, 44u8, 98u8, 25u8, 99u8, 197u8, 237u8, 132u8, 142u8, 115u8, 99u8, 129u8, 87u8, 142u8, 86u8, @@ -1249,19 +983,19 @@ pub mod api { #[doc = " and the para already occupies a core."] pub fn persisted_validation_data( &self, - para_id: types::persisted_validation_data::ParaId, - assumption: types::persisted_validation_data::Assumption, + para_id: persisted_validation_data::ParaId, + assumption: persisted_validation_data::Assumption, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::PersistedValidationData, - types::persisted_validation_data::output::Output, + ( + persisted_validation_data::ParaId, + persisted_validation_data::Assumption, + ), + persisted_validation_data::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "persisted_validation_data", - types::PersistedValidationData { - para_id, - assumption, - }, + (para_id, assumption), [ 119u8, 217u8, 57u8, 241u8, 70u8, 56u8, 102u8, 20u8, 98u8, 60u8, 47u8, 78u8, 124u8, 81u8, 158u8, 254u8, 30u8, 14u8, 223u8, 195u8, 95u8, 179u8, @@ -1274,19 +1008,19 @@ pub mod api { #[doc = " data hash against an expected one and yields `None` if they're not equal."] pub fn assumed_validation_data( &self, - para_id: types::assumed_validation_data::ParaId, - expected_persisted_validation_data_hash : types :: assumed_validation_data :: ExpectedPersistedValidationDataHash, + para_id: assumed_validation_data::ParaId, + expected_persisted_validation_data_hash : assumed_validation_data :: ExpectedPersistedValidationDataHash, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::AssumedValidationData, - types::assumed_validation_data::output::Output, + ( + assumed_validation_data::ParaId, + assumed_validation_data::ExpectedPersistedValidationDataHash, + ), + assumed_validation_data::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "assumed_validation_data", - types::AssumedValidationData { - para_id, - expected_persisted_validation_data_hash, - }, + (para_id, expected_persisted_validation_data_hash), [ 37u8, 162u8, 100u8, 72u8, 19u8, 135u8, 13u8, 211u8, 51u8, 153u8, 201u8, 97u8, 61u8, 193u8, 167u8, 118u8, 60u8, 242u8, 228u8, 81u8, 165u8, 62u8, @@ -1297,16 +1031,19 @@ pub mod api { #[doc = " Checks if the given validation outputs pass the acceptance criteria."] pub fn check_validation_outputs( &self, - para_id: types::check_validation_outputs::ParaId, - outputs: types::check_validation_outputs::Outputs, + para_id: check_validation_outputs::ParaId, + outputs: check_validation_outputs::Outputs, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CheckValidationOutputs, - types::check_validation_outputs::output::Output, + ( + check_validation_outputs::ParaId, + check_validation_outputs::Outputs, + ), + check_validation_outputs::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "check_validation_outputs", - types::CheckValidationOutputs { para_id, outputs }, + (para_id, outputs), [ 128u8, 33u8, 213u8, 120u8, 39u8, 18u8, 135u8, 248u8, 196u8, 43u8, 0u8, 143u8, 198u8, 64u8, 93u8, 133u8, 248u8, 206u8, 103u8, 137u8, 168u8, @@ -1321,13 +1058,13 @@ pub mod api { pub fn session_index_for_child( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SessionIndexForChild, - types::session_index_for_child::output::Output, + (), + session_index_for_child::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "session_index_for_child", - types::SessionIndexForChild {}, + (), [ 135u8, 9u8, 1u8, 244u8, 174u8, 151u8, 247u8, 75u8, 226u8, 216u8, 53u8, 78u8, 26u8, 109u8, 44u8, 77u8, 208u8, 151u8, 94u8, 212u8, 115u8, 43u8, @@ -1341,19 +1078,16 @@ pub mod api { #[doc = " and the para already occupies a core."] pub fn validation_code( &self, - para_id: types::validation_code::ParaId, - assumption: types::validation_code::Assumption, + para_id: validation_code::ParaId, + assumption: validation_code::Assumption, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ValidationCode, - types::validation_code::output::Output, + (validation_code::ParaId, validation_code::Assumption), + validation_code::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "validation_code", - types::ValidationCode { - para_id, - assumption, - }, + (para_id, assumption), [ 231u8, 15u8, 35u8, 159u8, 96u8, 23u8, 246u8, 125u8, 78u8, 79u8, 158u8, 116u8, 36u8, 199u8, 53u8, 61u8, 242u8, 136u8, 227u8, 174u8, 136u8, @@ -1366,15 +1100,15 @@ pub mod api { #[doc = " assigned to occupied cores in `availability_cores` and `None` otherwise."] pub fn candidate_pending_availability( &self, - para_id: types::candidate_pending_availability::ParaId, + para_id: candidate_pending_availability::ParaId, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CandidatePendingAvailability, - types::candidate_pending_availability::output::Output, + (candidate_pending_availability::ParaId,), + candidate_pending_availability::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "candidate_pending_availability", - types::CandidatePendingAvailability { para_id }, + (para_id,), [ 5u8, 222u8, 210u8, 254u8, 202u8, 124u8, 140u8, 134u8, 200u8, 175u8, 238u8, 166u8, 204u8, 234u8, 13u8, 223u8, 41u8, 239u8, 249u8, 251u8, @@ -1387,13 +1121,13 @@ pub mod api { pub fn candidate_events( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CandidateEvents, - types::candidate_events::output::Output, + (), + candidate_events::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "candidate_events", - types::CandidateEvents {}, + (), [ 59u8, 132u8, 90u8, 69u8, 245u8, 2u8, 251u8, 196u8, 129u8, 37u8, 96u8, 108u8, 1u8, 123u8, 31u8, 198u8, 17u8, 34u8, 215u8, 205u8, 211u8, 69u8, @@ -1404,15 +1138,15 @@ pub mod api { #[doc = " Get all the pending inbound messages in the downward message queue for a para."] pub fn dmq_contents( &self, - recipient: types::dmq_contents::Recipient, + recipient: dmq_contents::Recipient, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::DmqContents, - types::dmq_contents::output::Output, + (dmq_contents::Recipient,), + dmq_contents::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "dmq_contents", - types::DmqContents { recipient }, + (recipient,), [ 189u8, 11u8, 38u8, 223u8, 11u8, 108u8, 201u8, 122u8, 207u8, 7u8, 74u8, 14u8, 247u8, 226u8, 108u8, 21u8, 213u8, 55u8, 8u8, 137u8, 211u8, 98u8, @@ -1424,15 +1158,15 @@ pub mod api { #[doc = " messages in them are also included."] pub fn inbound_hrmp_channels_contents( &self, - recipient: types::inbound_hrmp_channels_contents::Recipient, + recipient: inbound_hrmp_channels_contents::Recipient, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::InboundHrmpChannelsContents, - types::inbound_hrmp_channels_contents::output::Output, + (inbound_hrmp_channels_contents::Recipient,), + inbound_hrmp_channels_contents::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "inbound_hrmp_channels_contents", - types::InboundHrmpChannelsContents { recipient }, + (recipient,), [ 132u8, 29u8, 42u8, 39u8, 72u8, 243u8, 110u8, 43u8, 110u8, 9u8, 21u8, 18u8, 91u8, 40u8, 231u8, 223u8, 239u8, 16u8, 110u8, 54u8, 108u8, 234u8, @@ -1443,15 +1177,15 @@ pub mod api { #[doc = " Get the validation code from its hash."] pub fn validation_code_by_hash( &self, - hash: types::validation_code_by_hash::Hash, + hash: validation_code_by_hash::Hash, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ValidationCodeByHash, - types::validation_code_by_hash::output::Output, + (validation_code_by_hash::Hash,), + validation_code_by_hash::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "validation_code_by_hash", - types::ValidationCodeByHash { hash }, + (hash,), [ 219u8, 250u8, 130u8, 89u8, 178u8, 234u8, 255u8, 33u8, 90u8, 78u8, 58u8, 124u8, 141u8, 145u8, 156u8, 81u8, 184u8, 52u8, 65u8, 112u8, 35u8, @@ -1464,13 +1198,13 @@ pub mod api { pub fn on_chain_votes( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::OnChainVotes, - types::on_chain_votes::output::Output, + (), + on_chain_votes::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "on_chain_votes", - types::OnChainVotes {}, + (), [ 99u8, 230u8, 154u8, 62u8, 250u8, 68u8, 207u8, 243u8, 195u8, 239u8, 46u8, 7u8, 56u8, 222u8, 74u8, 95u8, 14u8, 199u8, 0u8, 200u8, 162u8, @@ -1483,15 +1217,15 @@ pub mod api { #[doc = " NOTE: This function is only available since parachain host version 2."] pub fn session_info( &self, - index: types::session_info::Index, + index: session_info::Index, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SessionInfo, - types::session_info::output::Output, + (session_info::Index,), + session_info::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "session_info", - types::SessionInfo { index }, + (index,), [ 109u8, 63u8, 65u8, 75u8, 87u8, 156u8, 145u8, 106u8, 214u8, 111u8, 24u8, 111u8, 229u8, 171u8, 147u8, 148u8, 51u8, 80u8, 156u8, 94u8, 49u8, @@ -1504,16 +1238,19 @@ pub mod api { #[doc = " NOTE: This function is only available since parachain host version 2."] pub fn submit_pvf_check_statement( &self, - stmt: types::submit_pvf_check_statement::Stmt, - signature: types::submit_pvf_check_statement::Signature, + stmt: submit_pvf_check_statement::Stmt, + signature: submit_pvf_check_statement::Signature, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SubmitPvfCheckStatement, - types::submit_pvf_check_statement::output::Output, + ( + submit_pvf_check_statement::Stmt, + submit_pvf_check_statement::Signature, + ), + submit_pvf_check_statement::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "submit_pvf_check_statement", - types::SubmitPvfCheckStatement { stmt, signature }, + (stmt, signature), [ 10u8, 97u8, 0u8, 72u8, 221u8, 159u8, 123u8, 113u8, 166u8, 212u8, 213u8, 173u8, 250u8, 217u8, 54u8, 27u8, 120u8, 76u8, 219u8, 71u8, 28u8, 213u8, @@ -1527,13 +1264,13 @@ pub mod api { pub fn pvfs_require_precheck( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::PvfsRequirePrecheck, - types::pvfs_require_precheck::output::Output, + (), + pvfs_require_precheck::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "pvfs_require_precheck", - types::PvfsRequirePrecheck {}, + (), [ 251u8, 162u8, 214u8, 223u8, 70u8, 67u8, 170u8, 19u8, 191u8, 37u8, 233u8, 249u8, 89u8, 28u8, 76u8, 213u8, 194u8, 28u8, 15u8, 199u8, 167u8, @@ -1546,19 +1283,19 @@ pub mod api { #[doc = " NOTE: This function is only available since parachain host version 2."] pub fn validation_code_hash( &self, - para_id: types::validation_code_hash::ParaId, - assumption: types::validation_code_hash::Assumption, + para_id: validation_code_hash::ParaId, + assumption: validation_code_hash::Assumption, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ValidationCodeHash, - types::validation_code_hash::output::Output, + ( + validation_code_hash::ParaId, + validation_code_hash::Assumption, + ), + validation_code_hash::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "validation_code_hash", - types::ValidationCodeHash { - para_id, - assumption, - }, + (para_id, assumption), [ 226u8, 142u8, 121u8, 182u8, 206u8, 180u8, 8u8, 19u8, 237u8, 84u8, 121u8, 1u8, 126u8, 211u8, 241u8, 133u8, 195u8, 182u8, 116u8, 128u8, @@ -1571,13 +1308,13 @@ pub mod api { pub fn disputes( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::Disputes, - types::disputes::output::Output, + (), + disputes::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "disputes", - types::Disputes {}, + (), [ 183u8, 88u8, 143u8, 44u8, 138u8, 79u8, 65u8, 198u8, 42u8, 109u8, 235u8, 152u8, 3u8, 13u8, 106u8, 189u8, 197u8, 126u8, 44u8, 161u8, 67u8, 49u8, @@ -1588,15 +1325,15 @@ pub mod api { #[doc = " Returns execution parameters for the session."] pub fn session_executor_params( &self, - session_index: types::session_executor_params::SessionIndex, + session_index: session_executor_params::SessionIndex, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SessionExecutorParams, - types::session_executor_params::output::Output, + (session_executor_params::SessionIndex,), + session_executor_params::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "session_executor_params", - types::SessionExecutorParams { session_index }, + (session_index,), [ 94u8, 35u8, 29u8, 188u8, 247u8, 116u8, 165u8, 43u8, 248u8, 76u8, 21u8, 237u8, 26u8, 25u8, 105u8, 27u8, 24u8, 245u8, 97u8, 25u8, 47u8, 118u8, @@ -1610,13 +1347,13 @@ pub mod api { pub fn unapplied_slashes( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::UnappliedSlashes, - types::unapplied_slashes::output::Output, + (), + unapplied_slashes::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "unapplied_slashes", - types::UnappliedSlashes {}, + (), [ 37u8, 39u8, 110u8, 177u8, 177u8, 107u8, 186u8, 189u8, 36u8, 252u8, 88u8, 92u8, 92u8, 3u8, 118u8, 28u8, 72u8, 180u8, 56u8, 113u8, 168u8, @@ -1628,15 +1365,15 @@ pub mod api { #[doc = " NOTE: This function is only available since parachain host version 5."] pub fn key_ownership_proof( &self, - validator_id: types::key_ownership_proof::ValidatorId, + validator_id: key_ownership_proof::ValidatorId, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::KeyOwnershipProof, - types::key_ownership_proof::output::Output, + (key_ownership_proof::ValidatorId,), + key_ownership_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "key_ownership_proof", - types::KeyOwnershipProof { validator_id }, + (validator_id,), [ 75u8, 218u8, 234u8, 239u8, 79u8, 135u8, 77u8, 217u8, 172u8, 222u8, 123u8, 195u8, 0u8, 79u8, 68u8, 22u8, 143u8, 185u8, 45u8, 209u8, 235u8, @@ -1649,19 +1386,19 @@ pub mod api { #[doc = " NOTE: This function is only available since parachain host version 5."] pub fn submit_report_dispute_lost( &self, - dispute_proof: types::submit_report_dispute_lost::DisputeProof, - key_ownership_proof: types::submit_report_dispute_lost::KeyOwnershipProof, + dispute_proof: submit_report_dispute_lost::DisputeProof, + key_ownership_proof: submit_report_dispute_lost::KeyOwnershipProof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SubmitReportDisputeLost, - types::submit_report_dispute_lost::output::Output, + ( + submit_report_dispute_lost::DisputeProof, + submit_report_dispute_lost::KeyOwnershipProof, + ), + submit_report_dispute_lost::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "submit_report_dispute_lost", - types::SubmitReportDisputeLost { - dispute_proof, - key_ownership_proof, - }, + (dispute_proof, key_ownership_proof), [ 45u8, 113u8, 10u8, 123u8, 99u8, 13u8, 212u8, 56u8, 6u8, 231u8, 237u8, 165u8, 225u8, 217u8, 162u8, 250u8, 6u8, 119u8, 20u8, 238u8, 243u8, @@ -1675,13 +1412,13 @@ pub mod api { pub fn minimum_backing_votes( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::MinimumBackingVotes, - types::minimum_backing_votes::output::Output, + (), + minimum_backing_votes::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "minimum_backing_votes", - types::MinimumBackingVotes {}, + (), [ 222u8, 75u8, 167u8, 245u8, 183u8, 148u8, 14u8, 92u8, 54u8, 164u8, 239u8, 183u8, 215u8, 170u8, 133u8, 71u8, 19u8, 131u8, 104u8, 28u8, @@ -1693,17 +1430,15 @@ pub mod api { #[doc = " Returns the state of parachain backing for a given para."] pub fn para_backing_state( &self, - runtime_api_generated_name_0__ : types :: para_backing_state :: RuntimeApiGeneratedName0, + runtime_api_generated_name_0__: para_backing_state::RuntimeApiGeneratedName0, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ParaBackingState, - types::para_backing_state::output::Output, + (para_backing_state::RuntimeApiGeneratedName0,), + para_backing_state::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "para_backing_state", - types::ParaBackingState { - runtime_api_generated_name_0__, - }, + (runtime_api_generated_name_0__,), [ 118u8, 209u8, 220u8, 78u8, 25u8, 237u8, 127u8, 120u8, 164u8, 105u8, 148u8, 69u8, 247u8, 63u8, 169u8, 54u8, 239u8, 191u8, 136u8, 33u8, @@ -1716,13 +1451,13 @@ pub mod api { pub fn async_backing_params( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::AsyncBackingParams, - types::async_backing_params::output::Output, + (), + async_backing_params::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "async_backing_params", - types::AsyncBackingParams {}, + (), [ 150u8, 157u8, 193u8, 44u8, 160u8, 18u8, 122u8, 188u8, 157u8, 84u8, 202u8, 253u8, 55u8, 113u8, 188u8, 169u8, 216u8, 250u8, 145u8, 81u8, @@ -1735,13 +1470,13 @@ pub mod api { pub fn disabled_validators( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::DisabledValidators, - types::disabled_validators::output::Output, + (), + disabled_validators::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "disabled_validators", - types::DisabledValidators {}, + (), [ 121u8, 124u8, 228u8, 59u8, 10u8, 148u8, 131u8, 130u8, 221u8, 33u8, 226u8, 13u8, 223u8, 67u8, 145u8, 39u8, 205u8, 237u8, 178u8, 249u8, @@ -1755,13 +1490,13 @@ pub mod api { pub fn node_features( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::NodeFeatures, - types::node_features::output::Output, + (), + node_features::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "node_features", - types::NodeFeatures {}, + (), [ 94u8, 110u8, 38u8, 62u8, 66u8, 234u8, 216u8, 228u8, 36u8, 17u8, 33u8, 56u8, 184u8, 122u8, 34u8, 254u8, 46u8, 62u8, 107u8, 227u8, 3u8, 126u8, @@ -1773,13 +1508,13 @@ pub mod api { pub fn approval_voting_params( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ApprovalVotingParams, - types::approval_voting_params::output::Output, + (), + approval_voting_params::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "approval_voting_params", - types::ApprovalVotingParams {}, + (), [ 89u8, 130u8, 95u8, 58u8, 124u8, 176u8, 43u8, 109u8, 222u8, 178u8, 241u8, 177u8, 242u8, 32u8, 84u8, 22u8, 252u8, 178u8, 168u8, 17u8, 38u8, @@ -1792,13 +1527,13 @@ pub mod api { pub fn claim_queue( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ClaimQueue, - types::claim_queue::output::Output, + (), + claim_queue::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "claim_queue", - types::ClaimQueue {}, + (), [ 43u8, 105u8, 112u8, 222u8, 33u8, 252u8, 194u8, 53u8, 104u8, 185u8, 210u8, 179u8, 95u8, 149u8, 44u8, 86u8, 70u8, 202u8, 154u8, 196u8, @@ -1810,15 +1545,15 @@ pub mod api { #[doc = " Elastic scaling support"] pub fn candidates_pending_availability( &self, - para_id: types::candidates_pending_availability::ParaId, + para_id: candidates_pending_availability::ParaId, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CandidatesPendingAvailability, - types::candidates_pending_availability::output::Output, + (candidates_pending_availability::ParaId,), + candidates_pending_availability::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "candidates_pending_availability", - types::CandidatesPendingAvailability { para_id }, + (para_id,), [ 46u8, 67u8, 45u8, 132u8, 116u8, 96u8, 3u8, 211u8, 116u8, 4u8, 64u8, 158u8, 227u8, 134u8, 205u8, 127u8, 139u8, 111u8, 54u8, 141u8, 44u8, @@ -1830,13 +1565,13 @@ pub mod api { pub fn validation_code_bomb_limit( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ValidationCodeBombLimit, - types::validation_code_bomb_limit::output::Output, + (), + validation_code_bomb_limit::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "validation_code_bomb_limit", - types::ValidationCodeBombLimit {}, + (), [ 87u8, 223u8, 184u8, 180u8, 216u8, 213u8, 191u8, 201u8, 250u8, 22u8, 169u8, 184u8, 114u8, 220u8, 151u8, 57u8, 105u8, 160u8, 19u8, 105u8, @@ -1849,15 +1584,15 @@ pub mod api { #[doc = " block."] pub fn backing_constraints( &self, - para_id: types::backing_constraints::ParaId, + para_id: backing_constraints::ParaId, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::BackingConstraints, - types::backing_constraints::output::Output, + (backing_constraints::ParaId,), + backing_constraints::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "backing_constraints", - types::BackingConstraints { para_id }, + (para_id,), [ 235u8, 42u8, 54u8, 27u8, 171u8, 123u8, 224u8, 238u8, 189u8, 84u8, 82u8, 173u8, 140u8, 129u8, 211u8, 21u8, 134u8, 19u8, 95u8, 222u8, 97u8, @@ -1869,13 +1604,13 @@ pub mod api { pub fn scheduling_lookahead( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SchedulingLookahead, - types::scheduling_lookahead::output::Output, + (), + scheduling_lookahead::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "scheduling_lookahead", - types::SchedulingLookahead {}, + (), [ 7u8, 201u8, 159u8, 91u8, 6u8, 85u8, 165u8, 75u8, 113u8, 185u8, 122u8, 238u8, 207u8, 238u8, 9u8, 154u8, 57u8, 151u8, 63u8, 211u8, 149u8, @@ -1888,13 +1623,13 @@ pub mod api { pub fn para_ids( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ParaIds, - types::para_ids::output::Output, + (), + para_ids::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "para_ids", - types::ParaIds {}, + (), [ 86u8, 10u8, 236u8, 98u8, 133u8, 52u8, 231u8, 83u8, 141u8, 12u8, 226u8, 48u8, 104u8, 239u8, 177u8, 89u8, 202u8, 221u8, 170u8, 127u8, 19u8, @@ -1907,13 +1642,13 @@ pub mod api { pub fn unapplied_slashes_v2( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::UnappliedSlashesV2, - types::unapplied_slashes_v2::output::Output, + (), + unapplied_slashes_v2::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "ParachainHost", "unapplied_slashes_v2", - types::UnappliedSlashesV2 {}, + (), [ 59u8, 242u8, 7u8, 62u8, 162u8, 16u8, 216u8, 73u8, 47u8, 18u8, 125u8, 146u8, 231u8, 203u8, 34u8, 53u8, 238u8, 12u8, 70u8, 105u8, 5u8, 89u8, @@ -1922,860 +1657,422 @@ pub mod api { ) } } - pub mod types { + pub mod validators { + use super::root_mod; use super::runtime_types; - pub mod validators { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::validator_app::Public, - >; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::validator_app::Public, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Validators {} - pub mod validator_groups { + } + pub mod validator_groups { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ( + pub type Output = ( + ::subxt::ext::subxt_core::alloc::vec::Vec< ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >, - >, - runtime_types::polkadot_primitives::v9::GroupRotationInfo< - ::core::primitive::u32, + runtime_types::polkadot_primitives::v9::ValidatorIndex, >, - ); - } + >, + runtime_types::polkadot_primitives::v9::GroupRotationInfo< + ::core::primitive::u32, + >, + ); } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidatorGroups {} - pub mod availability_cores { + } + pub mod availability_cores { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::CoreState< - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >, - >; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::CoreState< + ::subxt::ext::subxt_core::utils::H256, + ::core::primitive::u32, + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AvailabilityCores {} - pub mod persisted_validation_data { + } + pub mod persisted_validation_data { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Assumption = + runtime_types::polkadot_primitives::v9::OccupiedCoreAssumption; + pub mod output { use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Assumption = - runtime_types::polkadot_primitives::v9::OccupiedCoreAssumption; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::polkadot_primitives::v9::PersistedValidationData< - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >, - >; - } + pub type Output = ::core::option::Option< + runtime_types::polkadot_primitives::v9::PersistedValidationData< + ::subxt::ext::subxt_core::utils::H256, + ::core::primitive::u32, + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct PersistedValidationData { - pub para_id: persisted_validation_data::ParaId, - pub assumption: persisted_validation_data::Assumption, + } + pub mod assumed_validation_data { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type ExpectedPersistedValidationDataHash = + ::subxt::ext::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = :: core :: option :: Option < (runtime_types :: polkadot_primitives :: v9 :: PersistedValidationData < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > , runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ,) > ; } - pub mod assumed_validation_data { + } + pub mod check_validation_outputs { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Outputs = runtime_types::polkadot_primitives::v9::CandidateCommitments< + ::core::primitive::u32, + >; + pub mod output { use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type ExpectedPersistedValidationDataHash = - ::subxt::ext::subxt_core::utils::H256; - pub mod output { - use super::runtime_types; - pub type Output = :: core :: option :: Option < (runtime_types :: polkadot_primitives :: v9 :: PersistedValidationData < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > , runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ,) > ; - } + pub type Output = ::core::primitive::bool; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AssumedValidationData { - pub para_id: assumed_validation_data::ParaId, - pub expected_persisted_validation_data_hash: - assumed_validation_data::ExpectedPersistedValidationDataHash, + } + pub mod session_index_for_child { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; } - pub mod check_validation_outputs { + } + pub mod validation_code { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Assumption = + runtime_types::polkadot_primitives::v9::OccupiedCoreAssumption; + pub mod output { use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Outputs = runtime_types::polkadot_primitives::v9::CandidateCommitments< - ::core::primitive::u32, + pub type Output = ::core::option::Option< + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode, >; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::bool; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckValidationOutputs { - pub para_id: check_validation_outputs::ParaId, - pub outputs: check_validation_outputs::Outputs, } - pub mod session_index_for_child { + } + pub mod candidate_pending_availability { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u32; - } + pub type Output = ::core::option::Option< + runtime_types::polkadot_primitives::v9::CommittedCandidateReceiptV2< + ::subxt::ext::subxt_core::utils::H256, + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SessionIndexForChild {} - pub mod validation_code { + } + pub mod candidate_events { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Assumption = - runtime_types::polkadot_primitives::v9::OccupiedCoreAssumption; - pub mod output { - use super::runtime_types; - pub type Output = :: core :: option :: Option < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode > ; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::CandidateEvent< + ::subxt::ext::subxt_core::utils::H256, + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidationCode { - pub para_id: validation_code::ParaId, - pub assumption: validation_code::Assumption, + } + pub mod dmq_contents { + use super::root_mod; + use super::runtime_types; + pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::InboundDownwardMessage< + ::core::primitive::u32, + >, + >; } - pub mod candidate_pending_availability { + } + pub mod inbound_hrmp_channels_contents { + use super::root_mod; + use super::runtime_types; + pub type Recipient = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::polkadot_primitives::v9::CommittedCandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, + pub type Output = ::subxt::ext::subxt_core::utils::KeyedVec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::primitive::u32, >, - >; - } + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CandidatePendingAvailability { - pub para_id: candidate_pending_availability::ParaId, + } + pub mod validation_code_by_hash { + use super::root_mod; + use super::runtime_types; + pub type Hash = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode, + >; } - pub mod candidate_events { + } + pub mod on_chain_votes { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::CandidateEvent< - ::subxt::ext::subxt_core::utils::H256, - >, - >; - } + pub type Output = ::core::option::Option< + runtime_types::polkadot_primitives::v9::ScrapedOnChainVotes< + ::subxt::ext::subxt_core::utils::H256, + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CandidateEvents {} - pub mod dmq_contents { + } + pub mod session_info { + use super::root_mod; + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub mod output { use super::runtime_types; - pub type Recipient = - runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >; - } + pub type Output = + ::core::option::Option; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct DmqContents { - pub recipient: dmq_contents::Recipient, + } + pub mod submit_pvf_check_statement { + use super::root_mod; + use super::runtime_types; + pub type Stmt = runtime_types::polkadot_primitives::v9::PvfCheckStatement; + pub type Signature = + runtime_types::polkadot_primitives::v9::validator_app::Signature; + pub mod output { + use super::runtime_types; + pub type Output = (); } - pub mod inbound_hrmp_channels_contents { + } + pub mod pvfs_require_precheck { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type Recipient = - runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::KeyedVec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, - >, - >, - >; - } + pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct InboundHrmpChannelsContents { - pub recipient: inbound_hrmp_channels_contents::Recipient, + } + pub mod validation_code_hash { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Assumption = + runtime_types::polkadot_primitives::v9::OccupiedCoreAssumption; + pub mod output { + use super::runtime_types; + pub type Output = :: core :: option :: Option < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; } - pub mod validation_code_by_hash { + } + pub mod disputes { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type Hash = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - pub mod output { - use super::runtime_types; - pub type Output = :: core :: option :: Option < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCode > ; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::polkadot_core_primitives::CandidateHash, + runtime_types::polkadot_primitives::v9::DisputeState< + ::core::primitive::u32, + >, + )>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidationCodeByHash { - pub hash: validation_code_by_hash::Hash, + } + pub mod session_executor_params { + use super::root_mod; + use super::runtime_types; + pub type SessionIndex = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams, + >; } - pub mod on_chain_votes { + } + pub mod unapplied_slashes { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::polkadot_primitives::v9::ScrapedOnChainVotes< - ::subxt::ext::subxt_core::utils::H256, - >, - >; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::polkadot_core_primitives::CandidateHash, + runtime_types::polkadot_primitives::v9::slashing::LegacyPendingSlashes, + )>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct OnChainVotes {} - pub mod session_info { + } + pub mod key_ownership_proof { + use super::root_mod; + use super::runtime_types; + pub type ValidatorId = + runtime_types::polkadot_primitives::v9::validator_app::Public; + pub mod output { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::polkadot_primitives::v9::SessionInfo, - >; - } + pub type Output = ::core::option::Option< + runtime_types::polkadot_primitives::v9::slashing::OpaqueKeyOwnershipProof, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SessionInfo { - pub index: session_info::Index, + } + pub mod submit_report_dispute_lost { + use super::root_mod; + use super::runtime_types; + pub type DisputeProof = + runtime_types::polkadot_primitives::v9::slashing::DisputeProof; + pub type KeyOwnershipProof = + runtime_types::polkadot_primitives::v9::slashing::OpaqueKeyOwnershipProof; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option<()>; } - pub mod submit_pvf_check_statement { + } + pub mod minimum_backing_votes { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type Stmt = runtime_types::polkadot_primitives::v9::PvfCheckStatement; - pub type Signature = - runtime_types::polkadot_primitives::v9::validator_app::Signature; - pub mod output { - use super::runtime_types; - pub type Output = (); - } + pub type Output = ::core::primitive::u32; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SubmitPvfCheckStatement { - pub stmt: submit_pvf_check_statement::Stmt, - pub signature: submit_pvf_check_statement::Signature, + } + pub mod para_backing_state { + use super::root_mod; + use super::runtime_types; + pub type RuntimeApiGeneratedName0 = + runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::polkadot_primitives::v9::async_backing::BackingState< + ::subxt::ext::subxt_core::utils::H256, + ::core::primitive::u32, + >, + >; } - pub mod pvfs_require_precheck { + } + pub mod async_backing_params { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; - } + pub type Output = + runtime_types::polkadot_primitives::v9::async_backing::AsyncBackingParams; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct PvfsRequirePrecheck {} - pub mod validation_code_hash { + } + pub mod disabled_validators { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Assumption = - runtime_types::polkadot_primitives::v9::OccupiedCoreAssumption; - pub mod output { - use super::runtime_types; - pub type Output = :: core :: option :: Option < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::ValidatorIndex, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidationCodeHash { - pub para_id: validation_code_hash::ParaId, - pub assumption: validation_code_hash::Assumption, + } + pub mod node_features { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::bits::DecodedBits< + ::core::primitive::u8, + ::subxt::ext::subxt_core::utils::bits::Lsb0, + >; } - pub mod disputes { + } + pub mod approval_voting_params { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - runtime_types::polkadot_core_primitives::CandidateHash, - runtime_types::polkadot_primitives::v9::DisputeState< - ::core::primitive::u32, - >, - )>; - } + pub type Output = runtime_types::polkadot_primitives::v9::ApprovalVotingParams; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Disputes {} - pub mod session_executor_params { + } + pub mod claim_queue { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type SessionIndex = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams, - >; - } + pub type Output = ::subxt::ext::subxt_core::utils::KeyedVec< + runtime_types::polkadot_primitives::v9::CoreIndex, + ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SessionExecutorParams { - pub session_index: session_executor_params::SessionIndex, + } + pub mod candidates_pending_availability { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::CommittedCandidateReceiptV2< + ::subxt::ext::subxt_core::utils::H256, + >, + >; } - pub mod unapplied_slashes { + } + pub mod validation_code_bomb_limit { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - runtime_types::polkadot_core_primitives::CandidateHash, - runtime_types::polkadot_primitives::v9::slashing::LegacyPendingSlashes, - )>; - } + pub type Output = ::core::primitive::u32; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct UnappliedSlashes {} - pub mod key_ownership_proof { - use super::runtime_types; - pub type ValidatorId = - runtime_types::polkadot_primitives::v9::validator_app::Public; - pub mod output { - use super::runtime_types; - pub type Output = :: core :: option :: Option < runtime_types :: polkadot_primitives :: v9 :: slashing :: OpaqueKeyOwnershipProof > ; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct KeyOwnershipProof { - pub validator_id: key_ownership_proof::ValidatorId, - } - pub mod submit_report_dispute_lost { - use super::runtime_types; - pub type DisputeProof = - runtime_types::polkadot_primitives::v9::slashing::DisputeProof; - pub type KeyOwnershipProof = - runtime_types::polkadot_primitives::v9::slashing::OpaqueKeyOwnershipProof; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<()>; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SubmitReportDisputeLost { - pub dispute_proof: submit_report_dispute_lost::DisputeProof, - pub key_ownership_proof: submit_report_dispute_lost::KeyOwnershipProof, - } - pub mod minimum_backing_votes { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u32; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct MinimumBackingVotes {} - pub mod para_backing_state { - use super::runtime_types; - pub type RuntimeApiGeneratedName0 = - runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::polkadot_primitives::v9::async_backing::BackingState< - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ParaBackingState { - pub runtime_api_generated_name_0__: - para_backing_state::RuntimeApiGeneratedName0, - } - pub mod async_backing_params { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types :: polkadot_primitives :: v9 :: async_backing :: AsyncBackingParams ; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AsyncBackingParams {} - pub mod disabled_validators { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct DisabledValidators {} - pub mod node_features { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::bits::DecodedBits< - ::core::primitive::u8, - ::subxt::ext::subxt_core::utils::bits::Lsb0, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct NodeFeatures {} - pub mod approval_voting_params { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = - runtime_types::polkadot_primitives::v9::ApprovalVotingParams; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ApprovalVotingParams {} - pub mod claim_queue { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::utils::KeyedVec< - runtime_types::polkadot_primitives::v9::CoreIndex, - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ClaimQueue {} - pub mod candidates_pending_availability { - use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::CommittedCandidateReceiptV2< - ::subxt::ext::subxt_core::utils::H256, - >, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CandidatesPendingAvailability { - pub para_id: candidates_pending_availability::ParaId, - } - pub mod validation_code_bomb_limit { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u32; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidationCodeBombLimit {} - pub mod backing_constraints { + } + pub mod backing_constraints { + use super::root_mod; + use super::runtime_types; + pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { use super::runtime_types; - pub type ParaId = runtime_types::polkadot_parachain_primitives::primitives::Id; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::polkadot_primitives::v9::async_backing::Constraints< - ::core::primitive::u32, - >, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct BackingConstraints { - pub para_id: backing_constraints::ParaId, + pub type Output = ::core::option::Option< + runtime_types::polkadot_primitives::v9::async_backing::Constraints< + ::core::primitive::u32, + >, + >; } - pub mod scheduling_lookahead { + } + pub mod scheduling_lookahead { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u32; - } + pub type Output = ::core::primitive::u32; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SchedulingLookahead {} - pub mod para_ids { + } + pub mod para_ids { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ParaIds {} - pub mod unapplied_slashes_v2 { + } + pub mod unapplied_slashes_v2 { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - runtime_types::polkadot_core_primitives::CandidateHash, - runtime_types::polkadot_primitives::v9::slashing::PendingSlashes, - )>; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::polkadot_core_primitives::CandidateHash, + runtime_types::polkadot_primitives::v9::slashing::PendingSlashes, + )>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct UnappliedSlashesV2 {} } } pub mod beefy_api { @@ -2788,13 +2085,13 @@ pub mod api { pub fn beefy_genesis( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::BeefyGenesis, - types::beefy_genesis::output::Output, + (), + beefy_genesis::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyApi", "beefy_genesis", - types::BeefyGenesis {}, + (), [ 246u8, 129u8, 31u8, 77u8, 24u8, 47u8, 5u8, 156u8, 64u8, 222u8, 180u8, 78u8, 110u8, 77u8, 218u8, 149u8, 210u8, 151u8, 164u8, 220u8, 165u8, @@ -2807,13 +2104,13 @@ pub mod api { pub fn validator_set( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::ValidatorSet, - types::validator_set::output::Output, + (), + validator_set::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyApi", "validator_set", - types::ValidatorSet {}, + (), [ 89u8, 55u8, 143u8, 190u8, 77u8, 133u8, 228u8, 92u8, 245u8, 253u8, 70u8, 232u8, 213u8, 119u8, 88u8, 47u8, 122u8, 60u8, 179u8, 61u8, 199u8, @@ -2832,19 +2129,19 @@ pub mod api { #[doc = " hardcoded to return `None`). Only useful in an offchain context."] pub fn submit_report_double_voting_unsigned_extrinsic( &self, - equivocation_proof : types :: submit_report_double_voting_unsigned_extrinsic :: EquivocationProof, - key_owner_proof : types :: submit_report_double_voting_unsigned_extrinsic :: KeyOwnerProof, + equivocation_proof : submit_report_double_voting_unsigned_extrinsic :: EquivocationProof, + key_owner_proof: submit_report_double_voting_unsigned_extrinsic::KeyOwnerProof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SubmitReportDoubleVotingUnsignedExtrinsic, - types::submit_report_double_voting_unsigned_extrinsic::output::Output, + ( + submit_report_double_voting_unsigned_extrinsic::EquivocationProof, + submit_report_double_voting_unsigned_extrinsic::KeyOwnerProof, + ), + submit_report_double_voting_unsigned_extrinsic::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyApi", "submit_report_double_voting_unsigned_extrinsic", - types::SubmitReportDoubleVotingUnsignedExtrinsic { - equivocation_proof, - key_owner_proof, - }, + (equivocation_proof, key_owner_proof), [ 150u8, 77u8, 238u8, 96u8, 27u8, 152u8, 189u8, 202u8, 142u8, 30u8, 252u8, 43u8, 134u8, 87u8, 86u8, 188u8, 184u8, 126u8, 229u8, 230u8, @@ -2863,19 +2160,19 @@ pub mod api { #[doc = " hardcoded to return `None`). Only useful in an offchain context."] pub fn submit_report_fork_voting_unsigned_extrinsic( &self, - equivocation_proof : types :: submit_report_fork_voting_unsigned_extrinsic :: EquivocationProof, - key_owner_proof : types :: submit_report_fork_voting_unsigned_extrinsic :: KeyOwnerProof, + equivocation_proof : submit_report_fork_voting_unsigned_extrinsic :: EquivocationProof, + key_owner_proof: submit_report_fork_voting_unsigned_extrinsic::KeyOwnerProof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SubmitReportForkVotingUnsignedExtrinsic, - types::submit_report_fork_voting_unsigned_extrinsic::output::Output, + ( + submit_report_fork_voting_unsigned_extrinsic::EquivocationProof, + submit_report_fork_voting_unsigned_extrinsic::KeyOwnerProof, + ), + submit_report_fork_voting_unsigned_extrinsic::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyApi", "submit_report_fork_voting_unsigned_extrinsic", - types::SubmitReportForkVotingUnsignedExtrinsic { - equivocation_proof, - key_owner_proof, - }, + (equivocation_proof, key_owner_proof), [ 148u8, 230u8, 78u8, 95u8, 219u8, 17u8, 5u8, 8u8, 254u8, 198u8, 252u8, 211u8, 136u8, 20u8, 103u8, 153u8, 248u8, 144u8, 128u8, 58u8, 96u8, @@ -2893,19 +2190,19 @@ pub mod api { #[doc = " hardcoded to return `None`). Only useful in an offchain context."] pub fn submit_report_future_block_voting_unsigned_extrinsic( &self, - equivocation_proof : types :: submit_report_future_block_voting_unsigned_extrinsic :: EquivocationProof, - key_owner_proof : types :: submit_report_future_block_voting_unsigned_extrinsic :: KeyOwnerProof, + equivocation_proof : submit_report_future_block_voting_unsigned_extrinsic :: EquivocationProof, + key_owner_proof : submit_report_future_block_voting_unsigned_extrinsic :: KeyOwnerProof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SubmitReportFutureBlockVotingUnsignedExtrinsic, - types::submit_report_future_block_voting_unsigned_extrinsic::output::Output, + ( + submit_report_future_block_voting_unsigned_extrinsic::EquivocationProof, + submit_report_future_block_voting_unsigned_extrinsic::KeyOwnerProof, + ), + submit_report_future_block_voting_unsigned_extrinsic::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyApi", "submit_report_future_block_voting_unsigned_extrinsic", - types::SubmitReportFutureBlockVotingUnsignedExtrinsic { - equivocation_proof, - key_owner_proof, - }, + (equivocation_proof, key_owner_proof), [ 111u8, 49u8, 126u8, 212u8, 123u8, 116u8, 91u8, 235u8, 190u8, 88u8, 70u8, 175u8, 50u8, 229u8, 231u8, 241u8, 10u8, 208u8, 107u8, 140u8, @@ -2927,19 +2224,19 @@ pub mod api { #[doc = " older states to be available."] pub fn generate_key_ownership_proof( &self, - set_id: types::generate_key_ownership_proof::SetId, - authority_id: types::generate_key_ownership_proof::AuthorityId, + set_id: generate_key_ownership_proof::SetId, + authority_id: generate_key_ownership_proof::AuthorityId, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GenerateKeyOwnershipProof, - types::generate_key_ownership_proof::output::Output, + ( + generate_key_ownership_proof::SetId, + generate_key_ownership_proof::AuthorityId, + ), + generate_key_ownership_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyApi", "generate_key_ownership_proof", - types::GenerateKeyOwnershipProof { - set_id, - authority_id, - }, + (set_id, authority_id), [ 119u8, 183u8, 178u8, 109u8, 57u8, 250u8, 176u8, 255u8, 11u8, 190u8, 35u8, 142u8, 102u8, 112u8, 4u8, 219u8, 204u8, 81u8, 163u8, 87u8, 129u8, @@ -2948,165 +2245,77 @@ pub mod api { ) } } - pub mod types { + pub mod beefy_genesis { + use super::root_mod; use super::runtime_types; - pub mod beefy_genesis { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<::core::primitive::u32>; - } + pub type Output = ::core::option::Option<::core::primitive::u32>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct BeefyGenesis {} - pub mod validator_set { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::sp_consensus_beefy::ValidatorSet< - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ValidatorSet {} - pub mod submit_report_double_voting_unsigned_extrinsic { + } + pub mod validator_set { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_beefy::DoubleVotingProof< - ::core::primitive::u32, + pub type Output = ::core::option::Option< + runtime_types::sp_consensus_beefy::ValidatorSet< runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Signature, - >; - pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<()>; - } + >, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SubmitReportDoubleVotingUnsignedExtrinsic { - pub equivocation_proof: - submit_report_double_voting_unsigned_extrinsic::EquivocationProof, - pub key_owner_proof: - submit_report_double_voting_unsigned_extrinsic::KeyOwnerProof, + } + pub mod submit_report_double_voting_unsigned_extrinsic { + use super::root_mod; + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_beefy::DoubleVotingProof< + ::core::primitive::u32, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Signature, + >; + pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option<()>; } - pub mod submit_report_fork_voting_unsigned_extrinsic { + } + pub mod submit_report_fork_voting_unsigned_extrinsic { + use super::root_mod; + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_beefy::ForkVotingProof< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + runtime_types::sp_runtime::OpaqueValue, + >; + pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; + pub mod output { use super::runtime_types; - pub type EquivocationProof = runtime_types::sp_consensus_beefy::ForkVotingProof< - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + pub type Output = ::core::option::Option<()>; + } + } + pub mod submit_report_future_block_voting_unsigned_extrinsic { + use super::root_mod; + use super::runtime_types; + pub type EquivocationProof = + runtime_types::sp_consensus_beefy::FutureBlockVotingProof< + ::core::primitive::u32, runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - runtime_types::sp_runtime::OpaqueValue, >; - pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<()>; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SubmitReportForkVotingUnsignedExtrinsic { - pub equivocation_proof: - submit_report_fork_voting_unsigned_extrinsic::EquivocationProof, - pub key_owner_proof: - submit_report_fork_voting_unsigned_extrinsic::KeyOwnerProof, - } - pub mod submit_report_future_block_voting_unsigned_extrinsic { + pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; + pub mod output { use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_beefy::FutureBlockVotingProof< - ::core::primitive::u32, - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >; - pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<()>; - } + pub type Output = ::core::option::Option<()>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SubmitReportFutureBlockVotingUnsignedExtrinsic { - pub equivocation_proof: - submit_report_future_block_voting_unsigned_extrinsic::EquivocationProof, - pub key_owner_proof: - submit_report_future_block_voting_unsigned_extrinsic::KeyOwnerProof, - } - pub mod generate_key_ownership_proof { + } + pub mod generate_key_ownership_proof { + use super::root_mod; + use super::runtime_types; + pub type SetId = ::core::primitive::u64; + pub type AuthorityId = runtime_types::sp_consensus_beefy::ecdsa_crypto::Public; + pub mod output { use super::runtime_types; - pub type SetId = ::core::primitive::u64; - pub type AuthorityId = runtime_types::sp_consensus_beefy::ecdsa_crypto::Public; - pub mod output { - use super::runtime_types; - pub type Output = - ::core::option::Option; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GenerateKeyOwnershipProof { - pub set_id: generate_key_ownership_proof::SetId, - pub authority_id: generate_key_ownership_proof::AuthorityId, + pub type Output = + ::core::option::Option; } } } @@ -3120,13 +2329,13 @@ pub mod api { pub fn mmr_root( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::MmrRoot, - types::mmr_root::output::Output, + (), + mmr_root::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "MmrApi", "mmr_root", - types::MmrRoot {}, + (), [ 148u8, 252u8, 77u8, 233u8, 236u8, 8u8, 119u8, 105u8, 207u8, 161u8, 109u8, 158u8, 211u8, 64u8, 67u8, 216u8, 242u8, 52u8, 122u8, 4u8, 83u8, @@ -3138,13 +2347,13 @@ pub mod api { pub fn mmr_leaf_count( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::MmrLeafCount, - types::mmr_leaf_count::output::Output, + (), + mmr_leaf_count::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "MmrApi", "mmr_leaf_count", - types::MmrLeafCount {}, + (), [ 165u8, 141u8, 127u8, 184u8, 27u8, 185u8, 251u8, 25u8, 44u8, 93u8, 239u8, 158u8, 104u8, 91u8, 22u8, 87u8, 101u8, 166u8, 90u8, 90u8, 45u8, @@ -3157,19 +2366,19 @@ pub mod api { #[doc = " use historical MMR state at given block height `n`. Else, use current MMR state."] pub fn generate_proof( &self, - block_numbers: types::generate_proof::BlockNumbers, - best_known_block_number: types::generate_proof::BestKnownBlockNumber, + block_numbers: generate_proof::BlockNumbers, + best_known_block_number: generate_proof::BestKnownBlockNumber, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GenerateProof, - types::generate_proof::output::Output, + ( + generate_proof::BlockNumbers, + generate_proof::BestKnownBlockNumber, + ), + generate_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "MmrApi", "generate_proof", - types::GenerateProof { - block_numbers, - best_known_block_number, - }, + (block_numbers, best_known_block_number), [ 187u8, 175u8, 153u8, 82u8, 245u8, 180u8, 126u8, 156u8, 67u8, 89u8, 253u8, 29u8, 54u8, 168u8, 196u8, 144u8, 24u8, 123u8, 154u8, 69u8, @@ -3182,19 +2391,19 @@ pub mod api { #[doc = " `best_known_block_number`."] pub fn generate_ancestry_proof( &self, - prev_block_number: types::generate_ancestry_proof::PrevBlockNumber, - best_known_block_number: types::generate_ancestry_proof::BestKnownBlockNumber, + prev_block_number: generate_ancestry_proof::PrevBlockNumber, + best_known_block_number: generate_ancestry_proof::BestKnownBlockNumber, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GenerateAncestryProof, - types::generate_ancestry_proof::output::Output, + ( + generate_ancestry_proof::PrevBlockNumber, + generate_ancestry_proof::BestKnownBlockNumber, + ), + generate_ancestry_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "MmrApi", "generate_ancestry_proof", - types::GenerateAncestryProof { - prev_block_number, - best_known_block_number, - }, + (prev_block_number, best_known_block_number), [ 27u8, 149u8, 193u8, 12u8, 185u8, 136u8, 82u8, 137u8, 95u8, 191u8, 145u8, 212u8, 204u8, 107u8, 205u8, 20u8, 85u8, 54u8, 11u8, 206u8, 35u8, @@ -3209,16 +2418,16 @@ pub mod api { #[doc = " same position in both the `leaves` vector and the `leaf_indices` vector contained in the [LeafProof]"] pub fn verify_proof( &self, - leaves: types::verify_proof::Leaves, - proof: types::verify_proof::Proof, + leaves: verify_proof::Leaves, + proof: verify_proof::Proof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::VerifyProof, - types::verify_proof::output::Output, + (verify_proof::Leaves, verify_proof::Proof), + verify_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "MmrApi", "verify_proof", - types::VerifyProof { leaves, proof }, + (leaves, proof), [ 236u8, 54u8, 135u8, 196u8, 161u8, 247u8, 183u8, 78u8, 153u8, 69u8, 59u8, 78u8, 62u8, 20u8, 187u8, 47u8, 77u8, 209u8, 209u8, 224u8, 127u8, @@ -3236,21 +2445,21 @@ pub mod api { #[doc = " same position in both the `leaves` vector and the `leaf_indices` vector contained in the [LeafProof]"] pub fn verify_proof_stateless( &self, - root: types::verify_proof_stateless::Root, - leaves: types::verify_proof_stateless::Leaves, - proof: types::verify_proof_stateless::Proof, + root: verify_proof_stateless::Root, + leaves: verify_proof_stateless::Leaves, + proof: verify_proof_stateless::Proof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::VerifyProofStateless, - types::verify_proof_stateless::output::Output, + ( + verify_proof_stateless::Root, + verify_proof_stateless::Leaves, + verify_proof_stateless::Proof, + ), + verify_proof_stateless::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "MmrApi", "verify_proof_stateless", - types::VerifyProofStateless { - root, - leaves, - proof, - }, + (root, leaves, proof), [ 163u8, 232u8, 190u8, 65u8, 135u8, 136u8, 50u8, 60u8, 137u8, 37u8, 192u8, 24u8, 137u8, 144u8, 165u8, 131u8, 49u8, 88u8, 15u8, 139u8, 83u8, @@ -3259,175 +2468,93 @@ pub mod api { ) } } - pub mod types { + pub mod mmr_root { + use super::root_mod; use super::runtime_types; - pub mod mmr_root { - use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ::subxt::ext::subxt_core::utils::H256, - runtime_types::sp_mmr_primitives::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct MmrRoot {} - pub mod mmr_leaf_count { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ::core::primitive::u64, - runtime_types::sp_mmr_primitives::Error, - >; - } + pub type Output = ::core::result::Result< + ::subxt::ext::subxt_core::utils::H256, + runtime_types::sp_mmr_primitives::Error, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct MmrLeafCount {} - pub mod generate_proof { + } + pub mod mmr_leaf_count { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type BlockNumbers = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u32>; - pub type BestKnownBlockNumber = ::core::option::Option<::core::primitive::u32>; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ( - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, - >, - runtime_types::sp_mmr_primitives::LeafProof< - ::subxt::ext::subxt_core::utils::H256, - >, - ), - runtime_types::sp_mmr_primitives::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GenerateProof { - pub block_numbers: generate_proof::BlockNumbers, - pub best_known_block_number: generate_proof::BestKnownBlockNumber, + pub type Output = ::core::result::Result< + ::core::primitive::u64, + runtime_types::sp_mmr_primitives::Error, + >; } - pub mod generate_ancestry_proof { + } + pub mod generate_proof { + use super::root_mod; + use super::runtime_types; + pub type BlockNumbers = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u32>; + pub type BestKnownBlockNumber = ::core::option::Option<::core::primitive::u32>; + pub mod output { use super::runtime_types; - pub type PrevBlockNumber = ::core::primitive::u32; - pub type BestKnownBlockNumber = ::core::option::Option<::core::primitive::u32>; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - runtime_types::sp_mmr_primitives::AncestryProof< + pub type Output = ::core::result::Result< + ( + ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, + >, + runtime_types::sp_mmr_primitives::LeafProof< ::subxt::ext::subxt_core::utils::H256, >, - runtime_types::sp_mmr_primitives::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GenerateAncestryProof { - pub prev_block_number: generate_ancestry_proof::PrevBlockNumber, - pub best_known_block_number: generate_ancestry_proof::BestKnownBlockNumber, + ), + runtime_types::sp_mmr_primitives::Error, + >; } - pub mod verify_proof { + } + pub mod generate_ancestry_proof { + use super::root_mod; + use super::runtime_types; + pub type PrevBlockNumber = ::core::primitive::u32; + pub type BestKnownBlockNumber = ::core::option::Option<::core::primitive::u32>; + pub mod output { use super::runtime_types; - pub type Leaves = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, - >; - pub type Proof = runtime_types::sp_mmr_primitives::LeafProof< - ::subxt::ext::subxt_core::utils::H256, + pub type Output = ::core::result::Result< + runtime_types::sp_mmr_primitives::AncestryProof< + ::subxt::ext::subxt_core::utils::H256, + >, + runtime_types::sp_mmr_primitives::Error, >; - pub mod output { - use super::runtime_types; - pub type Output = - ::core::result::Result<(), runtime_types::sp_mmr_primitives::Error>; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct VerifyProof { - pub leaves: verify_proof::Leaves, - pub proof: verify_proof::Proof, } - pub mod verify_proof_stateless { + } + pub mod verify_proof { + use super::root_mod; + use super::runtime_types; + pub type Leaves = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, + >; + pub type Proof = runtime_types::sp_mmr_primitives::LeafProof< + ::subxt::ext::subxt_core::utils::H256, + >; + pub mod output { use super::runtime_types; - pub type Root = ::subxt::ext::subxt_core::utils::H256; - pub type Leaves = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, - >; - pub type Proof = runtime_types::sp_mmr_primitives::LeafProof< - ::subxt::ext::subxt_core::utils::H256, - >; - pub mod output { - use super::runtime_types; - pub type Output = - ::core::result::Result<(), runtime_types::sp_mmr_primitives::Error>; - } + pub type Output = + ::core::result::Result<(), runtime_types::sp_mmr_primitives::Error>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct VerifyProofStateless { - pub root: verify_proof_stateless::Root, - pub leaves: verify_proof_stateless::Leaves, - pub proof: verify_proof_stateless::Proof, + } + pub mod verify_proof_stateless { + use super::root_mod; + use super::runtime_types; + pub type Root = ::subxt::ext::subxt_core::utils::H256; + pub type Leaves = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::sp_mmr_primitives::EncodableOpaqueLeaf, + >; + pub type Proof = runtime_types::sp_mmr_primitives::LeafProof< + ::subxt::ext::subxt_core::utils::H256, + >; + pub mod output { + use super::runtime_types; + pub type Output = + ::core::result::Result<(), runtime_types::sp_mmr_primitives::Error>; } } } @@ -3454,13 +2581,13 @@ pub mod api { pub fn grandpa_authorities( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GrandpaAuthorities, - types::grandpa_authorities::output::Output, + (), + grandpa_authorities::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "GrandpaApi", "grandpa_authorities", - types::GrandpaAuthorities {}, + (), [ 8u8, 1u8, 99u8, 227u8, 52u8, 95u8, 230u8, 139u8, 198u8, 90u8, 159u8, 146u8, 193u8, 81u8, 37u8, 27u8, 216u8, 227u8, 108u8, 126u8, 12u8, 94u8, @@ -3478,19 +2605,19 @@ pub mod api { #[doc = " hardcoded to return `None`). Only useful in an offchain context."] pub fn submit_report_equivocation_unsigned_extrinsic( &self, - equivocation_proof : types :: submit_report_equivocation_unsigned_extrinsic :: EquivocationProof, - key_owner_proof : types :: submit_report_equivocation_unsigned_extrinsic :: KeyOwnerProof, + equivocation_proof : submit_report_equivocation_unsigned_extrinsic :: EquivocationProof, + key_owner_proof: submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SubmitReportEquivocationUnsignedExtrinsic, - types::submit_report_equivocation_unsigned_extrinsic::output::Output, + ( + submit_report_equivocation_unsigned_extrinsic::EquivocationProof, + submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, + ), + submit_report_equivocation_unsigned_extrinsic::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "GrandpaApi", "submit_report_equivocation_unsigned_extrinsic", - types::SubmitReportEquivocationUnsignedExtrinsic { - equivocation_proof, - key_owner_proof, - }, + (equivocation_proof, key_owner_proof), [ 27u8, 32u8, 16u8, 79u8, 172u8, 124u8, 44u8, 13u8, 176u8, 89u8, 69u8, 60u8, 45u8, 176u8, 72u8, 151u8, 252u8, 5u8, 243u8, 82u8, 170u8, 51u8, @@ -3511,19 +2638,19 @@ pub mod api { #[doc = " older states to be available."] pub fn generate_key_ownership_proof( &self, - set_id: types::generate_key_ownership_proof::SetId, - authority_id: types::generate_key_ownership_proof::AuthorityId, + set_id: generate_key_ownership_proof::SetId, + authority_id: generate_key_ownership_proof::AuthorityId, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GenerateKeyOwnershipProof, - types::generate_key_ownership_proof::output::Output, + ( + generate_key_ownership_proof::SetId, + generate_key_ownership_proof::AuthorityId, + ), + generate_key_ownership_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "GrandpaApi", "generate_key_ownership_proof", - types::GenerateKeyOwnershipProof { - set_id, - authority_id, - }, + (set_id, authority_id), [ 13u8, 144u8, 66u8, 235u8, 24u8, 190u8, 39u8, 75u8, 29u8, 157u8, 215u8, 181u8, 173u8, 145u8, 224u8, 244u8, 189u8, 79u8, 6u8, 116u8, 139u8, @@ -3535,13 +2662,13 @@ pub mod api { pub fn current_set_id( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CurrentSetId, - types::current_set_id::output::Output, + (), + current_set_id::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "GrandpaApi", "current_set_id", - types::CurrentSetId {}, + (), [ 42u8, 230u8, 120u8, 211u8, 156u8, 245u8, 109u8, 86u8, 100u8, 146u8, 234u8, 205u8, 41u8, 183u8, 109u8, 42u8, 17u8, 33u8, 156u8, 25u8, 139u8, @@ -3551,104 +2678,48 @@ pub mod api { ) } } - pub mod types { + pub mod grandpa_authorities { + use super::root_mod; use super::runtime_types; - pub mod grandpa_authorities { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::sp_consensus_grandpa::app::Public, - ::core::primitive::u64, - )>; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + runtime_types::sp_consensus_grandpa::app::Public, + ::core::primitive::u64, + )>; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GrandpaAuthorities {} - pub mod submit_report_equivocation_unsigned_extrinsic { + } + pub mod submit_report_equivocation_unsigned_extrinsic { + use super::root_mod; + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_grandpa::EquivocationProof< + ::subxt::ext::subxt_core::utils::H256, + ::core::primitive::u32, + >; + pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; + pub mod output { use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_grandpa::EquivocationProof< - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >; - pub type KeyOwnerProof = runtime_types::sp_runtime::OpaqueValue; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<()>; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SubmitReportEquivocationUnsignedExtrinsic { - pub equivocation_proof: - submit_report_equivocation_unsigned_extrinsic::EquivocationProof, - pub key_owner_proof: - submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, + pub type Output = ::core::option::Option<()>; } - pub mod generate_key_ownership_proof { + } + pub mod generate_key_ownership_proof { + use super::root_mod; + use super::runtime_types; + pub type SetId = ::core::primitive::u64; + pub type AuthorityId = runtime_types::sp_consensus_grandpa::app::Public; + pub mod output { use super::runtime_types; - pub type SetId = ::core::primitive::u64; - pub type AuthorityId = runtime_types::sp_consensus_grandpa::app::Public; - pub mod output { - use super::runtime_types; - pub type Output = - ::core::option::Option; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GenerateKeyOwnershipProof { - pub set_id: generate_key_ownership_proof::SetId, - pub authority_id: generate_key_ownership_proof::AuthorityId, + pub type Output = + ::core::option::Option; } - pub mod current_set_id { + } + pub mod current_set_id { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u64; - } + pub type Output = ::core::primitive::u64; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CurrentSetId {} } } pub mod babe_api { @@ -3661,13 +2732,13 @@ pub mod api { pub fn configuration( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::Configuration, - types::configuration::output::Output, + (), + configuration::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BabeApi", "configuration", - types::Configuration {}, + (), [ 50u8, 198u8, 27u8, 26u8, 92u8, 199u8, 8u8, 181u8, 12u8, 199u8, 116u8, 247u8, 95u8, 70u8, 241u8, 24u8, 14u8, 250u8, 179u8, 77u8, 251u8, 55u8, @@ -3679,13 +2750,13 @@ pub mod api { pub fn current_epoch_start( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CurrentEpochStart, - types::current_epoch_start::output::Output, + (), + current_epoch_start::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BabeApi", "current_epoch_start", - types::CurrentEpochStart {}, + (), [ 122u8, 125u8, 246u8, 170u8, 27u8, 50u8, 128u8, 137u8, 228u8, 62u8, 145u8, 64u8, 65u8, 119u8, 166u8, 237u8, 115u8, 92u8, 125u8, 124u8, @@ -3698,13 +2769,13 @@ pub mod api { pub fn current_epoch( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::CurrentEpoch, - types::current_epoch::output::Output, + (), + current_epoch::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BabeApi", "current_epoch", - types::CurrentEpoch {}, + (), [ 70u8, 68u8, 222u8, 110u8, 96u8, 143u8, 126u8, 136u8, 182u8, 163u8, 104u8, 122u8, 21u8, 156u8, 6u8, 26u8, 86u8, 145u8, 153u8, 133u8, 251u8, @@ -3718,13 +2789,13 @@ pub mod api { pub fn next_epoch( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::NextEpoch, - types::next_epoch::output::Output, + (), + next_epoch::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BabeApi", "next_epoch", - types::NextEpoch {}, + (), [ 141u8, 86u8, 122u8, 185u8, 215u8, 255u8, 142u8, 131u8, 8u8, 178u8, 143u8, 200u8, 148u8, 84u8, 174u8, 215u8, 91u8, 251u8, 243u8, 155u8, @@ -3746,16 +2817,19 @@ pub mod api { #[doc = " worker, not requiring older states to be available."] pub fn generate_key_ownership_proof( &self, - slot: types::generate_key_ownership_proof::Slot, - authority_id: types::generate_key_ownership_proof::AuthorityId, + slot: generate_key_ownership_proof::Slot, + authority_id: generate_key_ownership_proof::AuthorityId, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GenerateKeyOwnershipProof, - types::generate_key_ownership_proof::output::Output, + ( + generate_key_ownership_proof::Slot, + generate_key_ownership_proof::AuthorityId, + ), + generate_key_ownership_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BabeApi", "generate_key_ownership_proof", - types::GenerateKeyOwnershipProof { slot, authority_id }, + (slot, authority_id), [ 13u8, 228u8, 75u8, 150u8, 203u8, 132u8, 82u8, 188u8, 17u8, 70u8, 169u8, 19u8, 102u8, 96u8, 217u8, 209u8, 215u8, 196u8, 78u8, 141u8, 12u8, 14u8, @@ -3773,19 +2847,19 @@ pub mod api { #[doc = " hardcoded to return `None`). Only useful in an offchain context."] pub fn submit_report_equivocation_unsigned_extrinsic( &self, - equivocation_proof : types :: submit_report_equivocation_unsigned_extrinsic :: EquivocationProof, - key_owner_proof : types :: submit_report_equivocation_unsigned_extrinsic :: KeyOwnerProof, + equivocation_proof : submit_report_equivocation_unsigned_extrinsic :: EquivocationProof, + key_owner_proof: submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::SubmitReportEquivocationUnsignedExtrinsic, - types::submit_report_equivocation_unsigned_extrinsic::output::Output, + ( + submit_report_equivocation_unsigned_extrinsic::EquivocationProof, + submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, + ), + submit_report_equivocation_unsigned_extrinsic::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BabeApi", "submit_report_equivocation_unsigned_extrinsic", - types::SubmitReportEquivocationUnsignedExtrinsic { - equivocation_proof, - key_owner_proof, - }, + (equivocation_proof, key_owner_proof), [ 99u8, 80u8, 38u8, 173u8, 235u8, 48u8, 229u8, 88u8, 250u8, 165u8, 57u8, 245u8, 85u8, 156u8, 114u8, 190u8, 144u8, 78u8, 37u8, 22u8, 36u8, 36u8, @@ -3794,142 +2868,61 @@ pub mod api { ) } } - pub mod types { + pub mod configuration { + use super::root_mod; use super::runtime_types; - pub mod configuration { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_consensus_babe::BabeConfiguration; - } + pub type Output = runtime_types::sp_consensus_babe::BabeConfiguration; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Configuration {} - pub mod current_epoch_start { + } + pub mod current_epoch_start { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_consensus_slots::Slot; - } + pub type Output = runtime_types::sp_consensus_slots::Slot; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CurrentEpochStart {} - pub mod current_epoch { + } + pub mod current_epoch { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_consensus_babe::Epoch; - } + pub type Output = runtime_types::sp_consensus_babe::Epoch; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CurrentEpoch {} - pub mod next_epoch { + } + pub mod next_epoch { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_consensus_babe::Epoch; - } + pub type Output = runtime_types::sp_consensus_babe::Epoch; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct NextEpoch {} - pub mod generate_key_ownership_proof { + } + pub mod generate_key_ownership_proof { + use super::root_mod; + use super::runtime_types; + pub type Slot = runtime_types::sp_consensus_slots::Slot; + pub type AuthorityId = runtime_types::sp_consensus_babe::app::Public; + pub mod output { use super::runtime_types; - pub type Slot = runtime_types::sp_consensus_slots::Slot; - pub type AuthorityId = runtime_types::sp_consensus_babe::app::Public; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::sp_consensus_babe::OpaqueKeyOwnershipProof, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GenerateKeyOwnershipProof { - pub slot: generate_key_ownership_proof::Slot, - pub authority_id: generate_key_ownership_proof::AuthorityId, + pub type Output = ::core::option::Option< + runtime_types::sp_consensus_babe::OpaqueKeyOwnershipProof, + >; } - pub mod submit_report_equivocation_unsigned_extrinsic { + } + pub mod submit_report_equivocation_unsigned_extrinsic { + use super::root_mod; + use super::runtime_types; + pub type EquivocationProof = runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + runtime_types::sp_consensus_babe::app::Public, + >; + pub type KeyOwnerProof = runtime_types::sp_consensus_babe::OpaqueKeyOwnershipProof; + pub mod output { use super::runtime_types; - pub type EquivocationProof = - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - >, - runtime_types::sp_consensus_babe::app::Public, - >; - pub type KeyOwnerProof = - runtime_types::sp_consensus_babe::OpaqueKeyOwnershipProof; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<()>; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct SubmitReportEquivocationUnsignedExtrinsic { - pub equivocation_proof: - submit_report_equivocation_unsigned_extrinsic::EquivocationProof, - pub key_owner_proof: - submit_report_equivocation_unsigned_extrinsic::KeyOwnerProof, + pub type Output = ::core::option::Option<()>; } } } @@ -3946,13 +2939,13 @@ pub mod api { pub fn authorities( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::Authorities, - types::authorities::output::Output, + (), + authorities::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "AuthorityDiscoveryApi", "authorities", - types::Authorities {}, + (), [ 165u8, 81u8, 77u8, 215u8, 27u8, 128u8, 36u8, 135u8, 216u8, 203u8, 60u8, 250u8, 235u8, 22u8, 149u8, 99u8, 233u8, 114u8, 62u8, 69u8, 27u8, 185u8, @@ -3961,29 +2954,15 @@ pub mod api { ) } } - pub mod types { + pub mod authorities { + use super::root_mod; use super::runtime_types; - pub mod authorities { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::sp_authority_discovery::app::Public, - >; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::sp_authority_discovery::app::Public, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Authorities {} } } pub mod session_keys { @@ -4001,15 +2980,15 @@ pub mod api { #[doc = " Returns the concatenated SCALE encoded public keys."] pub fn generate_session_keys( &self, - seed: types::generate_session_keys::Seed, + seed: generate_session_keys::Seed, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GenerateSessionKeys, - types::generate_session_keys::output::Output, + (generate_session_keys::Seed,), + generate_session_keys::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "SessionKeys", "generate_session_keys", - types::GenerateSessionKeys { seed }, + (seed,), [ 96u8, 171u8, 164u8, 166u8, 175u8, 102u8, 101u8, 47u8, 133u8, 95u8, 102u8, 202u8, 83u8, 26u8, 238u8, 47u8, 126u8, 132u8, 22u8, 11u8, 33u8, @@ -4022,15 +3001,15 @@ pub mod api { #[doc = " Returns the list of public raw public keys + key type."] pub fn decode_session_keys( &self, - encoded: types::decode_session_keys::Encoded, + encoded: decode_session_keys::Encoded, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::DecodeSessionKeys, - types::decode_session_keys::output::Output, + (decode_session_keys::Encoded,), + decode_session_keys::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "SessionKeys", "decode_session_keys", - types::DecodeSessionKeys { encoded }, + (encoded,), [ 57u8, 242u8, 18u8, 51u8, 132u8, 110u8, 238u8, 255u8, 39u8, 194u8, 8u8, 54u8, 198u8, 178u8, 75u8, 151u8, 148u8, 176u8, 144u8, 197u8, 87u8, @@ -4040,60 +3019,30 @@ pub mod api { ) } } - pub mod types { + pub mod generate_session_keys { + use super::root_mod; use super::runtime_types; - pub mod generate_session_keys { - use super::runtime_types; - pub type Seed = ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; - pub mod output { - use super::runtime_types; - pub type Output = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GenerateSessionKeys { - pub seed: generate_session_keys::Seed, - } - pub mod decode_session_keys { + pub type Seed = ::core::option::Option< + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + pub mod output { use super::runtime_types; - pub type Encoded = + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - runtime_types::sp_core::crypto::KeyTypeId, - )>, - >; - } } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct DecodeSessionKeys { - pub encoded: decode_session_keys::Encoded, + } + pub mod decode_session_keys { + use super::root_mod; + use super::runtime_types; + pub type Encoded = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + runtime_types::sp_core::crypto::KeyTypeId, + )>, + >; } } } @@ -4106,15 +3055,15 @@ pub mod api { #[doc = " Get current account nonce of given `AccountId`."] pub fn account_nonce( &self, - account: types::account_nonce::Account, + account: account_nonce::Account, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::AccountNonce, - types::account_nonce::output::Output, + (account_nonce::Account,), + account_nonce::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "AccountNonceApi", "account_nonce", - types::AccountNonce { account }, + (account,), [ 231u8, 82u8, 7u8, 227u8, 131u8, 2u8, 215u8, 252u8, 173u8, 82u8, 11u8, 103u8, 200u8, 25u8, 114u8, 116u8, 79u8, 229u8, 152u8, 150u8, 236u8, @@ -4124,29 +3073,13 @@ pub mod api { ) } } - pub mod types { + pub mod account_nonce { + use super::root_mod; use super::runtime_types; - pub mod account_nonce { + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u32; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AccountNonce { - pub account: account_nonce::Account, + pub type Output = ::core::primitive::u32; } } } @@ -4157,16 +3090,16 @@ pub mod api { impl TransactionPaymentApi { pub fn query_info( &self, - uxt: types::query_info::Uxt, - len: types::query_info::Len, + uxt: query_info::Uxt, + len: query_info::Len, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryInfo, - types::query_info::output::Output, + (query_info::Uxt, query_info::Len), + query_info::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "TransactionPaymentApi", "query_info", - types::QueryInfo { uxt, len }, + (uxt, len), [ 56u8, 30u8, 174u8, 34u8, 202u8, 24u8, 177u8, 189u8, 145u8, 36u8, 1u8, 156u8, 98u8, 209u8, 178u8, 49u8, 198u8, 23u8, 150u8, 173u8, 35u8, @@ -4176,16 +3109,16 @@ pub mod api { } pub fn query_fee_details( &self, - uxt: types::query_fee_details::Uxt, - len: types::query_fee_details::Len, + uxt: query_fee_details::Uxt, + len: query_fee_details::Len, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryFeeDetails, - types::query_fee_details::output::Output, + (query_fee_details::Uxt, query_fee_details::Len), + query_fee_details::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "TransactionPaymentApi", "query_fee_details", - types::QueryFeeDetails { uxt, len }, + (uxt, len), [ 117u8, 60u8, 137u8, 159u8, 237u8, 252u8, 216u8, 238u8, 232u8, 1u8, 100u8, 152u8, 26u8, 185u8, 145u8, 125u8, 68u8, 189u8, 4u8, 30u8, 125u8, @@ -4196,15 +3129,15 @@ pub mod api { } pub fn query_weight_to_fee( &self, - weight: types::query_weight_to_fee::Weight, + weight: query_weight_to_fee::Weight, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryWeightToFee, - types::query_weight_to_fee::output::Output, + (query_weight_to_fee::Weight,), + query_weight_to_fee::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "TransactionPaymentApi", "query_weight_to_fee", - types::QueryWeightToFee { weight }, + (weight,), [ 206u8, 243u8, 189u8, 83u8, 231u8, 244u8, 247u8, 52u8, 126u8, 208u8, 224u8, 5u8, 163u8, 108u8, 254u8, 114u8, 214u8, 156u8, 227u8, 217u8, @@ -4215,15 +3148,15 @@ pub mod api { } pub fn query_length_to_fee( &self, - length: types::query_length_to_fee::Length, + length: query_length_to_fee::Length, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::QueryLengthToFee, - types::query_length_to_fee::output::Output, + (query_length_to_fee::Length,), + query_length_to_fee::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "TransactionPaymentApi", "query_length_to_fee", - types::QueryLengthToFee { length }, + (length,), [ 92u8, 132u8, 29u8, 119u8, 66u8, 11u8, 196u8, 224u8, 129u8, 23u8, 249u8, 12u8, 32u8, 28u8, 92u8, 50u8, 188u8, 101u8, 203u8, 229u8, 248u8, 216u8, @@ -4232,106 +3165,48 @@ pub mod api { ) } } - pub mod types { + pub mod query_info { + use super::root_mod; use super::runtime_types; - pub mod query_info { + pub type Uxt = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub type Len = ::core::primitive::u32; + pub mod output { use super::runtime_types; - pub type Uxt = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; - pub type Len = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = - runtime_types::pallet_transaction_payment::types::RuntimeDispatchInfo< - ::core::primitive::u128, - runtime_types::sp_weights::weight_v2::Weight, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryInfo { - pub uxt: query_info::Uxt, - pub len: query_info::Len, + pub type Output = + runtime_types::pallet_transaction_payment::types::RuntimeDispatchInfo< + ::core::primitive::u128, + runtime_types::sp_weights::weight_v2::Weight, + >; } - pub mod query_fee_details { + } + pub mod query_fee_details { + use super::root_mod; + use super::runtime_types; + pub type Uxt = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; + pub type Len = ::core::primitive::u32; + pub mod output { use super::runtime_types; - pub type Uxt = :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: rococo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , (runtime_types :: frame_system :: extensions :: authorize_call :: AuthorizeCall , runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: frame_system :: extensions :: weight_reclaim :: WeightReclaim ,) > ; - pub type Len = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = - runtime_types::pallet_transaction_payment::types::FeeDetails< - ::core::primitive::u128, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryFeeDetails { - pub uxt: query_fee_details::Uxt, - pub len: query_fee_details::Len, + pub type Output = runtime_types::pallet_transaction_payment::types::FeeDetails< + ::core::primitive::u128, + >; } - pub mod query_weight_to_fee { + } + pub mod query_weight_to_fee { + use super::root_mod; + use super::runtime_types; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + pub mod output { use super::runtime_types; - pub type Weight = runtime_types::sp_weights::weight_v2::Weight; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u128; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryWeightToFee { - pub weight: query_weight_to_fee::Weight, + pub type Output = ::core::primitive::u128; } - pub mod query_length_to_fee { + } + pub mod query_length_to_fee { + use super::root_mod; + use super::runtime_types; + pub type Length = ::core::primitive::u32; + pub mod output { use super::runtime_types; - pub type Length = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::primitive::u128; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct QueryLengthToFee { - pub length: query_length_to_fee::Length, + pub type Output = ::core::primitive::u128; } } } @@ -4345,13 +3220,13 @@ pub mod api { pub fn authority_set_proof( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::AuthoritySetProof, - types::authority_set_proof::output::Output, + (), + authority_set_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyMmrApi", "authority_set_proof", - types::AuthoritySetProof {}, + (), [ 199u8, 220u8, 251u8, 219u8, 216u8, 5u8, 181u8, 172u8, 191u8, 209u8, 123u8, 25u8, 151u8, 129u8, 166u8, 21u8, 107u8, 22u8, 74u8, 144u8, @@ -4364,13 +3239,13 @@ pub mod api { pub fn next_authority_set_proof( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::NextAuthoritySetProof, - types::next_authority_set_proof::output::Output, + (), + next_authority_set_proof::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "BeefyMmrApi", "next_authority_set_proof", - types::NextAuthoritySetProof {}, + (), [ 66u8, 217u8, 48u8, 108u8, 211u8, 187u8, 61u8, 85u8, 210u8, 59u8, 128u8, 159u8, 34u8, 151u8, 154u8, 140u8, 13u8, 244u8, 31u8, 216u8, 67u8, 67u8, @@ -4379,50 +3254,25 @@ pub mod api { ) } } - pub mod types { + pub mod authority_set_proof { + use super::root_mod; use super::runtime_types; - pub mod authority_set_proof { + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, - >; - } + pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< + ::subxt::ext::subxt_core::utils::H256, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AuthoritySetProof {} - pub mod next_authority_set_proof { + } + pub mod next_authority_set_proof { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, - >; - } + pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< + ::subxt::ext::subxt_core::utils::H256, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct NextAuthoritySetProof {} } } pub mod genesis_builder { @@ -4443,15 +3293,15 @@ pub mod api { #[doc = " defaults will be used."] pub fn build_state( &self, - json: types::build_state::Json, + json: build_state::Json, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::BuildState, - types::build_state::output::Output, + (build_state::Json,), + build_state::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "GenesisBuilder", "build_state", - types::BuildState { json }, + (json,), [ 203u8, 233u8, 104u8, 116u8, 111u8, 131u8, 201u8, 235u8, 117u8, 116u8, 140u8, 185u8, 93u8, 25u8, 155u8, 210u8, 56u8, 49u8, 23u8, 32u8, 253u8, @@ -4475,15 +3325,15 @@ pub mod api { #[doc = " be used in `build_state` method."] pub fn get_preset( &self, - id: types::get_preset::Id, + id: get_preset::Id, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::GetPreset, - types::get_preset::output::Output, + (get_preset::Id,), + get_preset::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "GenesisBuilder", "get_preset", - types::GetPreset { id }, + (id,), [ 43u8, 153u8, 23u8, 52u8, 113u8, 161u8, 227u8, 122u8, 169u8, 135u8, 119u8, 8u8, 128u8, 33u8, 143u8, 235u8, 13u8, 173u8, 58u8, 121u8, 178u8, @@ -4499,13 +3349,13 @@ pub mod api { pub fn preset_names( &self, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::PresetNames, - types::preset_names::output::Output, + (), + preset_names::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "GenesisBuilder", "preset_names", - types::PresetNames {}, + (), [ 150u8, 117u8, 54u8, 129u8, 221u8, 130u8, 186u8, 71u8, 13u8, 140u8, 77u8, 180u8, 141u8, 37u8, 22u8, 219u8, 149u8, 218u8, 186u8, 206u8, @@ -4515,80 +3365,37 @@ pub mod api { ) } } - pub mod types { + pub mod build_state { + use super::root_mod; use super::runtime_types; - pub mod build_state { + pub type Json = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub mod output { use super::runtime_types; - pub type Json = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - (), - ::subxt::ext::subxt_core::alloc::string::String, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct BuildState { - pub json: build_state::Json, + pub type Output = + ::core::result::Result<(), ::subxt::ext::subxt_core::alloc::string::String>; } - pub mod get_preset { + } + pub mod get_preset { + use super::root_mod; + use super::runtime_types; + pub type Id = + ::core::option::Option<::subxt::ext::subxt_core::alloc::string::String>; + pub mod output { use super::runtime_types; - pub type Id = - ::core::option::Option<::subxt::ext::subxt_core::alloc::string::String>; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct GetPreset { - pub id: get_preset::Id, + pub type Output = ::core::option::Option< + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; } - pub mod preset_names { + } + pub mod preset_names { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::string::String, - >; - } + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::alloc::string::String, + >; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct PresetNames {} } } pub mod trusted_query_api { @@ -4604,16 +3411,16 @@ pub mod api { #[doc = " * `location`: `VersionedLocation`."] pub fn is_trusted_reserve( &self, - asset: types::is_trusted_reserve::Asset, - location: types::is_trusted_reserve::Location, + asset: is_trusted_reserve::Asset, + location: is_trusted_reserve::Location, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::IsTrustedReserve, - types::is_trusted_reserve::output::Output, + (is_trusted_reserve::Asset, is_trusted_reserve::Location), + is_trusted_reserve::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "TrustedQueryApi", "is_trusted_reserve", - types::IsTrustedReserve { asset, location }, + (asset, location), [ 45u8, 87u8, 28u8, 66u8, 50u8, 121u8, 129u8, 188u8, 160u8, 192u8, 14u8, 205u8, 141u8, 223u8, 5u8, 125u8, 82u8, 180u8, 231u8, 162u8, 134u8, @@ -4628,16 +3435,19 @@ pub mod api { #[doc = " * `location`: `VersionedLocation`."] pub fn is_trusted_teleporter( &self, - asset: types::is_trusted_teleporter::Asset, - location: types::is_trusted_teleporter::Location, + asset: is_trusted_teleporter::Asset, + location: is_trusted_teleporter::Location, ) -> ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload< - types::IsTrustedTeleporter, - types::is_trusted_teleporter::output::Output, + ( + is_trusted_teleporter::Asset, + is_trusted_teleporter::Location, + ), + is_trusted_teleporter::output::Output, > { ::subxt::ext::subxt_core::runtime_api::payload::StaticPayload::new_static( "TrustedQueryApi", "is_trusted_teleporter", - types::IsTrustedTeleporter { asset, location }, + (asset, location), [ 1u8, 161u8, 124u8, 10u8, 170u8, 140u8, 226u8, 50u8, 114u8, 90u8, 61u8, 123u8, 58u8, 135u8, 75u8, 38u8, 140u8, 55u8, 177u8, 33u8, 38u8, 89u8, @@ -4646,61 +3456,30 @@ pub mod api { ) } } - pub mod types { + pub mod is_trusted_reserve { + use super::root_mod; use super::runtime_types; - pub mod is_trusted_reserve { + pub type Asset = runtime_types::xcm::VersionedAsset; + pub type Location = runtime_types::xcm::VersionedLocation; + pub mod output { use super::runtime_types; - pub type Asset = runtime_types::xcm::VersionedAsset; - pub type Location = runtime_types::xcm::VersionedLocation; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ::core::primitive::bool, - runtime_types::xcm_runtime_apis::trusted_query::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct IsTrustedReserve { - pub asset: is_trusted_reserve::Asset, - pub location: is_trusted_reserve::Location, + pub type Output = ::core::result::Result< + ::core::primitive::bool, + runtime_types::xcm_runtime_apis::trusted_query::Error, + >; } - pub mod is_trusted_teleporter { + } + pub mod is_trusted_teleporter { + use super::root_mod; + use super::runtime_types; + pub type Asset = runtime_types::xcm::VersionedAsset; + pub type Location = runtime_types::xcm::VersionedLocation; + pub mod output { use super::runtime_types; - pub type Asset = runtime_types::xcm::VersionedAsset; - pub type Location = runtime_types::xcm::VersionedLocation; - pub mod output { - use super::runtime_types; - pub type Output = ::core::result::Result< - ::core::primitive::bool, - runtime_types::xcm_runtime_apis::trusted_query::Error, - >; - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct IsTrustedTeleporter { - pub asset: is_trusted_teleporter::Asset, - pub location: is_trusted_teleporter::Location, + pub type Output = ::core::result::Result< + ::core::primitive::bool, + runtime_types::xcm_runtime_apis::trusted_query::Error, + >; } } } @@ -5205,9 +3984,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 247u8, 184u8, 4u8, 83u8, 250u8, 139u8, 220u8, 54u8, 188u8, 100u8, 241u8, 162u8, - 49u8, 144u8, 97u8, 91u8, 150u8, 244u8, 223u8, 238u8, 251u8, 164u8, 76u8, 5u8, - 163u8, 84u8, 46u8, 88u8, 91u8, 189u8, 113u8, 207u8, + 69u8, 189u8, 40u8, 46u8, 154u8, 179u8, 21u8, 77u8, 146u8, 225u8, 154u8, 179u8, + 31u8, 247u8, 135u8, 79u8, 75u8, 55u8, 139u8, 239u8, 139u8, 13u8, 164u8, 32u8, + 238u8, 182u8, 15u8, 160u8, 130u8, 83u8, 125u8, 127u8, ] } pub mod system { @@ -5904,151 +4683,25 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod account { - use super::runtime_types; - pub type Account = runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod extrinsic_count { - use super::runtime_types; - pub type ExtrinsicCount = ::core::primitive::u32; - } - pub mod inherents_applied { - use super::runtime_types; - pub type InherentsApplied = ::core::primitive::bool; - } - pub mod block_weight { - use super::runtime_types; - pub type BlockWeight = runtime_types::frame_support::dispatch::PerDispatchClass< - runtime_types::sp_weights::weight_v2::Weight, - >; - } - pub mod all_extrinsics_len { - use super::runtime_types; - pub type AllExtrinsicsLen = ::core::primitive::u32; - } - pub mod block_hash { - use super::runtime_types; - pub type BlockHash = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u32; - } - pub mod extrinsic_data { - use super::runtime_types; - pub type ExtrinsicData = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Param0 = ::core::primitive::u32; - } - pub mod number { - use super::runtime_types; - pub type Number = ::core::primitive::u32; - } - pub mod parent_hash { - use super::runtime_types; - pub type ParentHash = ::subxt::ext::subxt_core::utils::H256; - } - pub mod digest { - use super::runtime_types; - pub type Digest = runtime_types::sp_runtime::generic::digest::Digest; - } - pub mod events { - use super::runtime_types; - pub type Events = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::rococo_runtime::RuntimeEvent, - ::subxt::ext::subxt_core::utils::H256, - >, - >; - } - pub mod event_count { - use super::runtime_types; - pub type EventCount = ::core::primitive::u32; - } - pub mod event_topics { - use super::runtime_types; - pub type EventTopics = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - ::core::primitive::u32, - )>; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - pub mod last_runtime_upgrade { - use super::runtime_types; - pub type LastRuntimeUpgrade = - runtime_types::frame_system::LastRuntimeUpgradeInfo; - } - pub mod upgraded_to_u32_ref_count { - use super::runtime_types; - pub type UpgradedToU32RefCount = ::core::primitive::bool; - } - pub mod upgraded_to_triple_ref_count { - use super::runtime_types; - pub type UpgradedToTripleRefCount = ::core::primitive::bool; - } - pub mod execution_phase { - use super::runtime_types; - pub type ExecutionPhase = runtime_types::frame_system::Phase; - } - pub mod authorized_upgrade { - use super::runtime_types; - pub type AuthorizedUpgrade = - runtime_types::frame_system::CodeUpgradeAuthorization; - } - pub mod extrinsic_weight_reclaimed { - use super::runtime_types; - pub type ExtrinsicWeightReclaimed = - runtime_types::sp_weights::weight_v2::Weight; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The full account information for a particular account ID."] - pub fn account_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::account::Account, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "System", - "Account", - (), - [ - 14u8, 233u8, 115u8, 214u8, 0u8, 109u8, 222u8, 121u8, 162u8, 65u8, 60u8, - 175u8, 209u8, 79u8, 222u8, 124u8, 22u8, 235u8, 138u8, 176u8, 133u8, - 124u8, 90u8, 158u8, 85u8, 45u8, 37u8, 174u8, 47u8, 79u8, 47u8, 166u8, - ], - ) - } #[doc = " The full account information for a particular account ID."] pub fn account( &self, - _0: types::account::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, - >, - types::account::Account, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (account::Param0,), + account::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "Account", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 14u8, 233u8, 115u8, 214u8, 0u8, 109u8, 222u8, 121u8, 162u8, 65u8, 60u8, - 175u8, 209u8, 79u8, 222u8, 124u8, 22u8, 235u8, 138u8, 176u8, 133u8, - 124u8, 90u8, 158u8, 85u8, 45u8, 37u8, 174u8, 47u8, 79u8, 47u8, 166u8, + 181u8, 49u8, 172u8, 169u8, 233u8, 186u8, 227u8, 180u8, 188u8, 130u8, + 4u8, 70u8, 12u8, 226u8, 233u8, 72u8, 145u8, 59u8, 210u8, 78u8, 48u8, + 177u8, 203u8, 27u8, 216u8, 196u8, 244u8, 208u8, 26u8, 34u8, 13u8, 50u8, ], ) } @@ -6057,20 +4710,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::extrinsic_count::ExtrinsicCount, + extrinsic_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "ExtrinsicCount", - (), [ - 102u8, 76u8, 236u8, 42u8, 40u8, 231u8, 33u8, 222u8, 123u8, 147u8, - 153u8, 148u8, 234u8, 203u8, 181u8, 119u8, 6u8, 187u8, 177u8, 199u8, - 120u8, 47u8, 137u8, 254u8, 96u8, 100u8, 165u8, 182u8, 249u8, 230u8, - 159u8, 79u8, + 217u8, 77u8, 146u8, 117u8, 157u8, 10u8, 137u8, 158u8, 27u8, 206u8, + 129u8, 195u8, 192u8, 141u8, 178u8, 6u8, 39u8, 199u8, 156u8, 101u8, + 60u8, 4u8, 166u8, 244u8, 193u8, 255u8, 148u8, 199u8, 83u8, 157u8, 67u8, + 193u8, ], ) } @@ -6079,19 +4729,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::inherents_applied::InherentsApplied, + inherents_applied::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "InherentsApplied", - (), [ - 132u8, 249u8, 142u8, 252u8, 8u8, 103u8, 80u8, 120u8, 50u8, 6u8, 188u8, - 223u8, 101u8, 55u8, 165u8, 189u8, 172u8, 249u8, 165u8, 230u8, 183u8, - 109u8, 34u8, 65u8, 185u8, 150u8, 29u8, 8u8, 186u8, 129u8, 135u8, 239u8, + 18u8, 210u8, 88u8, 91u8, 207u8, 11u8, 44u8, 234u8, 226u8, 71u8, 52u8, + 99u8, 125u8, 73u8, 149u8, 37u8, 57u8, 70u8, 39u8, 156u8, 159u8, 16u8, + 174u8, 10u8, 101u8, 172u8, 44u8, 61u8, 160u8, 139u8, 148u8, 113u8, ], ) } @@ -6100,19 +4747,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::block_weight::BlockWeight, + block_weight::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "BlockWeight", - (), [ - 158u8, 46u8, 228u8, 89u8, 210u8, 214u8, 84u8, 154u8, 50u8, 68u8, 63u8, - 62u8, 43u8, 42u8, 99u8, 27u8, 54u8, 42u8, 146u8, 44u8, 241u8, 216u8, - 229u8, 30u8, 216u8, 255u8, 165u8, 238u8, 181u8, 130u8, 36u8, 102u8, + 30u8, 69u8, 207u8, 199u8, 27u8, 245u8, 128u8, 231u8, 49u8, 94u8, 194u8, + 254u8, 18u8, 97u8, 20u8, 94u8, 12u8, 245u8, 93u8, 39u8, 34u8, 216u8, + 49u8, 39u8, 128u8, 139u8, 230u8, 83u8, 10u8, 42u8, 195u8, 115u8, ], ) } @@ -6121,112 +4765,53 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::all_extrinsics_len::AllExtrinsicsLen, + all_extrinsics_len::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "AllExtrinsicsLen", - (), [ - 117u8, 86u8, 61u8, 243u8, 41u8, 51u8, 102u8, 214u8, 137u8, 100u8, - 243u8, 185u8, 122u8, 174u8, 187u8, 117u8, 86u8, 189u8, 63u8, 135u8, - 101u8, 218u8, 203u8, 201u8, 237u8, 254u8, 128u8, 183u8, 169u8, 221u8, - 242u8, 65u8, - ], - ) - } - #[doc = " Map of block numbers to block hashes."] - pub fn block_hash_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::block_hash::BlockHash, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "System", - "BlockHash", - (), - [ - 217u8, 32u8, 215u8, 253u8, 24u8, 182u8, 207u8, 178u8, 157u8, 24u8, - 103u8, 100u8, 195u8, 165u8, 69u8, 152u8, 112u8, 181u8, 56u8, 192u8, - 164u8, 16u8, 20u8, 222u8, 28u8, 214u8, 144u8, 142u8, 146u8, 69u8, - 202u8, 118u8, + 120u8, 200u8, 84u8, 67u8, 97u8, 25u8, 119u8, 71u8, 170u8, 217u8, 12u8, + 157u8, 63u8, 100u8, 245u8, 118u8, 99u8, 65u8, 148u8, 110u8, 252u8, + 86u8, 172u8, 45u8, 235u8, 90u8, 58u8, 123u8, 59u8, 191u8, 1u8, 215u8, ], ) } #[doc = " Map of block numbers to block hashes."] pub fn block_hash( &self, - _0: types::block_hash::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::block_hash::Param0, - >, - types::block_hash::BlockHash, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (block_hash::Param0,), + block_hash::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "BlockHash", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 217u8, 32u8, 215u8, 253u8, 24u8, 182u8, 207u8, 178u8, 157u8, 24u8, - 103u8, 100u8, 195u8, 165u8, 69u8, 152u8, 112u8, 181u8, 56u8, 192u8, - 164u8, 16u8, 20u8, 222u8, 28u8, 214u8, 144u8, 142u8, 146u8, 69u8, - 202u8, 118u8, - ], - ) - } - #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] - pub fn extrinsic_data_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::extrinsic_data::ExtrinsicData, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "System", - "ExtrinsicData", - (), [ - 160u8, 180u8, 122u8, 18u8, 196u8, 26u8, 2u8, 37u8, 115u8, 232u8, 133u8, - 220u8, 106u8, 245u8, 4u8, 129u8, 42u8, 84u8, 241u8, 45u8, 199u8, 179u8, - 128u8, 61u8, 170u8, 137u8, 231u8, 156u8, 247u8, 57u8, 47u8, 38u8, + 251u8, 175u8, 179u8, 11u8, 47u8, 25u8, 43u8, 165u8, 168u8, 224u8, 35u8, + 57u8, 49u8, 93u8, 29u8, 47u8, 145u8, 113u8, 84u8, 200u8, 186u8, 21u8, + 22u8, 102u8, 126u8, 233u8, 10u8, 131u8, 47u8, 32u8, 165u8, 194u8, ], ) } #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] pub fn extrinsic_data( &self, - _0: types::extrinsic_data::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::extrinsic_data::Param0, - >, - types::extrinsic_data::ExtrinsicData, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (extrinsic_data::Param0,), + extrinsic_data::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "ExtrinsicData", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 160u8, 180u8, 122u8, 18u8, 196u8, 26u8, 2u8, 37u8, 115u8, 232u8, 133u8, - 220u8, 106u8, 245u8, 4u8, 129u8, 42u8, 84u8, 241u8, 45u8, 199u8, 179u8, - 128u8, 61u8, 170u8, 137u8, 231u8, 156u8, 247u8, 57u8, 47u8, 38u8, + 223u8, 197u8, 229u8, 38u8, 179u8, 46u8, 153u8, 107u8, 35u8, 131u8, + 71u8, 231u8, 213u8, 198u8, 141u8, 55u8, 2u8, 75u8, 114u8, 159u8, 0u8, + 16u8, 128u8, 190u8, 177u8, 92u8, 225u8, 213u8, 48u8, 167u8, 29u8, + 121u8, ], ) } @@ -6235,19 +4820,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::number::Number, + number::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "Number", - (), [ - 30u8, 194u8, 177u8, 90u8, 194u8, 232u8, 46u8, 180u8, 85u8, 129u8, 14u8, - 9u8, 8u8, 8u8, 23u8, 95u8, 230u8, 5u8, 13u8, 105u8, 125u8, 2u8, 22u8, - 200u8, 78u8, 93u8, 115u8, 28u8, 150u8, 113u8, 48u8, 53u8, + 93u8, 185u8, 195u8, 173u8, 19u8, 1u8, 39u8, 245u8, 243u8, 67u8, 228u8, + 232u8, 25u8, 15u8, 14u8, 109u8, 225u8, 34u8, 17u8, 110u8, 25u8, 154u8, + 149u8, 46u8, 184u8, 208u8, 79u8, 254u8, 166u8, 168u8, 33u8, 173u8, ], ) } @@ -6256,19 +4838,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::parent_hash::ParentHash, - ::subxt::ext::subxt_core::utils::Yes, + parent_hash::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "ParentHash", - (), [ - 26u8, 130u8, 11u8, 216u8, 155u8, 71u8, 128u8, 170u8, 30u8, 153u8, 21u8, - 192u8, 62u8, 93u8, 137u8, 80u8, 120u8, 81u8, 202u8, 94u8, 248u8, 125u8, - 71u8, 82u8, 141u8, 229u8, 32u8, 56u8, 73u8, 50u8, 101u8, 78u8, + 252u8, 127u8, 135u8, 108u8, 14u8, 75u8, 71u8, 121u8, 36u8, 231u8, 44u8, + 64u8, 49u8, 246u8, 24u8, 49u8, 202u8, 229u8, 242u8, 74u8, 206u8, 65u8, + 78u8, 207u8, 12u8, 118u8, 33u8, 42u8, 130u8, 233u8, 33u8, 136u8, ], ) } @@ -6277,19 +4856,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::digest::Digest, + digest::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "Digest", - (), [ - 61u8, 64u8, 237u8, 91u8, 145u8, 232u8, 17u8, 254u8, 181u8, 16u8, 234u8, - 91u8, 51u8, 140u8, 254u8, 131u8, 98u8, 135u8, 21u8, 37u8, 251u8, 20u8, - 58u8, 92u8, 123u8, 141u8, 14u8, 227u8, 146u8, 46u8, 222u8, 117u8, + 137u8, 44u8, 198u8, 131u8, 117u8, 17u8, 114u8, 93u8, 213u8, 123u8, + 212u8, 55u8, 43u8, 34u8, 114u8, 86u8, 39u8, 18u8, 189u8, 157u8, 27u8, + 157u8, 155u8, 159u8, 147u8, 41u8, 138u8, 195u8, 20u8, 204u8, 110u8, + 53u8, ], ) } @@ -6304,20 +4881,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::events::Events, - ::subxt::ext::subxt_core::utils::Yes, + events::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "Events", - (), [ - 227u8, 154u8, 253u8, 34u8, 14u8, 17u8, 224u8, 168u8, 194u8, 239u8, - 139u8, 48u8, 192u8, 250u8, 255u8, 195u8, 112u8, 45u8, 69u8, 133u8, - 232u8, 33u8, 96u8, 177u8, 116u8, 196u8, 172u8, 65u8, 211u8, 199u8, - 103u8, 130u8, + 184u8, 245u8, 2u8, 103u8, 225u8, 93u8, 130u8, 232u8, 50u8, 145u8, 56u8, + 109u8, 234u8, 20u8, 64u8, 155u8, 15u8, 131u8, 58u8, 18u8, 151u8, 22u8, + 4u8, 229u8, 27u8, 220u8, 97u8, 209u8, 198u8, 215u8, 81u8, 104u8, ], ) } @@ -6326,50 +4899,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::event_count::EventCount, + event_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "EventCount", - (), - [ - 175u8, 24u8, 252u8, 184u8, 210u8, 167u8, 146u8, 143u8, 164u8, 80u8, - 151u8, 205u8, 189u8, 189u8, 55u8, 220u8, 47u8, 101u8, 181u8, 33u8, - 254u8, 131u8, 13u8, 143u8, 3u8, 244u8, 245u8, 45u8, 2u8, 210u8, 79u8, - 133u8, - ], - ) - } - #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] - #[doc = " of events in the `>` list."] - #[doc = ""] - #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] - #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] - #[doc = " in case of changes fetch the list of events of interest."] - #[doc = ""] - #[doc = " The value has the type `(BlockNumberFor, EventIndex)` because if we used only just"] - #[doc = " the `EventIndex` then in case if the topic has the same contents on the next block"] - #[doc = " no notification will be triggered thus the event might be lost."] - pub fn event_topics_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::event_topics::EventTopics, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "System", - "EventTopics", - (), [ - 40u8, 225u8, 14u8, 75u8, 44u8, 176u8, 76u8, 34u8, 143u8, 107u8, 69u8, - 133u8, 114u8, 13u8, 172u8, 250u8, 141u8, 73u8, 12u8, 65u8, 217u8, 63u8, - 120u8, 241u8, 48u8, 106u8, 143u8, 161u8, 128u8, 100u8, 166u8, 59u8, + 32u8, 54u8, 196u8, 23u8, 224u8, 204u8, 158u8, 79u8, 151u8, 46u8, 107u8, + 24u8, 120u8, 90u8, 137u8, 234u8, 64u8, 92u8, 174u8, 25u8, 152u8, 22u8, + 24u8, 245u8, 243u8, 212u8, 148u8, 149u8, 122u8, 171u8, 92u8, 140u8, ], ) } @@ -6385,24 +4924,18 @@ pub mod api { #[doc = " no notification will be triggered thus the event might be lost."] pub fn event_topics( &self, - _0: types::event_topics::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::event_topics::Param0, - >, - types::event_topics::EventTopics, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (event_topics::Param0,), + event_topics::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "EventTopics", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 40u8, 225u8, 14u8, 75u8, 44u8, 176u8, 76u8, 34u8, 143u8, 107u8, 69u8, - 133u8, 114u8, 13u8, 172u8, 250u8, 141u8, 73u8, 12u8, 65u8, 217u8, 63u8, - 120u8, 241u8, 48u8, 106u8, 143u8, 161u8, 128u8, 100u8, 166u8, 59u8, + 91u8, 29u8, 70u8, 62u8, 102u8, 127u8, 50u8, 42u8, 122u8, 136u8, 211u8, + 187u8, 165u8, 1u8, 82u8, 213u8, 58u8, 154u8, 239u8, 26u8, 213u8, 120u8, + 8u8, 179u8, 2u8, 134u8, 90u8, 241u8, 163u8, 199u8, 98u8, 94u8, ], ) } @@ -6411,20 +4944,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::last_runtime_upgrade::LastRuntimeUpgrade, + last_runtime_upgrade::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "LastRuntimeUpgrade", - (), [ - 197u8, 212u8, 249u8, 209u8, 79u8, 34u8, 55u8, 203u8, 31u8, 42u8, 199u8, - 242u8, 188u8, 74u8, 234u8, 250u8, 245u8, 44u8, 139u8, 162u8, 45u8, - 150u8, 230u8, 249u8, 135u8, 100u8, 158u8, 167u8, 118u8, 219u8, 28u8, - 98u8, + 239u8, 183u8, 167u8, 75u8, 149u8, 166u8, 239u8, 31u8, 200u8, 140u8, + 61u8, 169u8, 227u8, 186u8, 101u8, 14u8, 78u8, 101u8, 19u8, 86u8, 128u8, + 203u8, 250u8, 97u8, 210u8, 179u8, 96u8, 191u8, 226u8, 225u8, 32u8, + 212u8, ], ) } @@ -6433,19 +4963,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::upgraded_to_u32_ref_count::UpgradedToU32RefCount, + upgraded_to_u32_ref_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "UpgradedToU32RefCount", - (), [ - 229u8, 73u8, 9u8, 132u8, 186u8, 116u8, 151u8, 171u8, 145u8, 29u8, 34u8, - 130u8, 52u8, 146u8, 124u8, 175u8, 79u8, 189u8, 147u8, 230u8, 234u8, - 107u8, 124u8, 31u8, 2u8, 22u8, 86u8, 190u8, 4u8, 147u8, 50u8, 245u8, + 121u8, 56u8, 110u8, 113u8, 59u8, 171u8, 213u8, 125u8, 149u8, 111u8, + 171u8, 66u8, 48u8, 0u8, 129u8, 158u8, 118u8, 33u8, 255u8, 236u8, 109u8, + 47u8, 123u8, 153u8, 40u8, 25u8, 16u8, 60u8, 248u8, 5u8, 94u8, 235u8, ], ) } @@ -6455,20 +4982,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::upgraded_to_triple_ref_count::UpgradedToTripleRefCount, + upgraded_to_triple_ref_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "UpgradedToTripleRefCount", - (), [ - 97u8, 66u8, 124u8, 243u8, 27u8, 167u8, 147u8, 81u8, 254u8, 201u8, - 101u8, 24u8, 40u8, 231u8, 14u8, 179u8, 154u8, 163u8, 71u8, 81u8, 185u8, - 167u8, 82u8, 254u8, 189u8, 3u8, 101u8, 207u8, 206u8, 194u8, 155u8, - 151u8, + 21u8, 68u8, 180u8, 14u8, 122u8, 62u8, 230u8, 35u8, 163u8, 50u8, 98u8, + 110u8, 27u8, 46u8, 205u8, 112u8, 29u8, 175u8, 250u8, 160u8, 76u8, + 139u8, 10u8, 64u8, 158u8, 114u8, 176u8, 180u8, 252u8, 66u8, 6u8, 103u8, ], ) } @@ -6477,19 +5000,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::execution_phase::ExecutionPhase, + execution_phase::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "ExecutionPhase", - (), [ - 191u8, 129u8, 100u8, 134u8, 126u8, 116u8, 154u8, 203u8, 220u8, 200u8, - 0u8, 26u8, 161u8, 250u8, 133u8, 205u8, 146u8, 24u8, 5u8, 156u8, 158u8, - 35u8, 36u8, 253u8, 52u8, 235u8, 86u8, 167u8, 35u8, 100u8, 119u8, 27u8, + 73u8, 148u8, 64u8, 200u8, 68u8, 224u8, 56u8, 2u8, 224u8, 156u8, 197u8, + 124u8, 8u8, 173u8, 3u8, 36u8, 146u8, 33u8, 219u8, 205u8, 36u8, 89u8, + 99u8, 231u8, 208u8, 2u8, 236u8, 254u8, 254u8, 108u8, 65u8, 68u8, ], ) } @@ -6498,19 +5018,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::authorized_upgrade::AuthorizedUpgrade, + authorized_upgrade::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "AuthorizedUpgrade", - (), [ - 165u8, 97u8, 27u8, 138u8, 2u8, 28u8, 55u8, 92u8, 96u8, 96u8, 168u8, - 169u8, 55u8, 178u8, 44u8, 127u8, 58u8, 140u8, 206u8, 178u8, 1u8, 37u8, - 214u8, 213u8, 251u8, 123u8, 5u8, 111u8, 90u8, 148u8, 217u8, 135u8, + 227u8, 212u8, 35u8, 221u8, 172u8, 87u8, 76u8, 244u8, 15u8, 213u8, 25u8, + 209u8, 213u8, 3u8, 230u8, 224u8, 81u8, 7u8, 62u8, 238u8, 51u8, 158u8, + 221u8, 35u8, 1u8, 5u8, 213u8, 142u8, 140u8, 206u8, 216u8, 214u8, ], ) } @@ -6525,24 +5042,191 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::extrinsic_weight_reclaimed::ExtrinsicWeightReclaimed, + extrinsic_weight_reclaimed::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "System", "ExtrinsicWeightReclaimed", - (), [ - 195u8, 143u8, 164u8, 84u8, 225u8, 194u8, 227u8, 128u8, 196u8, 241u8, - 188u8, 159u8, 59u8, 197u8, 11u8, 12u8, 119u8, 164u8, 46u8, 229u8, 92u8, - 212u8, 236u8, 255u8, 238u8, 54u8, 105u8, 200u8, 229u8, 191u8, 221u8, - 202u8, + 205u8, 30u8, 170u8, 39u8, 212u8, 71u8, 90u8, 173u8, 142u8, 127u8, + 164u8, 223u8, 113u8, 224u8, 161u8, 109u8, 102u8, 241u8, 4u8, 225u8, + 105u8, 163u8, 161u8, 96u8, 69u8, 178u8, 77u8, 154u8, 222u8, 83u8, + 106u8, 175u8, ], ) } } + pub mod account { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>, + >; + } + } + pub mod extrinsic_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod inherents_applied { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + pub mod block_weight { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::frame_support::dispatch::PerDispatchClass< + runtime_types::sp_weights::weight_v2::Weight, + >; + } + } + pub mod all_extrinsics_len { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod block_hash { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } + pub mod extrinsic_data { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + } + pub mod number { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod parent_hash { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } + pub mod digest { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_runtime::generic::digest::Digest; + } + } + pub mod events { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::frame_system::EventRecord< + runtime_types::rococo_runtime::RuntimeEvent, + ::subxt::ext::subxt_core::utils::H256, + >, + >; + } + } + pub mod event_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod event_topics { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + ::core::primitive::u32, + )>; + } + } + pub mod last_runtime_upgrade { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::frame_system::LastRuntimeUpgradeInfo; + } + } + pub mod upgraded_to_u32_ref_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + pub mod upgraded_to_triple_ref_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + pub mod execution_phase { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::frame_system::Phase; + } + } + pub mod authorized_upgrade { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::frame_system::CodeUpgradeAuthorization; + } + } + pub mod extrinsic_weight_reclaimed { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_weights::weight_v2::Weight; + } + } } pub mod constants { use super::runtime_types; @@ -6854,99 +5538,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod epoch_index { - use super::runtime_types; - pub type EpochIndex = ::core::primitive::u64; - } - pub mod authorities { - use super::runtime_types; - pub type Authorities = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>; - } - pub mod genesis_slot { - use super::runtime_types; - pub type GenesisSlot = runtime_types::sp_consensus_slots::Slot; - } - pub mod current_slot { - use super::runtime_types; - pub type CurrentSlot = runtime_types::sp_consensus_slots::Slot; - } - pub mod randomness { - use super::runtime_types; - pub type Randomness = [::core::primitive::u8; 32usize]; - } - pub mod pending_epoch_config_change { - use super::runtime_types; - pub type PendingEpochConfigChange = - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; - } - pub mod next_randomness { - use super::runtime_types; - pub type NextRandomness = [::core::primitive::u8; 32usize]; - } - pub mod next_authorities { - use super::runtime_types; - pub type NextAuthorities = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>; - } - pub mod segment_index { - use super::runtime_types; - pub type SegmentIndex = ::core::primitive::u32; - } - pub mod under_construction { - use super::runtime_types; - pub type UnderConstruction = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod initialized { - use super::runtime_types; - pub type Initialized = ::core::option::Option< - runtime_types::sp_consensus_babe::digests::PreDigest, - >; - } - pub mod author_vrf_randomness { - use super::runtime_types; - pub type AuthorVrfRandomness = - ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - pub mod epoch_start { - use super::runtime_types; - pub type EpochStart = (::core::primitive::u32, ::core::primitive::u32); - } - pub mod lateness { - use super::runtime_types; - pub type Lateness = ::core::primitive::u32; - } - pub mod epoch_config { - use super::runtime_types; - pub type EpochConfig = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - } - pub mod next_epoch_config { - use super::runtime_types; - pub type NextEpochConfig = - runtime_types::sp_consensus_babe::BabeEpochConfiguration; - } - pub mod skipped_epochs { - use super::runtime_types; - pub type SkippedEpochs = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u64, - ::core::primitive::u32, - )>; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Current epoch index."] @@ -6954,20 +5547,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::epoch_index::EpochIndex, + epoch_index::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "EpochIndex", - (), [ - 32u8, 82u8, 130u8, 31u8, 190u8, 162u8, 237u8, 189u8, 104u8, 244u8, - 30u8, 199u8, 179u8, 0u8, 161u8, 107u8, 72u8, 240u8, 201u8, 222u8, - 177u8, 222u8, 35u8, 156u8, 81u8, 132u8, 162u8, 118u8, 238u8, 84u8, - 112u8, 89u8, + 199u8, 174u8, 50u8, 170u8, 3u8, 138u8, 111u8, 254u8, 63u8, 33u8, 225u8, + 189u8, 27u8, 220u8, 40u8, 8u8, 115u8, 33u8, 23u8, 105u8, 45u8, 235u8, + 246u8, 253u8, 144u8, 100u8, 95u8, 116u8, 161u8, 121u8, 29u8, 233u8, ], ) } @@ -6976,20 +5565,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::authorities::Authorities, - ::subxt::ext::subxt_core::utils::Yes, + authorities::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "Authorities", - (), [ - 192u8, 157u8, 98u8, 244u8, 104u8, 38u8, 195u8, 114u8, 183u8, 62u8, - 247u8, 18u8, 31u8, 152u8, 246u8, 206u8, 97u8, 13u8, 118u8, 211u8, - 104u8, 54u8, 150u8, 152u8, 126u8, 170u8, 228u8, 158u8, 108u8, 129u8, - 134u8, 44u8, + 210u8, 230u8, 47u8, 62u8, 255u8, 111u8, 43u8, 183u8, 246u8, 15u8, 54u8, + 24u8, 160u8, 228u8, 106u8, 168u8, 219u8, 241u8, 231u8, 234u8, 54u8, + 109u8, 72u8, 4u8, 76u8, 205u8, 130u8, 30u8, 150u8, 46u8, 5u8, 147u8, ], ) } @@ -6999,20 +5584,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::genesis_slot::GenesisSlot, + genesis_slot::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "GenesisSlot", - (), [ - 218u8, 174u8, 152u8, 76u8, 188u8, 214u8, 7u8, 88u8, 253u8, 187u8, - 139u8, 234u8, 51u8, 28u8, 220u8, 57u8, 73u8, 1u8, 18u8, 205u8, 80u8, - 160u8, 120u8, 216u8, 139u8, 191u8, 100u8, 108u8, 162u8, 106u8, 175u8, - 107u8, + 148u8, 46u8, 130u8, 251u8, 196u8, 221u8, 251u8, 103u8, 92u8, 76u8, + 212u8, 188u8, 123u8, 139u8, 157u8, 214u8, 143u8, 175u8, 34u8, 181u8, + 131u8, 136u8, 230u8, 214u8, 8u8, 99u8, 111u8, 181u8, 173u8, 32u8, 69u8, + 198u8, ], ) } @@ -7021,20 +5603,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::current_slot::CurrentSlot, - ::subxt::ext::subxt_core::utils::Yes, + current_slot::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "CurrentSlot", - (), [ - 112u8, 199u8, 115u8, 248u8, 217u8, 242u8, 45u8, 231u8, 178u8, 53u8, - 236u8, 167u8, 219u8, 238u8, 81u8, 243u8, 39u8, 140u8, 68u8, 19u8, - 201u8, 169u8, 211u8, 133u8, 135u8, 213u8, 150u8, 105u8, 60u8, 252u8, - 43u8, 57u8, + 43u8, 143u8, 102u8, 240u8, 243u8, 39u8, 191u8, 181u8, 112u8, 100u8, + 100u8, 92u8, 169u8, 252u8, 192u8, 187u8, 231u8, 43u8, 235u8, 136u8, + 116u8, 180u8, 82u8, 36u8, 140u8, 92u8, 203u8, 143u8, 4u8, 90u8, 86u8, + 13u8, ], ) } @@ -7052,20 +5631,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::randomness::Randomness, - ::subxt::ext::subxt_core::utils::Yes, + randomness::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "Randomness", - (), [ - 36u8, 15u8, 52u8, 73u8, 195u8, 177u8, 186u8, 125u8, 134u8, 11u8, 103u8, - 248u8, 170u8, 237u8, 105u8, 239u8, 168u8, 204u8, 147u8, 52u8, 15u8, - 226u8, 126u8, 176u8, 133u8, 186u8, 169u8, 241u8, 156u8, 118u8, 67u8, - 58u8, + 105u8, 100u8, 137u8, 60u8, 72u8, 202u8, 114u8, 204u8, 244u8, 169u8, + 188u8, 210u8, 165u8, 180u8, 153u8, 184u8, 237u8, 58u8, 199u8, 58u8, + 178u8, 62u8, 97u8, 114u8, 39u8, 249u8, 247u8, 153u8, 138u8, 228u8, + 226u8, 230u8, ], ) } @@ -7074,19 +5650,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::pending_epoch_config_change::PendingEpochConfigChange, + pending_epoch_config_change::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "PendingEpochConfigChange", - (), [ - 79u8, 216u8, 84u8, 210u8, 83u8, 149u8, 122u8, 160u8, 159u8, 164u8, - 16u8, 134u8, 154u8, 104u8, 77u8, 254u8, 139u8, 18u8, 163u8, 59u8, 92u8, - 9u8, 135u8, 141u8, 147u8, 86u8, 44u8, 95u8, 183u8, 101u8, 11u8, 58u8, + 46u8, 117u8, 173u8, 240u8, 51u8, 167u8, 99u8, 172u8, 221u8, 13u8, 1u8, + 58u8, 112u8, 84u8, 240u8, 58u8, 91u8, 189u8, 2u8, 19u8, 254u8, 197u8, + 135u8, 160u8, 112u8, 91u8, 54u8, 233u8, 80u8, 241u8, 221u8, 171u8, ], ) } @@ -7095,19 +5668,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_randomness::NextRandomness, + next_randomness::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "NextRandomness", - (), [ - 96u8, 191u8, 139u8, 171u8, 144u8, 92u8, 33u8, 58u8, 23u8, 219u8, 164u8, - 121u8, 59u8, 209u8, 112u8, 244u8, 50u8, 8u8, 14u8, 244u8, 103u8, 125u8, - 120u8, 210u8, 16u8, 250u8, 54u8, 192u8, 72u8, 8u8, 219u8, 152u8, + 228u8, 29u8, 70u8, 83u8, 152u8, 152u8, 213u8, 83u8, 61u8, 3u8, 241u8, + 42u8, 136u8, 23u8, 195u8, 159u8, 0u8, 107u8, 225u8, 226u8, 82u8, 40u8, + 245u8, 3u8, 102u8, 131u8, 205u8, 106u8, 173u8, 150u8, 158u8, 202u8, ], ) } @@ -7116,19 +5686,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_authorities::NextAuthorities, - ::subxt::ext::subxt_core::utils::Yes, + next_authorities::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "NextAuthorities", - (), [ - 29u8, 161u8, 79u8, 221u8, 198u8, 101u8, 11u8, 17u8, 20u8, 17u8, 225u8, - 144u8, 35u8, 150u8, 241u8, 190u8, 106u8, 32u8, 230u8, 14u8, 212u8, - 126u8, 1u8, 96u8, 73u8, 173u8, 245u8, 39u8, 153u8, 33u8, 205u8, 174u8, + 48u8, 197u8, 203u8, 204u8, 3u8, 212u8, 48u8, 129u8, 59u8, 169u8, 18u8, + 132u8, 214u8, 200u8, 234u8, 179u8, 169u8, 4u8, 233u8, 237u8, 216u8, + 20u8, 4u8, 92u8, 82u8, 106u8, 59u8, 175u8, 86u8, 35u8, 65u8, 118u8, ], ) } @@ -7145,65 +5712,34 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::segment_index::SegmentIndex, - ::subxt::ext::subxt_core::utils::Yes, + segment_index::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "SegmentIndex", - (), [ - 145u8, 91u8, 142u8, 240u8, 184u8, 94u8, 68u8, 52u8, 130u8, 3u8, 75u8, - 175u8, 155u8, 130u8, 66u8, 9u8, 150u8, 242u8, 123u8, 111u8, 124u8, - 241u8, 100u8, 128u8, 220u8, 133u8, 96u8, 227u8, 164u8, 241u8, 170u8, - 34u8, - ], - ) - } - #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] - pub fn under_construction_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::under_construction::UnderConstruction, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Babe", - "UnderConstruction", - (), - [ - 120u8, 120u8, 59u8, 247u8, 50u8, 6u8, 220u8, 14u8, 2u8, 76u8, 203u8, - 244u8, 232u8, 144u8, 253u8, 191u8, 101u8, 35u8, 99u8, 85u8, 111u8, - 168u8, 31u8, 110u8, 187u8, 124u8, 72u8, 32u8, 43u8, 66u8, 8u8, 215u8, + 43u8, 105u8, 146u8, 94u8, 243u8, 116u8, 26u8, 214u8, 111u8, 34u8, 96u8, + 205u8, 166u8, 12u8, 249u8, 29u8, 177u8, 207u8, 164u8, 92u8, 231u8, + 67u8, 228u8, 255u8, 102u8, 190u8, 5u8, 232u8, 9u8, 111u8, 112u8, 6u8, ], ) } #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] pub fn under_construction( &self, - _0: types::under_construction::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::under_construction::Param0, - >, - types::under_construction::UnderConstruction, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (under_construction::Param0,), + under_construction::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "UnderConstruction", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 120u8, 120u8, 59u8, 247u8, 50u8, 6u8, 220u8, 14u8, 2u8, 76u8, 203u8, - 244u8, 232u8, 144u8, 253u8, 191u8, 101u8, 35u8, 99u8, 85u8, 111u8, - 168u8, 31u8, 110u8, 187u8, 124u8, 72u8, 32u8, 43u8, 66u8, 8u8, 215u8, + 136u8, 38u8, 3u8, 22u8, 161u8, 51u8, 125u8, 127u8, 175u8, 229u8, 185u8, + 237u8, 98u8, 36u8, 150u8, 4u8, 72u8, 56u8, 182u8, 46u8, 37u8, 28u8, + 111u8, 138u8, 136u8, 75u8, 156u8, 86u8, 200u8, 70u8, 111u8, 146u8, ], ) } @@ -7213,20 +5749,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::initialized::Initialized, + initialized::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "Initialized", - (), [ - 169u8, 217u8, 237u8, 78u8, 186u8, 202u8, 206u8, 213u8, 54u8, 85u8, - 206u8, 166u8, 22u8, 138u8, 236u8, 60u8, 211u8, 169u8, 12u8, 183u8, - 23u8, 69u8, 194u8, 236u8, 112u8, 21u8, 62u8, 219u8, 92u8, 131u8, 134u8, - 145u8, + 42u8, 170u8, 207u8, 60u8, 246u8, 114u8, 114u8, 255u8, 211u8, 29u8, + 51u8, 51u8, 159u8, 184u8, 30u8, 194u8, 59u8, 187u8, 232u8, 147u8, + 178u8, 67u8, 67u8, 169u8, 160u8, 43u8, 26u8, 206u8, 178u8, 28u8, 193u8, + 125u8, ], ) } @@ -7238,20 +5771,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::author_vrf_randomness::AuthorVrfRandomness, + author_vrf_randomness::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "AuthorVrfRandomness", - (), [ - 160u8, 157u8, 62u8, 48u8, 196u8, 136u8, 63u8, 132u8, 155u8, 183u8, - 91u8, 201u8, 146u8, 29u8, 192u8, 142u8, 168u8, 152u8, 197u8, 233u8, - 5u8, 25u8, 0u8, 154u8, 234u8, 180u8, 146u8, 132u8, 106u8, 164u8, 149u8, - 63u8, + 183u8, 82u8, 243u8, 7u8, 196u8, 99u8, 138u8, 173u8, 233u8, 86u8, 54u8, + 6u8, 16u8, 233u8, 1u8, 38u8, 171u8, 105u8, 133u8, 156u8, 66u8, 131u8, + 67u8, 181u8, 5u8, 42u8, 95u8, 144u8, 29u8, 66u8, 169u8, 15u8, ], ) } @@ -7264,20 +5793,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::epoch_start::EpochStart, + epoch_start::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "EpochStart", - (), [ - 144u8, 133u8, 140u8, 56u8, 241u8, 203u8, 199u8, 123u8, 244u8, 126u8, - 196u8, 151u8, 214u8, 204u8, 243u8, 244u8, 210u8, 198u8, 174u8, 126u8, - 200u8, 236u8, 248u8, 190u8, 181u8, 152u8, 113u8, 224u8, 95u8, 234u8, - 169u8, 14u8, + 212u8, 0u8, 59u8, 83u8, 220u8, 189u8, 245u8, 243u8, 223u8, 252u8, + 144u8, 192u8, 230u8, 62u8, 75u8, 70u8, 122u8, 146u8, 44u8, 42u8, 251u8, + 233u8, 220u8, 97u8, 41u8, 123u8, 25u8, 32u8, 99u8, 114u8, 164u8, 194u8, ], ) } @@ -7290,20 +5815,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::lateness::Lateness, - ::subxt::ext::subxt_core::utils::Yes, + lateness::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "Lateness", - (), [ - 229u8, 214u8, 133u8, 149u8, 32u8, 159u8, 26u8, 22u8, 252u8, 131u8, - 200u8, 191u8, 231u8, 176u8, 178u8, 127u8, 33u8, 212u8, 139u8, 220u8, - 157u8, 38u8, 4u8, 226u8, 204u8, 32u8, 55u8, 20u8, 205u8, 141u8, 29u8, - 87u8, + 48u8, 99u8, 8u8, 250u8, 131u8, 254u8, 169u8, 107u8, 59u8, 29u8, 142u8, + 99u8, 96u8, 214u8, 108u8, 213u8, 9u8, 83u8, 163u8, 188u8, 37u8, 34u8, + 237u8, 99u8, 220u8, 47u8, 47u8, 44u8, 24u8, 171u8, 11u8, 60u8, ], ) } @@ -7313,20 +5834,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::epoch_config::EpochConfig, + epoch_config::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "EpochConfig", - (), [ - 151u8, 58u8, 93u8, 2u8, 19u8, 98u8, 41u8, 144u8, 241u8, 70u8, 195u8, - 37u8, 126u8, 241u8, 111u8, 65u8, 16u8, 228u8, 111u8, 220u8, 241u8, - 215u8, 179u8, 235u8, 122u8, 88u8, 92u8, 95u8, 131u8, 252u8, 236u8, - 46u8, + 42u8, 35u8, 49u8, 193u8, 40u8, 52u8, 2u8, 34u8, 231u8, 234u8, 140u8, + 29u8, 160u8, 38u8, 76u8, 20u8, 198u8, 75u8, 189u8, 63u8, 254u8, 241u8, + 20u8, 195u8, 183u8, 147u8, 69u8, 161u8, 12u8, 213u8, 34u8, 11u8, ], ) } @@ -7336,20 +5853,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_epoch_config::NextEpochConfig, + next_epoch_config::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "NextEpochConfig", - (), [ - 65u8, 54u8, 74u8, 141u8, 193u8, 124u8, 130u8, 238u8, 106u8, 27u8, - 221u8, 189u8, 103u8, 53u8, 39u8, 243u8, 212u8, 216u8, 75u8, 185u8, - 104u8, 220u8, 70u8, 108u8, 87u8, 172u8, 201u8, 185u8, 39u8, 55u8, - 145u8, 6u8, + 114u8, 172u8, 4u8, 141u8, 141u8, 104u8, 17u8, 67u8, 1u8, 114u8, 166u8, + 3u8, 235u8, 225u8, 125u8, 91u8, 206u8, 197u8, 138u8, 222u8, 107u8, + 232u8, 10u8, 163u8, 8u8, 155u8, 41u8, 53u8, 142u8, 94u8, 153u8, 6u8, ], ) } @@ -7365,23 +5878,172 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::skipped_epochs::SkippedEpochs, - ::subxt::ext::subxt_core::utils::Yes, + skipped_epochs::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Babe", "SkippedEpochs", - (), [ - 120u8, 167u8, 144u8, 97u8, 41u8, 216u8, 103u8, 90u8, 3u8, 86u8, 196u8, - 35u8, 160u8, 150u8, 144u8, 233u8, 128u8, 35u8, 119u8, 66u8, 6u8, 63u8, - 114u8, 140u8, 182u8, 228u8, 192u8, 30u8, 50u8, 145u8, 217u8, 108u8, + 0u8, 218u8, 162u8, 138u8, 234u8, 115u8, 159u8, 190u8, 75u8, 5u8, 15u8, + 182u8, 178u8, 188u8, 144u8, 239u8, 62u8, 138u8, 126u8, 150u8, 65u8, + 117u8, 15u8, 14u8, 185u8, 33u8, 92u8, 129u8, 34u8, 110u8, 27u8, 143u8, ], ) } } + pub mod epoch_index { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u64; + } + } + pub mod authorities { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>; + } + } + pub mod genesis_slot { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_consensus_slots::Slot; + } + } + pub mod current_slot { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_consensus_slots::Slot; + } + } + pub mod randomness { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = [::core::primitive::u8; 32usize]; + } + } + pub mod pending_epoch_config_change { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; + } + } + pub mod next_randomness { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = [::core::primitive::u8; 32usize]; + } + } + pub mod next_authorities { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>; + } + } + pub mod segment_index { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod under_construction { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + [::core::primitive::u8; 32usize], + >; + } + } + pub mod initialized { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::sp_consensus_babe::digests::PreDigest, + >; + } + } + pub mod author_vrf_randomness { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + } + pub mod epoch_start { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = (::core::primitive::u32, ::core::primitive::u32); + } + } + pub mod lateness { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod epoch_config { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_consensus_babe::BabeEpochConfiguration; + } + } + pub mod next_epoch_config { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_consensus_babe::BabeEpochConfiguration; + } + } + pub mod skipped_epochs { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + (::core::primitive::u64, ::core::primitive::u32), + >; + } + } } pub mod constants { use super::runtime_types; @@ -7558,18 +6220,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod now { - use super::runtime_types; - pub type Now = ::core::primitive::u64; - } - pub mod did_update { - use super::runtime_types; - pub type DidUpdate = ::core::primitive::bool; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The current time for the current block."] @@ -7577,19 +6229,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::now::Now, + now::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Timestamp", "Now", - (), [ - 44u8, 50u8, 80u8, 30u8, 195u8, 146u8, 123u8, 238u8, 8u8, 163u8, 187u8, - 92u8, 61u8, 39u8, 51u8, 29u8, 173u8, 169u8, 217u8, 158u8, 85u8, 187u8, - 141u8, 26u8, 12u8, 115u8, 51u8, 11u8, 200u8, 244u8, 138u8, 152u8, + 33u8, 56u8, 170u8, 83u8, 141u8, 145u8, 85u8, 240u8, 128u8, 31u8, 207u8, + 119u8, 3u8, 202u8, 67u8, 6u8, 117u8, 189u8, 75u8, 35u8, 142u8, 183u8, + 127u8, 182u8, 208u8, 169u8, 153u8, 229u8, 251u8, 53u8, 181u8, 45u8, ], ) } @@ -7601,24 +6250,37 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::did_update::DidUpdate, - ::subxt::ext::subxt_core::utils::Yes, + did_update::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Timestamp", "DidUpdate", - (), [ - 229u8, 175u8, 246u8, 102u8, 237u8, 158u8, 212u8, 229u8, 238u8, 214u8, - 205u8, 160u8, 164u8, 252u8, 195u8, 75u8, 139u8, 110u8, 22u8, 34u8, - 248u8, 204u8, 107u8, 46u8, 20u8, 200u8, 238u8, 167u8, 71u8, 41u8, - 214u8, 140u8, + 159u8, 174u8, 212u8, 192u8, 172u8, 1u8, 246u8, 2u8, 150u8, 55u8, 251u8, + 62u8, 194u8, 210u8, 15u8, 214u8, 177u8, 160u8, 15u8, 138u8, 142u8, + 125u8, 113u8, 227u8, 201u8, 250u8, 223u8, 252u8, 123u8, 144u8, 209u8, + 10u8, ], ) } } + pub mod now { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u64; + } + } + pub mod did_update { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } } pub mod constants { use super::runtime_types; @@ -8149,69 +6811,43 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod accounts { - use super::runtime_types; - pub type Accounts = ( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ); - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The lookup from index to account."] - pub fn accounts_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::accounts::Accounts, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Indices", - "Accounts", - (), - [ - 48u8, 189u8, 43u8, 119u8, 32u8, 168u8, 28u8, 12u8, 245u8, 81u8, 119u8, - 182u8, 23u8, 201u8, 33u8, 147u8, 128u8, 171u8, 155u8, 134u8, 71u8, - 87u8, 100u8, 248u8, 107u8, 129u8, 36u8, 197u8, 220u8, 90u8, 11u8, - 238u8, - ], - ) - } #[doc = " The lookup from index to account."] pub fn accounts( &self, - _0: types::accounts::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::accounts::Param0, - >, - types::accounts::Accounts, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (accounts::Param0,), + accounts::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Indices", "Accounts", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 48u8, 189u8, 43u8, 119u8, 32u8, 168u8, 28u8, 12u8, 245u8, 81u8, 119u8, - 182u8, 23u8, 201u8, 33u8, 147u8, 128u8, 171u8, 155u8, 134u8, 71u8, - 87u8, 100u8, 248u8, 107u8, 129u8, 36u8, 197u8, 220u8, 90u8, 11u8, - 238u8, + 187u8, 233u8, 90u8, 95u8, 66u8, 137u8, 141u8, 150u8, 251u8, 7u8, 28u8, + 217u8, 252u8, 109u8, 132u8, 243u8, 39u8, 164u8, 140u8, 53u8, 18u8, + 152u8, 232u8, 129u8, 207u8, 27u8, 73u8, 93u8, 216u8, 48u8, 157u8, + 141u8, ], ) } } + pub mod accounts { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + ); + } + } } pub mod constants { use super::runtime_types; @@ -9417,64 +8053,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod total_issuance { - use super::runtime_types; - pub type TotalIssuance = ::core::primitive::u128; - } - pub mod inactive_issuance { - use super::runtime_types; - pub type InactiveIssuance = ::core::primitive::u128; - } - pub mod account { - use super::runtime_types; - pub type Account = - runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod locks { - use super::runtime_types; - pub type Locks = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_balances::types::BalanceLock< - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod reserves { - use super::runtime_types; - pub type Reserves = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_balances::types::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod holds { - use super::runtime_types; - pub type Holds = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - runtime_types::rococo_runtime::RuntimeHoldReason, - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod freezes { - use super::runtime_types; - pub type Freezes = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - (), - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The total units issued in the system."] @@ -9482,20 +8062,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::total_issuance::TotalIssuance, - ::subxt::ext::subxt_core::utils::Yes, + total_issuance::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Balances", "TotalIssuance", - (), [ - 116u8, 70u8, 119u8, 194u8, 69u8, 37u8, 116u8, 206u8, 171u8, 70u8, - 171u8, 210u8, 226u8, 111u8, 184u8, 204u8, 206u8, 11u8, 68u8, 72u8, - 255u8, 19u8, 194u8, 11u8, 27u8, 194u8, 81u8, 204u8, 59u8, 224u8, 202u8, - 185u8, + 138u8, 120u8, 138u8, 119u8, 4u8, 166u8, 22u8, 216u8, 227u8, 249u8, + 161u8, 193u8, 54u8, 68u8, 55u8, 74u8, 230u8, 68u8, 131u8, 253u8, 146u8, + 73u8, 54u8, 85u8, 212u8, 83u8, 162u8, 188u8, 171u8, 5u8, 232u8, 21u8, ], ) } @@ -9504,63 +8080,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::inactive_issuance::InactiveIssuance, - ::subxt::ext::subxt_core::utils::Yes, + inactive_issuance::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Balances", "InactiveIssuance", - (), - [ - 212u8, 185u8, 19u8, 50u8, 250u8, 72u8, 173u8, 50u8, 4u8, 104u8, 161u8, - 249u8, 77u8, 247u8, 204u8, 248u8, 11u8, 18u8, 57u8, 4u8, 82u8, 110u8, - 30u8, 216u8, 16u8, 37u8, 87u8, 67u8, 189u8, 235u8, 214u8, 155u8, - ], - ) - } - #[doc = " The Balances pallet example of storing the balance of an account."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " You can also store the balance of an account in the `System` pallet."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = System"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] - #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] - #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] - #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] - pub fn account_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::account::Account, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Balances", - "Account", - (), [ - 213u8, 38u8, 200u8, 69u8, 218u8, 0u8, 112u8, 181u8, 160u8, 23u8, 96u8, - 90u8, 3u8, 88u8, 126u8, 22u8, 103u8, 74u8, 64u8, 69u8, 29u8, 247u8, - 18u8, 17u8, 234u8, 143u8, 189u8, 22u8, 247u8, 194u8, 154u8, 249u8, + 97u8, 194u8, 82u8, 3u8, 40u8, 108u8, 109u8, 245u8, 175u8, 189u8, 212u8, + 193u8, 229u8, 82u8, 107u8, 169u8, 9u8, 176u8, 124u8, 102u8, 151u8, + 98u8, 87u8, 194u8, 82u8, 130u8, 41u8, 137u8, 3u8, 230u8, 145u8, 58u8, ], ) } @@ -9590,48 +8119,19 @@ pub mod api { #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] pub fn account( &self, - _0: types::account::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, - >, - types::account::Account, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (account::Param0,), + account::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Balances", "Account", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 213u8, 38u8, 200u8, 69u8, 218u8, 0u8, 112u8, 181u8, 160u8, 23u8, 96u8, - 90u8, 3u8, 88u8, 126u8, 22u8, 103u8, 74u8, 64u8, 69u8, 29u8, 247u8, - 18u8, 17u8, 234u8, 143u8, 189u8, 22u8, 247u8, 194u8, 154u8, 249u8, - ], - ) - } - #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] - #[doc = ""] - #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn locks_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::locks::Locks, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Balances", - "Locks", - (), - [ - 10u8, 223u8, 55u8, 0u8, 249u8, 69u8, 168u8, 41u8, 75u8, 35u8, 120u8, - 167u8, 18u8, 132u8, 9u8, 20u8, 91u8, 51u8, 27u8, 69u8, 136u8, 187u8, - 13u8, 220u8, 163u8, 122u8, 26u8, 141u8, 174u8, 249u8, 85u8, 37u8, + 14u8, 88u8, 174u8, 192u8, 241u8, 142u8, 159u8, 255u8, 178u8, 117u8, + 55u8, 78u8, 218u8, 161u8, 146u8, 139u8, 170u8, 180u8, 187u8, 177u8, + 89u8, 157u8, 91u8, 225u8, 90u8, 174u8, 247u8, 47u8, 47u8, 23u8, 234u8, + 50u8, ], ) } @@ -9641,47 +8141,19 @@ pub mod api { #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn locks( &self, - _0: types::locks::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::locks::Param0, - >, - types::locks::Locks, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (locks::Param0,), + locks::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Balances", "Locks", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 10u8, 223u8, 55u8, 0u8, 249u8, 69u8, 168u8, 41u8, 75u8, 35u8, 120u8, - 167u8, 18u8, 132u8, 9u8, 20u8, 91u8, 51u8, 27u8, 69u8, 136u8, 187u8, - 13u8, 220u8, 163u8, 122u8, 26u8, 141u8, 174u8, 249u8, 85u8, 37u8, - ], - ) - } - #[doc = " Named reserves on some account balances."] - #[doc = ""] - #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn reserves_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::reserves::Reserves, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Balances", - "Reserves", - (), - [ - 112u8, 10u8, 241u8, 77u8, 64u8, 187u8, 106u8, 159u8, 13u8, 153u8, - 140u8, 178u8, 182u8, 50u8, 1u8, 55u8, 149u8, 92u8, 196u8, 229u8, 170u8, - 106u8, 193u8, 88u8, 255u8, 244u8, 2u8, 193u8, 62u8, 235u8, 204u8, 91u8, + 201u8, 50u8, 65u8, 126u8, 43u8, 153u8, 207u8, 145u8, 240u8, 59u8, + 160u8, 111u8, 144u8, 245u8, 193u8, 13u8, 227u8, 118u8, 72u8, 168u8, + 37u8, 147u8, 139u8, 221u8, 36u8, 177u8, 202u8, 209u8, 152u8, 122u8, + 250u8, 89u8, ], ) } @@ -9690,118 +8162,142 @@ pub mod api { #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn reserves( &self, - _0: types::reserves::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::reserves::Param0, - >, - types::reserves::Reserves, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (reserves::Param0,), + reserves::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Balances", "Reserves", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 112u8, 10u8, 241u8, 77u8, 64u8, 187u8, 106u8, 159u8, 13u8, 153u8, - 140u8, 178u8, 182u8, 50u8, 1u8, 55u8, 149u8, 92u8, 196u8, 229u8, 170u8, - 106u8, 193u8, 88u8, 255u8, 244u8, 2u8, 193u8, 62u8, 235u8, 204u8, 91u8, - ], - ) - } - #[doc = " Holds on account balances."] - pub fn holds_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::holds::Holds, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Balances", - "Holds", - (), - [ - 6u8, 68u8, 133u8, 169u8, 100u8, 31u8, 19u8, 164u8, 80u8, 22u8, 132u8, - 73u8, 190u8, 31u8, 34u8, 82u8, 132u8, 79u8, 92u8, 15u8, 204u8, 149u8, - 109u8, 203u8, 169u8, 162u8, 250u8, 223u8, 182u8, 170u8, 251u8, 178u8, + 76u8, 220u8, 133u8, 100u8, 127u8, 174u8, 237u8, 103u8, 211u8, 104u8, + 140u8, 100u8, 49u8, 169u8, 114u8, 112u8, 193u8, 115u8, 234u8, 160u8, + 97u8, 104u8, 194u8, 47u8, 119u8, 136u8, 132u8, 196u8, 136u8, 121u8, + 45u8, 161u8, ], ) } #[doc = " Holds on account balances."] pub fn holds( &self, - _0: types::holds::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param0, - >, - types::holds::Holds, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (holds::Param0,), + holds::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Balances", "Holds", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 6u8, 68u8, 133u8, 169u8, 100u8, 31u8, 19u8, 164u8, 80u8, 22u8, 132u8, - 73u8, 190u8, 31u8, 34u8, 82u8, 132u8, 79u8, 92u8, 15u8, 204u8, 149u8, - 109u8, 203u8, 169u8, 162u8, 250u8, 223u8, 182u8, 170u8, 251u8, 178u8, - ], - ) - } - #[doc = " Freeze locks on account balances."] - pub fn freezes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::freezes::Freezes, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Balances", - "Freezes", - (), [ - 69u8, 49u8, 165u8, 76u8, 135u8, 142u8, 179u8, 118u8, 50u8, 109u8, 53u8, - 112u8, 110u8, 94u8, 30u8, 93u8, 173u8, 38u8, 27u8, 142u8, 19u8, 5u8, - 163u8, 4u8, 68u8, 218u8, 179u8, 224u8, 118u8, 218u8, 115u8, 64u8, + 243u8, 190u8, 61u8, 27u8, 177u8, 143u8, 74u8, 255u8, 22u8, 109u8, + 167u8, 85u8, 179u8, 42u8, 42u8, 37u8, 8u8, 190u8, 38u8, 60u8, 158u8, + 138u8, 66u8, 201u8, 131u8, 136u8, 85u8, 160u8, 98u8, 110u8, 33u8, 50u8, ], ) } #[doc = " Freeze locks on account balances."] pub fn freezes( &self, - _0: types::freezes::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::freezes::Param0, - >, - types::freezes::Freezes, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (freezes::Param0,), + freezes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Balances", "Freezes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 69u8, 49u8, 165u8, 76u8, 135u8, 142u8, 179u8, 118u8, 50u8, 109u8, 53u8, - 112u8, 110u8, 94u8, 30u8, 93u8, 173u8, 38u8, 27u8, 142u8, 19u8, 5u8, - 163u8, 4u8, 68u8, 218u8, 179u8, 224u8, 118u8, 218u8, 115u8, 64u8, + 41u8, 196u8, 69u8, 26u8, 201u8, 141u8, 252u8, 255u8, 78u8, 216u8, + 102u8, 207u8, 133u8, 185u8, 86u8, 18u8, 79u8, 137u8, 132u8, 92u8, + 228u8, 237u8, 91u8, 125u8, 25u8, 111u8, 127u8, 212u8, 215u8, 114u8, + 219u8, 72u8, ], ) } } + pub mod total_issuance { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod inactive_issuance { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod account { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; + } + } + pub mod locks { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_balances::types::BalanceLock< + ::core::primitive::u128, + >, + >; + } + } + pub mod reserves { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_balances::types::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >; + } + } + pub mod holds { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + runtime_types::rococo_runtime::RuntimeHoldReason, + ::core::primitive::u128, + >, + >; + } + } + pub mod freezes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + (), + ::core::primitive::u128, + >, + >; + } + } } pub mod constants { use super::runtime_types; @@ -9984,65 +8480,39 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod parameters { - use super::runtime_types; - pub type Parameters = runtime_types::rococo_runtime::RuntimeParametersValue; - pub type Param0 = runtime_types::rococo_runtime::RuntimeParametersKey; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Stored parameters."] - pub fn parameters_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::parameters::Parameters, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Parameters", - "Parameters", - (), - [ - 151u8, 247u8, 90u8, 253u8, 217u8, 155u8, 50u8, 150u8, 159u8, 224u8, - 124u8, 167u8, 68u8, 13u8, 0u8, 119u8, 152u8, 79u8, 233u8, 67u8, 226u8, - 226u8, 85u8, 11u8, 70u8, 154u8, 245u8, 119u8, 26u8, 172u8, 149u8, - 110u8, - ], - ) - } #[doc = " Stored parameters."] pub fn parameters( &self, - _0: types::parameters::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::parameters::Param0, - >, - types::parameters::Parameters, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (parameters::Param0,), + parameters::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Parameters", "Parameters", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 151u8, 247u8, 90u8, 253u8, 217u8, 155u8, 50u8, 150u8, 159u8, 224u8, - 124u8, 167u8, 68u8, 13u8, 0u8, 119u8, 152u8, 79u8, 233u8, 67u8, 226u8, - 226u8, 85u8, 11u8, 70u8, 154u8, 245u8, 119u8, 26u8, 172u8, 149u8, - 110u8, + 218u8, 32u8, 137u8, 171u8, 249u8, 253u8, 249u8, 108u8, 207u8, 181u8, + 169u8, 227u8, 188u8, 102u8, 41u8, 17u8, 101u8, 197u8, 109u8, 0u8, + 137u8, 31u8, 53u8, 103u8, 191u8, 125u8, 55u8, 33u8, 208u8, 68u8, 243u8, + 105u8, ], ) } } + pub mod parameters { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::rococo_runtime::RuntimeParametersKey; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::rococo_runtime::RuntimeParametersValue; + } + } } } pub mod transaction_payment { @@ -10078,43 +8548,24 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod next_fee_multiplier { - use super::runtime_types; - pub type NextFeeMultiplier = - runtime_types::sp_arithmetic::fixed_point::FixedU128; - } - pub mod storage_version { - use super::runtime_types; - pub type StorageVersion = runtime_types::pallet_transaction_payment::Releases; - } - pub mod tx_payment_credit { - use super::runtime_types; - pub type TxPaymentCredit = runtime_types :: frame_support :: traits :: storage :: NoDrop < runtime_types :: frame_support :: traits :: tokens :: fungible :: imbalance :: Imbalance < :: core :: primitive :: u128 > > ; - } - } pub struct StorageApi; impl StorageApi { pub fn next_fee_multiplier( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_fee_multiplier::NextFeeMultiplier, - ::subxt::ext::subxt_core::utils::Yes, + next_fee_multiplier::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TransactionPayment", "NextFeeMultiplier", - (), [ - 247u8, 39u8, 81u8, 170u8, 225u8, 226u8, 82u8, 147u8, 34u8, 113u8, - 147u8, 213u8, 59u8, 80u8, 139u8, 35u8, 36u8, 196u8, 152u8, 19u8, 9u8, - 159u8, 176u8, 79u8, 249u8, 201u8, 170u8, 1u8, 129u8, 79u8, 146u8, - 197u8, + 54u8, 78u8, 153u8, 36u8, 231u8, 148u8, 27u8, 187u8, 224u8, 89u8, 193u8, + 138u8, 18u8, 92u8, 61u8, 225u8, 78u8, 186u8, 175u8, 214u8, 45u8, 237u8, + 65u8, 225u8, 177u8, 110u8, 113u8, 22u8, 164u8, 172u8, 191u8, 241u8, ], ) } @@ -10122,20 +8573,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::storage_version::StorageVersion, - ::subxt::ext::subxt_core::utils::Yes, + storage_version::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TransactionPayment", "StorageVersion", - (), [ - 105u8, 243u8, 158u8, 241u8, 159u8, 231u8, 253u8, 6u8, 4u8, 32u8, 85u8, - 178u8, 126u8, 31u8, 203u8, 134u8, 154u8, 38u8, 122u8, 155u8, 150u8, - 251u8, 174u8, 15u8, 74u8, 134u8, 216u8, 244u8, 168u8, 175u8, 158u8, - 144u8, + 102u8, 2u8, 115u8, 199u8, 149u8, 230u8, 163u8, 131u8, 198u8, 138u8, + 203u8, 116u8, 26u8, 120u8, 43u8, 39u8, 234u8, 52u8, 229u8, 102u8, + 194u8, 18u8, 44u8, 249u8, 84u8, 142u8, 217u8, 129u8, 80u8, 5u8, 194u8, + 214u8, ], ) } @@ -10146,23 +8594,44 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::tx_payment_credit::TxPaymentCredit, + tx_payment_credit::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TransactionPayment", "TxPaymentCredit", - (), [ - 39u8, 127u8, 132u8, 77u8, 25u8, 10u8, 195u8, 64u8, 255u8, 212u8, 183u8, - 177u8, 238u8, 24u8, 81u8, 65u8, 93u8, 177u8, 209u8, 134u8, 245u8, - 241u8, 252u8, 87u8, 179u8, 61u8, 168u8, 77u8, 65u8, 13u8, 72u8, 205u8, + 200u8, 46u8, 84u8, 207u8, 2u8, 81u8, 201u8, 150u8, 218u8, 189u8, 138u8, + 151u8, 91u8, 194u8, 144u8, 2u8, 28u8, 38u8, 88u8, 233u8, 242u8, 207u8, + 20u8, 172u8, 99u8, 167u8, 57u8, 12u8, 121u8, 0u8, 162u8, 148u8, ], ) } } + pub mod next_fee_multiplier { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; + } + } + pub mod storage_version { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_transaction_payment::Releases; + } + } + pub mod tx_payment_credit { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: frame_support :: traits :: storage :: NoDrop < runtime_types :: frame_support :: traits :: tokens :: fungible :: imbalance :: Imbalance < :: core :: primitive :: u128 > > ; + } + } } pub mod constants { use super::runtime_types; @@ -10212,14 +8681,8 @@ pub mod api { use super::root_mod; use super::runtime_types; pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod author { - use super::runtime_types; - pub type Author = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Author of current block."] @@ -10227,24 +8690,29 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::author::Author, + author::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Authorship", "Author", - (), [ - 247u8, 192u8, 118u8, 227u8, 47u8, 20u8, 203u8, 199u8, 216u8, 87u8, - 220u8, 50u8, 166u8, 61u8, 168u8, 213u8, 253u8, 62u8, 202u8, 199u8, - 61u8, 192u8, 237u8, 53u8, 22u8, 148u8, 164u8, 245u8, 99u8, 24u8, 146u8, - 18u8, + 255u8, 188u8, 55u8, 69u8, 192u8, 67u8, 62u8, 233u8, 181u8, 200u8, + 188u8, 254u8, 107u8, 144u8, 69u8, 125u8, 34u8, 178u8, 73u8, 199u8, + 74u8, 58u8, 83u8, 175u8, 124u8, 132u8, 68u8, 215u8, 62u8, 73u8, 121u8, + 103u8, ], ) } } + pub mod author { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } } } pub mod offences { @@ -10280,158 +8748,75 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod reports { - use super::runtime_types; - pub type Reports = runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::ext::subxt_core::utils::AccountId32, - (::subxt::ext::subxt_core::utils::AccountId32, ()), - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - pub mod concurrent_reports_index { - use super::runtime_types; - pub type ConcurrentReportsIndex = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::H256, - >; - pub type Param0 = [::core::primitive::u8; 16usize]; - pub type Param1 = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The primary structure that holds all offence records keyed by report identifiers."] - pub fn reports_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::reports::Reports, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Offences", - "Reports", - (), - [ - 255u8, 234u8, 162u8, 48u8, 243u8, 210u8, 198u8, 231u8, 218u8, 142u8, - 167u8, 10u8, 232u8, 223u8, 239u8, 55u8, 74u8, 23u8, 14u8, 236u8, 88u8, - 231u8, 152u8, 55u8, 91u8, 120u8, 11u8, 96u8, 100u8, 113u8, 131u8, - 173u8, - ], - ) - } #[doc = " The primary structure that holds all offence records keyed by report identifiers."] pub fn reports( &self, - _0: types::reports::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::reports::Param0, - >, - types::reports::Reports, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (reports::Param0,), + reports::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Offences", "Reports", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 255u8, 234u8, 162u8, 48u8, 243u8, 210u8, 198u8, 231u8, 218u8, 142u8, - 167u8, 10u8, 232u8, 223u8, 239u8, 55u8, 74u8, 23u8, 14u8, 236u8, 88u8, - 231u8, 152u8, 55u8, 91u8, 120u8, 11u8, 96u8, 100u8, 113u8, 131u8, - 173u8, - ], - ) - } - #[doc = " A vector of reports of the same kind that happened at the same time slot."] - pub fn concurrent_reports_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::concurrent_reports_index::ConcurrentReportsIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Offences", - "ConcurrentReportsIndex", - (), - [ - 170u8, 186u8, 72u8, 29u8, 251u8, 38u8, 193u8, 195u8, 109u8, 86u8, 0u8, - 241u8, 20u8, 235u8, 108u8, 126u8, 215u8, 82u8, 73u8, 113u8, 199u8, - 138u8, 24u8, 58u8, 216u8, 72u8, 221u8, 232u8, 252u8, 244u8, 96u8, - 247u8, - ], - ) - } - #[doc = " A vector of reports of the same kind that happened at the same time slot."] - pub fn concurrent_reports_index_iter1( - &self, - _0: types::concurrent_reports_index::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::concurrent_reports_index::Param0, - >, - types::concurrent_reports_index::ConcurrentReportsIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Offences", - "ConcurrentReportsIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 170u8, 186u8, 72u8, 29u8, 251u8, 38u8, 193u8, 195u8, 109u8, 86u8, 0u8, - 241u8, 20u8, 235u8, 108u8, 126u8, 215u8, 82u8, 73u8, 113u8, 199u8, - 138u8, 24u8, 58u8, 216u8, 72u8, 221u8, 232u8, 252u8, 244u8, 96u8, - 247u8, + 127u8, 15u8, 118u8, 9u8, 113u8, 122u8, 180u8, 46u8, 67u8, 23u8, 123u8, + 0u8, 39u8, 66u8, 18u8, 120u8, 82u8, 115u8, 204u8, 247u8, 146u8, 95u8, + 116u8, 11u8, 45u8, 12u8, 163u8, 114u8, 239u8, 78u8, 141u8, 227u8, ], ) } #[doc = " A vector of reports of the same kind that happened at the same time slot."] pub fn concurrent_reports_index( &self, - _0: types::concurrent_reports_index::Param0, - _1: types::concurrent_reports_index::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::concurrent_reports_index::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::concurrent_reports_index::Param1, - >, + concurrent_reports_index::Param0, + concurrent_reports_index::Param1, ), - types::concurrent_reports_index::ConcurrentReportsIndex, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + concurrent_reports_index::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Offences", "ConcurrentReportsIndex", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), [ - 170u8, 186u8, 72u8, 29u8, 251u8, 38u8, 193u8, 195u8, 109u8, 86u8, 0u8, - 241u8, 20u8, 235u8, 108u8, 126u8, 215u8, 82u8, 73u8, 113u8, 199u8, - 138u8, 24u8, 58u8, 216u8, 72u8, 221u8, 232u8, 252u8, 244u8, 96u8, - 247u8, + 95u8, 235u8, 155u8, 49u8, 220u8, 52u8, 205u8, 161u8, 108u8, 24u8, + 209u8, 209u8, 191u8, 93u8, 84u8, 152u8, 146u8, 238u8, 36u8, 113u8, + 146u8, 108u8, 221u8, 249u8, 84u8, 30u8, 111u8, 218u8, 132u8, 114u8, + 72u8, 177u8, ], ) } } + pub mod reports { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_staking::offence::OffenceDetails< + ::subxt::ext::subxt_core::utils::AccountId32, + (::subxt::ext::subxt_core::utils::AccountId32, ()), + >; + } + } + pub mod concurrent_reports_index { + use super::root_mod; + use super::runtime_types; + pub type Param0 = [::core::primitive::u8; 16usize]; + pub type Param1 = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::H256, + >; + } + } } } pub mod historical { @@ -10481,68 +8866,26 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod historical_sessions { - use super::runtime_types; - pub type HistoricalSessions = ( - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - ); - pub type Param0 = ::core::primitive::u32; - } - pub mod stored_range { - use super::runtime_types; - pub type StoredRange = (::core::primitive::u32, ::core::primitive::u32); - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Mapping from historical session indices to session-data root hash and validator count."] - pub fn historical_sessions_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::historical_sessions::HistoricalSessions, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Historical", - "HistoricalSessions", - (), - [ - 9u8, 138u8, 247u8, 141u8, 178u8, 146u8, 124u8, 81u8, 162u8, 211u8, - 205u8, 149u8, 222u8, 254u8, 253u8, 188u8, 170u8, 242u8, 218u8, 41u8, - 124u8, 178u8, 109u8, 209u8, 163u8, 125u8, 225u8, 206u8, 249u8, 175u8, - 117u8, 75u8, - ], - ) - } #[doc = " Mapping from historical session indices to session-data root hash and validator count."] pub fn historical_sessions( &self, - _0: types::historical_sessions::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::historical_sessions::Param0, - >, - types::historical_sessions::HistoricalSessions, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (historical_sessions::Param0,), + historical_sessions::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Historical", "HistoricalSessions", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 9u8, 138u8, 247u8, 141u8, 178u8, 146u8, 124u8, 81u8, 162u8, 211u8, - 205u8, 149u8, 222u8, 254u8, 253u8, 188u8, 170u8, 242u8, 218u8, 41u8, - 124u8, 178u8, 109u8, 209u8, 163u8, 125u8, 225u8, 206u8, 249u8, 175u8, - 117u8, 75u8, + 152u8, 182u8, 25u8, 69u8, 1u8, 109u8, 101u8, 233u8, 23u8, 221u8, 121u8, + 109u8, 60u8, 183u8, 49u8, 208u8, 107u8, 116u8, 110u8, 199u8, 217u8, + 54u8, 78u8, 19u8, 150u8, 88u8, 163u8, 240u8, 104u8, 212u8, 181u8, + 234u8, ], ) } @@ -10551,23 +8894,41 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::stored_range::StoredRange, + stored_range::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Historical", "StoredRange", - (), [ - 134u8, 32u8, 250u8, 13u8, 201u8, 25u8, 54u8, 243u8, 231u8, 81u8, 252u8, - 231u8, 68u8, 217u8, 235u8, 43u8, 22u8, 223u8, 220u8, 133u8, 198u8, - 218u8, 95u8, 152u8, 189u8, 87u8, 6u8, 228u8, 242u8, 59u8, 232u8, 59u8, + 135u8, 92u8, 229u8, 75u8, 218u8, 192u8, 133u8, 69u8, 7u8, 26u8, 107u8, + 188u8, 232u8, 139u8, 247u8, 240u8, 24u8, 197u8, 241u8, 68u8, 155u8, + 246u8, 187u8, 103u8, 140u8, 154u8, 160u8, 179u8, 151u8, 171u8, 201u8, + 180u8, ], ) } } + pub mod historical_sessions { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::subxt::ext::subxt_core::utils::H256, + ::core::primitive::u32, + ); + } + } + pub mod stored_range { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = (::core::primitive::u32, ::core::primitive::u32); + } + } } } pub mod session { @@ -10782,51 +9143,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod validators { - use super::runtime_types; - pub type Validators = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - } - pub mod current_index { - use super::runtime_types; - pub type CurrentIndex = ::core::primitive::u32; - } - pub mod queued_changed { - use super::runtime_types; - pub type QueuedChanged = ::core::primitive::bool; - } - pub mod queued_keys { - use super::runtime_types; - pub type QueuedKeys = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::rococo_runtime::SessionKeys, - )>; - } - pub mod disabled_validators { - use super::runtime_types; - pub type DisabledValidators = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - runtime_types::sp_staking::offence::OffenceSeverity, - )>; - } - pub mod next_keys { - use super::runtime_types; - pub type NextKeys = runtime_types::rococo_runtime::SessionKeys; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod key_owner { - use super::runtime_types; - pub type KeyOwner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ( - runtime_types::sp_core::crypto::KeyTypeId, - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ); - } - } pub struct StorageApi; impl StorageApi { #[doc = " The current set of validators."] @@ -10834,20 +9152,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::validators::Validators, + validators::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Session", "Validators", - (), [ - 50u8, 86u8, 154u8, 222u8, 249u8, 209u8, 156u8, 22u8, 155u8, 25u8, - 133u8, 194u8, 210u8, 50u8, 38u8, 28u8, 139u8, 201u8, 90u8, 139u8, - 115u8, 12u8, 12u8, 141u8, 4u8, 178u8, 201u8, 241u8, 223u8, 234u8, 6u8, - 86u8, + 98u8, 234u8, 139u8, 243u8, 11u8, 147u8, 28u8, 212u8, 236u8, 223u8, + 229u8, 178u8, 143u8, 234u8, 182u8, 65u8, 57u8, 160u8, 67u8, 58u8, + 161u8, 174u8, 132u8, 206u8, 174u8, 0u8, 146u8, 143u8, 14u8, 155u8, + 246u8, 160u8, ], ) } @@ -10856,20 +9171,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::current_index::CurrentIndex, + current_index::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Session", "CurrentIndex", - (), [ - 167u8, 151u8, 125u8, 150u8, 159u8, 21u8, 78u8, 217u8, 237u8, 183u8, - 135u8, 65u8, 187u8, 114u8, 188u8, 206u8, 16u8, 32u8, 69u8, 208u8, - 134u8, 159u8, 232u8, 224u8, 243u8, 27u8, 31u8, 166u8, 145u8, 44u8, - 221u8, 230u8, + 139u8, 61u8, 181u8, 98u8, 190u8, 247u8, 19u8, 208u8, 248u8, 17u8, + 222u8, 114u8, 250u8, 154u8, 26u8, 254u8, 79u8, 32u8, 52u8, 10u8, 12u8, + 253u8, 252u8, 245u8, 67u8, 216u8, 214u8, 156u8, 123u8, 126u8, 123u8, + 31u8, ], ) } @@ -10879,20 +9191,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::queued_changed::QueuedChanged, + queued_changed::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Session", "QueuedChanged", - (), [ - 184u8, 137u8, 224u8, 137u8, 31u8, 236u8, 95u8, 164u8, 102u8, 225u8, - 198u8, 227u8, 140u8, 37u8, 113u8, 57u8, 59u8, 4u8, 202u8, 102u8, 117u8, - 36u8, 226u8, 64u8, 113u8, 141u8, 199u8, 111u8, 99u8, 144u8, 198u8, - 153u8, + 36u8, 187u8, 134u8, 13u8, 232u8, 120u8, 246u8, 231u8, 219u8, 80u8, 8u8, + 108u8, 222u8, 146u8, 71u8, 165u8, 203u8, 97u8, 255u8, 219u8, 207u8, + 212u8, 220u8, 108u8, 251u8, 128u8, 180u8, 100u8, 180u8, 39u8, 40u8, + 226u8, ], ) } @@ -10902,19 +9211,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::queued_keys::QueuedKeys, + queued_keys::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Session", "QueuedKeys", - (), [ - 54u8, 232u8, 4u8, 80u8, 89u8, 214u8, 20u8, 219u8, 48u8, 108u8, 26u8, - 89u8, 170u8, 210u8, 66u8, 37u8, 12u8, 60u8, 148u8, 186u8, 241u8, 64u8, - 83u8, 37u8, 124u8, 217u8, 51u8, 120u8, 148u8, 205u8, 85u8, 48u8, + 162u8, 245u8, 74u8, 191u8, 180u8, 119u8, 41u8, 169u8, 235u8, 33u8, + 81u8, 237u8, 252u8, 25u8, 18u8, 187u8, 61u8, 103u8, 155u8, 135u8, + 215u8, 22u8, 229u8, 146u8, 76u8, 92u8, 84u8, 109u8, 93u8, 216u8, 117u8, + 30u8, ], ) } @@ -10927,115 +9234,126 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::disabled_validators::DisabledValidators, - ::subxt::ext::subxt_core::utils::Yes, + disabled_validators::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Session", "DisabledValidators", - (), [ - 214u8, 48u8, 28u8, 150u8, 143u8, 29u8, 183u8, 40u8, 236u8, 227u8, - 195u8, 5u8, 202u8, 54u8, 184u8, 26u8, 239u8, 237u8, 113u8, 39u8, 200u8, - 111u8, 163u8, 3u8, 24u8, 101u8, 107u8, 91u8, 228u8, 135u8, 12u8, 86u8, - ], - ) - } - #[doc = " The next session keys for a validator."] - pub fn next_keys_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_keys::NextKeys, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Session", - "NextKeys", - (), - [ - 123u8, 233u8, 243u8, 13u8, 162u8, 60u8, 206u8, 97u8, 76u8, 43u8, 184u8, - 99u8, 17u8, 23u8, 110u8, 108u8, 131u8, 195u8, 109u8, 24u8, 217u8, 93u8, - 99u8, 41u8, 95u8, 196u8, 239u8, 243u8, 191u8, 131u8, 2u8, 57u8, + 75u8, 154u8, 48u8, 250u8, 36u8, 60u8, 62u8, 13u8, 27u8, 19u8, 26u8, + 220u8, 98u8, 182u8, 251u8, 183u8, 252u8, 241u8, 17u8, 227u8, 30u8, + 85u8, 47u8, 155u8, 73u8, 145u8, 175u8, 28u8, 161u8, 29u8, 223u8, 27u8, ], ) } #[doc = " The next session keys for a validator."] pub fn next_keys( &self, - _0: types::next_keys::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::next_keys::Param0, - >, - types::next_keys::NextKeys, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (next_keys::Param0,), + next_keys::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Session", "NextKeys", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 123u8, 233u8, 243u8, 13u8, 162u8, 60u8, 206u8, 97u8, 76u8, 43u8, 184u8, - 99u8, 17u8, 23u8, 110u8, 108u8, 131u8, 195u8, 109u8, 24u8, 217u8, 93u8, - 99u8, 41u8, 95u8, 196u8, 239u8, 243u8, 191u8, 131u8, 2u8, 57u8, - ], - ) - } - #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] - pub fn key_owner_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::key_owner::KeyOwner, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Session", - "KeyOwner", - (), [ - 217u8, 204u8, 21u8, 114u8, 247u8, 129u8, 32u8, 242u8, 93u8, 91u8, - 253u8, 253u8, 248u8, 90u8, 12u8, 202u8, 195u8, 25u8, 18u8, 100u8, - 253u8, 109u8, 88u8, 77u8, 217u8, 140u8, 51u8, 40u8, 118u8, 35u8, 107u8, - 206u8, + 18u8, 93u8, 100u8, 34u8, 110u8, 108u8, 82u8, 195u8, 243u8, 163u8, 96u8, + 168u8, 214u8, 182u8, 213u8, 182u8, 194u8, 247u8, 55u8, 245u8, 61u8, + 24u8, 199u8, 85u8, 236u8, 235u8, 245u8, 200u8, 109u8, 203u8, 35u8, 9u8, ], ) } #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] pub fn key_owner( &self, - _0: types::key_owner::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::key_owner::Param0, - >, - types::key_owner::KeyOwner, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (key_owner::Param0,), + key_owner::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Session", "KeyOwner", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 217u8, 204u8, 21u8, 114u8, 247u8, 129u8, 32u8, 242u8, 93u8, 91u8, - 253u8, 253u8, 248u8, 90u8, 12u8, 202u8, 195u8, 25u8, 18u8, 100u8, - 253u8, 109u8, 88u8, 77u8, 217u8, 140u8, 51u8, 40u8, 118u8, 35u8, 107u8, - 206u8, + 92u8, 40u8, 121u8, 10u8, 108u8, 141u8, 24u8, 38u8, 207u8, 27u8, 52u8, + 42u8, 159u8, 143u8, 245u8, 52u8, 228u8, 75u8, 69u8, 108u8, 103u8, + 235u8, 92u8, 167u8, 197u8, 252u8, 146u8, 155u8, 187u8, 238u8, 86u8, + 91u8, ], ) } } + pub mod validators { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + } + } + pub mod current_index { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod queued_changed { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + pub mod queued_keys { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::rococo_runtime::SessionKeys, + )>; + } + } + pub mod disabled_validators { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::sp_staking::offence::OffenceSeverity, + )>; + } + } + pub mod next_keys { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::rococo_runtime::SessionKeys; + } + } + pub mod key_owner { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ( + runtime_types::sp_core::crypto::KeyTypeId, + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ); + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } } pub mod constants { use super::runtime_types; @@ -11332,45 +9650,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod state { - use super::runtime_types; - pub type State = - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; - } - pub mod pending_change { - use super::runtime_types; - pub type PendingChange = - runtime_types::pallet_grandpa::StoredPendingChange<::core::primitive::u32>; - } - pub mod next_forced { - use super::runtime_types; - pub type NextForced = ::core::primitive::u32; - } - pub mod stalled { - use super::runtime_types; - pub type Stalled = (::core::primitive::u32, ::core::primitive::u32); - } - pub mod current_set_id { - use super::runtime_types; - pub type CurrentSetId = ::core::primitive::u64; - } - pub mod set_id_session { - use super::runtime_types; - pub type SetIdSession = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u64; - } - pub mod authorities { - use super::runtime_types; - pub type Authorities = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_grandpa::app::Public, - ::core::primitive::u64, - )>; - } - } pub struct StorageApi; impl StorageApi { #[doc = " State of the current authority set."] @@ -11378,19 +9659,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::state::State, - ::subxt::ext::subxt_core::utils::Yes, + state::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Grandpa", "State", - (), [ - 73u8, 71u8, 112u8, 83u8, 238u8, 75u8, 44u8, 9u8, 180u8, 33u8, 30u8, - 121u8, 98u8, 96u8, 61u8, 133u8, 16u8, 70u8, 30u8, 249u8, 34u8, 148u8, - 15u8, 239u8, 164u8, 157u8, 52u8, 27u8, 144u8, 52u8, 223u8, 109u8, + 114u8, 253u8, 11u8, 149u8, 130u8, 90u8, 171u8, 105u8, 7u8, 240u8, + 141u8, 95u8, 1u8, 133u8, 52u8, 124u8, 23u8, 200u8, 144u8, 133u8, 51u8, + 253u8, 195u8, 207u8, 131u8, 12u8, 80u8, 13u8, 98u8, 204u8, 167u8, + 166u8, ], ) } @@ -11399,20 +9678,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::pending_change::PendingChange, + pending_change::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Grandpa", "PendingChange", - (), [ - 32u8, 165u8, 141u8, 100u8, 109u8, 66u8, 58u8, 22u8, 118u8, 84u8, 92u8, - 164u8, 119u8, 130u8, 104u8, 25u8, 244u8, 111u8, 223u8, 54u8, 184u8, - 95u8, 196u8, 30u8, 244u8, 129u8, 110u8, 127u8, 200u8, 66u8, 226u8, - 26u8, + 157u8, 46u8, 184u8, 78u8, 39u8, 39u8, 170u8, 225u8, 221u8, 4u8, 80u8, + 16u8, 3u8, 106u8, 207u8, 217u8, 102u8, 247u8, 20u8, 67u8, 166u8, 102u8, + 78u8, 209u8, 54u8, 21u8, 117u8, 46u8, 229u8, 215u8, 1u8, 148u8, ], ) } @@ -11421,19 +9696,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_forced::NextForced, + next_forced::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Grandpa", "NextForced", - (), [ - 3u8, 231u8, 56u8, 18u8, 87u8, 112u8, 227u8, 126u8, 180u8, 131u8, 255u8, - 141u8, 82u8, 34u8, 61u8, 47u8, 234u8, 37u8, 95u8, 62u8, 33u8, 235u8, - 231u8, 122u8, 125u8, 8u8, 223u8, 95u8, 255u8, 204u8, 40u8, 97u8, + 26u8, 66u8, 120u8, 170u8, 150u8, 89u8, 5u8, 170u8, 18u8, 250u8, 222u8, + 75u8, 86u8, 62u8, 62u8, 211u8, 98u8, 5u8, 55u8, 152u8, 8u8, 172u8, + 221u8, 19u8, 87u8, 166u8, 217u8, 52u8, 118u8, 161u8, 79u8, 4u8, ], ) } @@ -11442,19 +9714,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::stalled::Stalled, + stalled::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Grandpa", "Stalled", - (), [ - 6u8, 81u8, 205u8, 142u8, 195u8, 48u8, 0u8, 247u8, 108u8, 170u8, 10u8, - 249u8, 72u8, 206u8, 32u8, 103u8, 109u8, 57u8, 51u8, 21u8, 144u8, 204u8, - 79u8, 8u8, 191u8, 185u8, 38u8, 34u8, 118u8, 223u8, 75u8, 241u8, + 222u8, 146u8, 140u8, 145u8, 154u8, 199u8, 130u8, 232u8, 53u8, 97u8, + 136u8, 16u8, 6u8, 100u8, 178u8, 2u8, 43u8, 13u8, 149u8, 238u8, 135u8, + 238u8, 147u8, 11u8, 181u8, 27u8, 68u8, 111u8, 149u8, 206u8, 54u8, 28u8, ], ) } @@ -11464,50 +9733,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::current_set_id::CurrentSetId, - ::subxt::ext::subxt_core::utils::Yes, + current_set_id::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Grandpa", "CurrentSetId", - (), [ - 234u8, 215u8, 218u8, 42u8, 30u8, 76u8, 129u8, 40u8, 125u8, 137u8, - 207u8, 47u8, 46u8, 213u8, 159u8, 50u8, 175u8, 81u8, 155u8, 123u8, - 246u8, 175u8, 156u8, 68u8, 22u8, 113u8, 135u8, 137u8, 163u8, 18u8, - 115u8, 73u8, - ], - ) - } - #[doc = " A mapping from grandpa set ID to the index of the *most recent* session for which its"] - #[doc = " members were responsible."] - #[doc = ""] - #[doc = " This is only used for validating equivocation proofs. An equivocation proof must"] - #[doc = " contains a key-ownership proof for a given session, therefore we need a way to tie"] - #[doc = " together sessions and GRANDPA set ids, i.e. we need to validate that a validator"] - #[doc = " was the owner of a given key on a given session, and what the active set ID was"] - #[doc = " during that session."] - #[doc = ""] - #[doc = " TWOX-NOTE: `SetId` is not under user control."] - pub fn set_id_session_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::set_id_session::SetIdSession, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Grandpa", - "SetIdSession", - (), - [ - 47u8, 0u8, 239u8, 121u8, 187u8, 213u8, 254u8, 50u8, 238u8, 10u8, 162u8, - 65u8, 189u8, 166u8, 37u8, 74u8, 82u8, 81u8, 160u8, 20u8, 180u8, 253u8, - 238u8, 18u8, 209u8, 203u8, 38u8, 148u8, 16u8, 105u8, 72u8, 169u8, + 24u8, 21u8, 118u8, 180u8, 203u8, 56u8, 108u8, 220u8, 19u8, 26u8, 56u8, + 207u8, 254u8, 160u8, 122u8, 106u8, 47u8, 55u8, 128u8, 86u8, 175u8, + 225u8, 132u8, 100u8, 128u8, 62u8, 148u8, 171u8, 163u8, 234u8, 35u8, + 19u8, ], ) } @@ -11523,24 +9759,19 @@ pub mod api { #[doc = " TWOX-NOTE: `SetId` is not under user control."] pub fn set_id_session( &self, - _0: types::set_id_session::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::set_id_session::Param0, - >, - types::set_id_session::SetIdSession, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (set_id_session::Param0,), + set_id_session::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Grandpa", "SetIdSession", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 47u8, 0u8, 239u8, 121u8, 187u8, 213u8, 254u8, 50u8, 238u8, 10u8, 162u8, - 65u8, 189u8, 166u8, 37u8, 74u8, 82u8, 81u8, 160u8, 20u8, 180u8, 253u8, - 238u8, 18u8, 209u8, 203u8, 38u8, 148u8, 16u8, 105u8, 72u8, 169u8, + 103u8, 143u8, 223u8, 143u8, 232u8, 62u8, 107u8, 53u8, 99u8, 129u8, + 124u8, 35u8, 87u8, 83u8, 188u8, 228u8, 91u8, 129u8, 131u8, 154u8, + 208u8, 221u8, 54u8, 83u8, 144u8, 66u8, 54u8, 35u8, 72u8, 126u8, 97u8, + 63u8, ], ) } @@ -11549,24 +9780,83 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::authorities::Authorities, - ::subxt::ext::subxt_core::utils::Yes, + authorities::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Grandpa", "Authorities", - (), [ - 192u8, 157u8, 98u8, 244u8, 104u8, 38u8, 195u8, 114u8, 183u8, 62u8, - 247u8, 18u8, 31u8, 152u8, 246u8, 206u8, 97u8, 13u8, 118u8, 211u8, - 104u8, 54u8, 150u8, 152u8, 126u8, 170u8, 228u8, 158u8, 108u8, 129u8, - 134u8, 44u8, + 210u8, 230u8, 47u8, 62u8, 255u8, 111u8, 43u8, 183u8, 246u8, 15u8, 54u8, + 24u8, 160u8, 228u8, 106u8, 168u8, 219u8, 241u8, 231u8, 234u8, 54u8, + 109u8, 72u8, 4u8, 76u8, 205u8, 130u8, 30u8, 150u8, 46u8, 5u8, 147u8, ], ) } } + pub mod state { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; + } + } + pub mod pending_change { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_grandpa::StoredPendingChange<::core::primitive::u32>; + } + } + pub mod next_forced { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod stalled { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = (::core::primitive::u32, ::core::primitive::u32); + } + } + pub mod current_set_id { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u64; + } + } + pub mod set_id_session { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod authorities { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_grandpa::app::Public, + ::core::primitive::u64, + )>; + } + } } pub mod constants { use super::runtime_types; @@ -11635,24 +9925,8 @@ pub mod api { use super::root_mod; use super::runtime_types; pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod keys { - use super::runtime_types; - pub type Keys = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >; - } - pub mod next_keys { - use super::runtime_types; - pub type NextKeys = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Keys of the current authority set."] @@ -11660,20 +9934,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::keys::Keys, - ::subxt::ext::subxt_core::utils::Yes, + keys::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AuthorityDiscovery", "Keys", - (), [ - 35u8, 71u8, 73u8, 255u8, 160u8, 250u8, 38u8, 205u8, 32u8, 139u8, 236u8, - 83u8, 194u8, 12u8, 20u8, 221u8, 114u8, 94u8, 196u8, 246u8, 136u8, - 175u8, 70u8, 98u8, 91u8, 50u8, 236u8, 131u8, 131u8, 146u8, 150u8, - 192u8, + 187u8, 234u8, 131u8, 183u8, 0u8, 196u8, 9u8, 140u8, 237u8, 138u8, 88u8, + 216u8, 76u8, 181u8, 31u8, 11u8, 228u8, 92u8, 42u8, 203u8, 31u8, 185u8, + 237u8, 12u8, 135u8, 194u8, 67u8, 244u8, 100u8, 192u8, 13u8, 202u8, ], ) } @@ -11682,24 +9952,43 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_keys::NextKeys, - ::subxt::ext::subxt_core::utils::Yes, + next_keys::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AuthorityDiscovery", "NextKeys", - (), [ - 54u8, 44u8, 61u8, 196u8, 2u8, 249u8, 185u8, 199u8, 245u8, 154u8, 178u8, - 109u8, 237u8, 147u8, 72u8, 209u8, 72u8, 196u8, 31u8, 192u8, 217u8, - 231u8, 71u8, 28u8, 148u8, 138u8, 29u8, 115u8, 247u8, 95u8, 185u8, - 189u8, + 153u8, 172u8, 81u8, 46u8, 31u8, 183u8, 84u8, 239u8, 194u8, 111u8, + 225u8, 130u8, 129u8, 170u8, 176u8, 0u8, 97u8, 82u8, 104u8, 186u8, 79u8, + 78u8, 144u8, 68u8, 86u8, 190u8, 225u8, 204u8, 111u8, 137u8, 29u8, + 188u8, ], ) } } + pub mod keys { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::sp_authority_discovery::app::Public, + >; + } + } + pub mod next_keys { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::sp_authority_discovery::app::Public, + >; + } + } } } pub mod treasury { @@ -12478,52 +10767,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod proposal_count { - use super::runtime_types; - pub type ProposalCount = ::core::primitive::u32; - } - pub mod proposals { - use super::runtime_types; - pub type Proposals = runtime_types::pallet_treasury::Proposal< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod deactivated { - use super::runtime_types; - pub type Deactivated = ::core::primitive::u128; - } - pub mod approvals { - use super::runtime_types; - pub type Approvals = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - } - pub mod spend_count { - use super::runtime_types; - pub type SpendCount = ::core::primitive::u32; - } - pub mod spends { - use super::runtime_types; - pub type Spends = runtime_types::pallet_treasury::SpendStatus< - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, - ::core::primitive::u128, - runtime_types::xcm::VersionedLocation, - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod last_spend_period { - use super::runtime_types; - pub type LastSpendPeriod = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] @@ -12534,44 +10779,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::proposal_count::ProposalCount, + proposal_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Treasury", "ProposalCount", - (), [ - 91u8, 238u8, 246u8, 106u8, 95u8, 66u8, 83u8, 134u8, 1u8, 225u8, 164u8, - 216u8, 113u8, 101u8, 203u8, 200u8, 113u8, 97u8, 246u8, 228u8, 140u8, - 29u8, 29u8, 48u8, 176u8, 137u8, 93u8, 230u8, 56u8, 75u8, 51u8, 149u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[doc = ""] - #[doc = " Proposals that have been made."] - pub fn proposals_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proposals::Proposals, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Treasury", - "Proposals", - (), - [ - 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, - 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, - 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, - 55u8, + 156u8, 144u8, 17u8, 151u8, 99u8, 169u8, 13u8, 107u8, 51u8, 33u8, 199u8, + 124u8, 148u8, 181u8, 18u8, 108u8, 15u8, 51u8, 139u8, 100u8, 215u8, + 52u8, 210u8, 249u8, 153u8, 184u8, 240u8, 61u8, 89u8, 24u8, 248u8, + 193u8, ], ) } @@ -12581,25 +10799,18 @@ pub mod api { #[doc = " Proposals that have been made."] pub fn proposals( &self, - _0: types::proposals::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proposals::Param0, - >, - types::proposals::Proposals, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (proposals::Param0,), + proposals::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Treasury", "Proposals", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, - 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, - 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, - 55u8, + 5u8, 182u8, 231u8, 42u8, 76u8, 117u8, 95u8, 202u8, 178u8, 159u8, 247u8, + 152u8, 30u8, 177u8, 207u8, 36u8, 89u8, 16u8, 85u8, 122u8, 141u8, 127u8, + 203u8, 179u8, 70u8, 108u8, 196u8, 208u8, 50u8, 118u8, 58u8, 111u8, ], ) } @@ -12608,20 +10819,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::deactivated::Deactivated, - ::subxt::ext::subxt_core::utils::Yes, + deactivated::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Treasury", "Deactivated", - (), [ - 120u8, 221u8, 159u8, 56u8, 161u8, 44u8, 54u8, 233u8, 47u8, 114u8, - 170u8, 150u8, 52u8, 24u8, 137u8, 212u8, 122u8, 247u8, 40u8, 17u8, - 208u8, 130u8, 42u8, 154u8, 33u8, 222u8, 59u8, 116u8, 0u8, 15u8, 79u8, - 123u8, + 105u8, 92u8, 156u8, 114u8, 20u8, 196u8, 65u8, 47u8, 107u8, 60u8, 49u8, + 192u8, 10u8, 132u8, 235u8, 91u8, 119u8, 81u8, 108u8, 226u8, 38u8, 80u8, + 169u8, 0u8, 58u8, 131u8, 247u8, 91u8, 165u8, 22u8, 195u8, 237u8, ], ) } @@ -12633,19 +10840,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::approvals::Approvals, + approvals::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Treasury", "Approvals", - (), [ - 78u8, 147u8, 186u8, 235u8, 17u8, 40u8, 247u8, 235u8, 67u8, 222u8, 3u8, - 14u8, 248u8, 17u8, 67u8, 180u8, 93u8, 161u8, 64u8, 35u8, 119u8, 194u8, - 187u8, 226u8, 135u8, 162u8, 147u8, 174u8, 139u8, 72u8, 99u8, 212u8, + 59u8, 173u8, 163u8, 253u8, 173u8, 124u8, 22u8, 252u8, 199u8, 25u8, + 17u8, 15u8, 239u8, 80u8, 199u8, 42u8, 142u8, 166u8, 210u8, 166u8, + 163u8, 52u8, 148u8, 69u8, 80u8, 157u8, 43u8, 96u8, 0u8, 10u8, 251u8, + 191u8, ], ) } @@ -12654,65 +10859,36 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::spend_count::SpendCount, - ::subxt::ext::subxt_core::utils::Yes, + spend_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Treasury", "SpendCount", - (), [ - 220u8, 74u8, 248u8, 52u8, 243u8, 209u8, 42u8, 236u8, 27u8, 98u8, 76u8, - 153u8, 129u8, 176u8, 34u8, 177u8, 33u8, 132u8, 21u8, 71u8, 206u8, - 146u8, 222u8, 44u8, 232u8, 246u8, 205u8, 92u8, 240u8, 136u8, 182u8, - 30u8, - ], - ) - } - #[doc = " Spends that have been approved and being processed."] - pub fn spends_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::spends::Spends, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Treasury", - "Spends", - (), - [ - 19u8, 242u8, 70u8, 81u8, 218u8, 158u8, 21u8, 93u8, 185u8, 202u8, 241u8, - 52u8, 246u8, 236u8, 186u8, 250u8, 247u8, 166u8, 123u8, 45u8, 201u8, - 101u8, 254u8, 12u8, 77u8, 229u8, 167u8, 3u8, 75u8, 112u8, 112u8, 55u8, + 6u8, 150u8, 28u8, 208u8, 11u8, 250u8, 217u8, 197u8, 59u8, 0u8, 188u8, + 30u8, 17u8, 235u8, 130u8, 144u8, 184u8, 240u8, 61u8, 110u8, 89u8, + 169u8, 194u8, 126u8, 73u8, 244u8, 232u8, 243u8, 241u8, 102u8, 212u8, + 2u8, ], ) } #[doc = " Spends that have been approved and being processed."] pub fn spends( &self, - _0: types::spends::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::spends::Param0, - >, - types::spends::Spends, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (spends::Param0,), + spends::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Treasury", "Spends", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 19u8, 242u8, 70u8, 81u8, 218u8, 158u8, 21u8, 93u8, 185u8, 202u8, 241u8, - 52u8, 246u8, 236u8, 186u8, 250u8, 247u8, 166u8, 123u8, 45u8, 201u8, - 101u8, 254u8, 12u8, 77u8, 229u8, 167u8, 3u8, 75u8, 112u8, 112u8, 55u8, + 173u8, 16u8, 119u8, 226u8, 211u8, 50u8, 185u8, 155u8, 134u8, 186u8, + 164u8, 99u8, 211u8, 59u8, 57u8, 230u8, 165u8, 105u8, 98u8, 249u8, 3u8, + 154u8, 158u8, 147u8, 184u8, 169u8, 201u8, 101u8, 129u8, 108u8, 133u8, + 239u8, ], ) } @@ -12721,24 +10897,89 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::last_spend_period::LastSpendPeriod, + last_spend_period::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Treasury", "LastSpendPeriod", - (), [ - 6u8, 200u8, 107u8, 132u8, 60u8, 31u8, 24u8, 196u8, 108u8, 227u8, 5u8, - 63u8, 249u8, 139u8, 82u8, 140u8, 169u8, 242u8, 118u8, 93u8, 83u8, - 155u8, 120u8, 175u8, 224u8, 227u8, 39u8, 39u8, 255u8, 247u8, 79u8, - 30u8, + 81u8, 7u8, 3u8, 116u8, 182u8, 205u8, 240u8, 116u8, 12u8, 65u8, 120u8, + 56u8, 16u8, 172u8, 174u8, 93u8, 220u8, 150u8, 116u8, 25u8, 51u8, 73u8, + 108u8, 18u8, 244u8, 6u8, 155u8, 132u8, 201u8, 101u8, 56u8, 236u8, ], ) } } + pub mod proposal_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod proposals { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_treasury::Proposal< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + } + } + pub mod deactivated { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod approvals { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; + } + } + pub mod spend_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod spends { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_treasury::SpendStatus< + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset, + ::core::primitive::u128, + runtime_types::xcm::VersionedLocation, + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + } + pub mod last_spend_period { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } } pub mod constants { use super::runtime_types; @@ -13466,133 +11707,26 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod voting_for { - use super::runtime_types; - pub type VotingFor = runtime_types::pallet_conviction_voting::vote::Voting< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::core::primitive::u16; - } - pub mod class_locks_for { - use super::runtime_types; - pub type ClassLocksFor = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u16, - ::core::primitive::u128, - )>; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting_for::VotingFor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", - (), - [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, - ], - ) - } - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter1( - &self, - _0: types::voting_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, - >, - types::voting_for::VotingFor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, - ], - ) - } #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] #[doc = " number of votes that we have recorded."] pub fn voting_for( &self, - _0: types::voting_for::Param0, - _1: types::voting_for::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param1, - >, - ), - types::voting_for::VotingFor, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (voting_for::Param0, voting_for::Param1), + voting_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ConvictionVoting", "VotingFor", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, - ], - ) - } - #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] - #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] - #[doc = " this list."] - pub fn class_locks_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::class_locks_for::ClassLocksFor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "ClassLocksFor", - (), [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, + 107u8, 228u8, 53u8, 29u8, 60u8, 240u8, 150u8, 36u8, 55u8, 174u8, 255u8, + 186u8, 154u8, 65u8, 19u8, 149u8, 187u8, 247u8, 60u8, 156u8, 174u8, + 160u8, 41u8, 161u8, 125u8, 139u8, 128u8, 7u8, 232u8, 1u8, 4u8, 197u8, ], ) } @@ -13601,28 +11735,49 @@ pub mod api { #[doc = " this list."] pub fn class_locks_for( &self, - _0: types::class_locks_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::class_locks_for::Param0, - >, - types::class_locks_for::ClassLocksFor, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (class_locks_for::Param0,), + class_locks_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ConvictionVoting", "ClassLocksFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, + 83u8, 110u8, 221u8, 253u8, 126u8, 134u8, 8u8, 54u8, 169u8, 116u8, + 106u8, 20u8, 25u8, 121u8, 172u8, 147u8, 60u8, 160u8, 248u8, 64u8, 61u8, + 103u8, 58u8, 244u8, 115u8, 142u8, 113u8, 132u8, 224u8, 70u8, 34u8, + 34u8, ], ) } } + pub mod voting_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::core::primitive::u16; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_conviction_voting::vote::Voting< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + ::core::primitive::u32, + >; + } + } + pub mod class_locks_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + (::core::primitive::u16, ::core::primitive::u128), + >; + } + } } pub mod constants { use super::runtime_types; @@ -14546,53 +12701,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod referendum_count { - use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; - } - pub mod referendum_info_for { - use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::rococo_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u128, - runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - ::subxt::ext::subxt_core::utils::AccountId32, - (::core::primitive::u32, ::core::primitive::u32), - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod track_queue { - use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u128, - )>; - pub type Param0 = ::core::primitive::u16; - } - pub mod deciding_count { - use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod metadata_of { - use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The next free referendum index, aka the number of referenda started so far."] @@ -14600,89 +12710,35 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::referendum_count::ReferendumCount, - ::subxt::ext::subxt_core::utils::Yes, + referendum_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", "ReferendumCount", - (), - [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, - ], - ) - } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_info_for::ReferendumInfoFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumInfoFor", - (), [ - 123u8, 87u8, 188u8, 82u8, 34u8, 134u8, 67u8, 91u8, 100u8, 213u8, 39u8, - 126u8, 205u8, 149u8, 10u8, 60u8, 57u8, 243u8, 173u8, 17u8, 27u8, 99u8, - 95u8, 52u8, 20u8, 108u8, 209u8, 15u8, 49u8, 192u8, 249u8, 23u8, + 232u8, 73u8, 11u8, 155u8, 77u8, 38u8, 206u8, 180u8, 225u8, 34u8, 76u8, + 119u8, 201u8, 214u8, 107u8, 115u8, 247u8, 199u8, 210u8, 23u8, 24u8, + 36u8, 17u8, 138u8, 151u8, 179u8, 77u8, 235u8, 101u8, 16u8, 153u8, 5u8, ], ) } #[doc = " Information concerning any given referendum."] pub fn referendum_info_for( &self, - _0: types::referendum_info_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, - >, - types::referendum_info_for::ReferendumInfoFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (referendum_info_for::Param0,), + referendum_info_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", "ReferendumInfoFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 123u8, 87u8, 188u8, 82u8, 34u8, 134u8, 67u8, 91u8, 100u8, 213u8, 39u8, - 126u8, 205u8, 149u8, 10u8, 60u8, 57u8, 243u8, 173u8, 17u8, 27u8, 99u8, - 95u8, 52u8, 20u8, 108u8, 209u8, 15u8, 49u8, 192u8, 249u8, 23u8, - ], - ) - } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::track_queue::TrackQueue, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "TrackQueue", - (), [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, + 242u8, 207u8, 111u8, 179u8, 187u8, 50u8, 125u8, 159u8, 55u8, 141u8, + 40u8, 175u8, 209u8, 175u8, 21u8, 61u8, 194u8, 84u8, 10u8, 187u8, 2u8, + 159u8, 112u8, 21u8, 50u8, 75u8, 221u8, 135u8, 195u8, 196u8, 251u8, + 237u8, ], ) } @@ -14692,98 +12748,36 @@ pub mod api { #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] pub fn track_queue( &self, - _0: types::track_queue::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, - >, - types::track_queue::TrackQueue, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (track_queue::Param0,), + track_queue::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", "TrackQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, - ], - ) - } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::deciding_count::DecidingCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "DecidingCount", - (), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 106u8, 185u8, 56u8, 40u8, 8u8, 52u8, 141u8, 108u8, 130u8, 65u8, 20u8, + 224u8, 189u8, 200u8, 131u8, 73u8, 51u8, 83u8, 180u8, 167u8, 153u8, + 40u8, 133u8, 25u8, 197u8, 157u8, 11u8, 150u8, 199u8, 178u8, 78u8, 48u8, ], ) } #[doc = " The number of referenda being decided currently."] pub fn deciding_count( &self, - _0: types::deciding_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, - >, - types::deciding_count::DecidingCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (deciding_count::Param0,), + deciding_count::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", "DecidingCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, - ], - ) - } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::metadata_of::MetadataOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "MetadataOf", - (), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 85u8, 33u8, 77u8, 180u8, 1u8, 53u8, 133u8, 150u8, 62u8, 158u8, 45u8, + 170u8, 50u8, 163u8, 251u8, 43u8, 190u8, 99u8, 228u8, 162u8, 0u8, 243u8, + 26u8, 253u8, 8u8, 71u8, 247u8, 201u8, 146u8, 51u8, 192u8, 169u8, ], ) } @@ -14795,29 +12789,83 @@ pub mod api { #[doc = " large preimages."] pub fn metadata_of( &self, - _0: types::metadata_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, - >, - types::metadata_of::MetadataOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (metadata_of::Param0,), + metadata_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", "MetadataOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 253u8, 126u8, 86u8, 30u8, 183u8, 33u8, 216u8, 248u8, 166u8, 223u8, + 103u8, 119u8, 212u8, 100u8, 81u8, 230u8, 85u8, 98u8, 250u8, 2u8, 101u8, + 217u8, 184u8, 248u8, 176u8, 167u8, 9u8, 79u8, 242u8, 107u8, 192u8, + 141u8, ], ) } } + pub mod referendum_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod referendum_info_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::rococo_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + ::core::primitive::u128, + runtime_types::pallet_conviction_voting::types::Tally< + ::core::primitive::u128, + >, + ::subxt::ext::subxt_core::utils::AccountId32, + (::core::primitive::u32, ::core::primitive::u32), + >; + } + } + pub mod track_queue { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u16; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + (::core::primitive::u32, ::core::primitive::u128), + >; + } + } + pub mod deciding_count { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u16; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod metadata_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } } pub mod constants { use super::runtime_types; @@ -15459,266 +13507,63 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod member_count { - use super::runtime_types; - pub type MemberCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod members { - use super::runtime_types; - pub type Members = runtime_types::pallet_ranked_collective::MemberRecord; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod id_to_index { - use super::runtime_types; - pub type IdToIndex = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod index_to_id { - use super::runtime_types; - pub type IndexToId = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::core::primitive::u32; - } - pub mod voting { - use super::runtime_types; - pub type Voting = runtime_types::pallet_ranked_collective::VoteRecord; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod voting_cleanup { - use super::runtime_types; - pub type VotingCleanup = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The number of members in the collective who have at least the rank according to the index"] - #[doc = " of the vec."] - pub fn member_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::member_count::MemberCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "MemberCount", - (), - [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, - ], - ) - } #[doc = " The number of members in the collective who have at least the rank according to the index"] #[doc = " of the vec."] pub fn member_count( &self, - _0: types::member_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::member_count::Param0, - >, - types::member_count::MemberCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (member_count::Param0,), + member_count::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipCollective", "MemberCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, - ], - ) - } - #[doc = " The current members of the collective."] - pub fn members_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::members::Members, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "Members", - (), [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, + 47u8, 32u8, 80u8, 144u8, 98u8, 138u8, 121u8, 69u8, 44u8, 50u8, 159u8, + 166u8, 64u8, 18u8, 142u8, 160u8, 181u8, 42u8, 77u8, 161u8, 29u8, 6u8, + 85u8, 103u8, 190u8, 194u8, 156u8, 225u8, 19u8, 63u8, 83u8, 225u8, ], ) } #[doc = " The current members of the collective."] pub fn members( &self, - _0: types::members::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::members::Param0, - >, - types::members::Members, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (members::Param0,), + members::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipCollective", "Members", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, - ], - ) - } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::id_to_index::IdToIndex, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "IdToIndex", - (), - [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, - ], - ) - } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter1( - &self, - _0: types::id_to_index::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, - >, - types::id_to_index::IdToIndex, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "IdToIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + 155u8, 7u8, 100u8, 56u8, 195u8, 166u8, 99u8, 157u8, 248u8, 106u8, + 237u8, 216u8, 231u8, 138u8, 17u8, 4u8, 109u8, 233u8, 129u8, 190u8, + 110u8, 8u8, 158u8, 158u8, 6u8, 164u8, 49u8, 219u8, 21u8, 19u8, 41u8, + 137u8, ], ) } #[doc = " The index of each ranks's member into the group of members who have at least that rank."] pub fn id_to_index( &self, - _0: types::id_to_index::Param0, - _1: types::id_to_index::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param1, - >, - ), - types::id_to_index::IdToIndex, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (id_to_index::Param0, id_to_index::Param1), + id_to_index::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipCollective", "IdToIndex", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, - ], - ) - } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::index_to_id::IndexToId, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "IndexToId", - (), - [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, - ], - ) - } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter1( - &self, - _0: types::index_to_id::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, - >, - types::index_to_id::IndexToId, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "IndexToId", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, + 176u8, 202u8, 205u8, 0u8, 74u8, 53u8, 31u8, 205u8, 95u8, 240u8, 246u8, + 129u8, 231u8, 15u8, 100u8, 92u8, 60u8, 5u8, 128u8, 159u8, 177u8, 33u8, + 234u8, 90u8, 177u8, 129u8, 35u8, 68u8, 176u8, 151u8, 252u8, 229u8, ], ) } @@ -15726,162 +13571,116 @@ pub mod api { #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] pub fn index_to_id( &self, - _0: types::index_to_id::Param0, - _1: types::index_to_id::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param1, - >, - ), - types::index_to_id::IndexToId, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (index_to_id::Param0, index_to_id::Param1), + index_to_id::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipCollective", "IndexToId", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, - ], - ) - } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting::Voting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "Voting", - (), - [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, - ], - ) - } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter1( - &self, - _0: types::voting::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, - >, - types::voting::Voting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "Voting", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 241u8, 253u8, 1u8, 29u8, 180u8, 181u8, 92u8, 174u8, 51u8, 117u8, 145u8, + 199u8, 40u8, 156u8, 65u8, 38u8, 98u8, 2u8, 153u8, 188u8, 42u8, 137u8, + 47u8, 112u8, 158u8, 29u8, 60u8, 196u8, 125u8, 79u8, 82u8, 81u8, ], ) } #[doc = " Votes on a given proposal, if it is ongoing."] pub fn voting( &self, - _0: types::voting::Param0, - _1: types::voting::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param1, - >, - ), - types::voting::Voting, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (voting::Param0, voting::Param1), + voting::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipCollective", "Voting", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, - ], - ) - } - pub fn voting_cleanup_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting_cleanup::VotingCleanup, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipCollective", - "VotingCleanup", - (), [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 161u8, 85u8, 44u8, 149u8, 207u8, 229u8, 13u8, 85u8, 81u8, 56u8, 99u8, + 15u8, 43u8, 35u8, 193u8, 116u8, 27u8, 56u8, 158u8, 227u8, 111u8, 79u8, + 241u8, 152u8, 201u8, 52u8, 157u8, 211u8, 83u8, 46u8, 165u8, 136u8, ], ) } pub fn voting_cleanup( &self, - _0: types::voting_cleanup::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_cleanup::Param0, - >, - types::voting_cleanup::VotingCleanup, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (voting_cleanup::Param0,), + voting_cleanup::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipCollective", "VotingCleanup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 219u8, 136u8, 68u8, 166u8, 131u8, 80u8, 74u8, 130u8, 75u8, 16u8, 133u8, + 243u8, 236u8, 171u8, 151u8, 103u8, 228u8, 163u8, 73u8, 144u8, 107u8, + 147u8, 156u8, 45u8, 93u8, 179u8, 248u8, 11u8, 93u8, 58u8, 75u8, 97u8, ], ) } } + pub mod member_count { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u16; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod members { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_ranked_collective::MemberRecord; + } + } + pub mod id_to_index { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod index_to_id { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } + pub mod voting { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_ranked_collective::VoteRecord; + } + } + pub mod voting_cleanup { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + } } } pub mod fellowship_referenda { @@ -16753,51 +14552,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod referendum_count { - use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; - } - pub mod referendum_info_for { - use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::rococo_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u128, - runtime_types::pallet_ranked_collective::Tally, - ::subxt::ext::subxt_core::utils::AccountId32, - (::core::primitive::u32, ::core::primitive::u32), - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod track_queue { - use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u32, - )>; - pub type Param0 = ::core::primitive::u16; - } - pub mod deciding_count { - use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod metadata_of { - use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The next free referendum index, aka the number of referenda started so far."] @@ -16805,90 +14561,34 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::referendum_count::ReferendumCount, - ::subxt::ext::subxt_core::utils::Yes, + referendum_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipReferenda", "ReferendumCount", - (), [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, - ], - ) - } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_info_for::ReferendumInfoFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipReferenda", - "ReferendumInfoFor", - (), - [ - 100u8, 38u8, 100u8, 224u8, 1u8, 49u8, 248u8, 77u8, 107u8, 120u8, 117u8, - 239u8, 75u8, 87u8, 27u8, 160u8, 174u8, 225u8, 219u8, 216u8, 166u8, - 213u8, 47u8, 135u8, 28u8, 159u8, 28u8, 139u8, 84u8, 249u8, 223u8, 27u8, + 232u8, 73u8, 11u8, 155u8, 77u8, 38u8, 206u8, 180u8, 225u8, 34u8, 76u8, + 119u8, 201u8, 214u8, 107u8, 115u8, 247u8, 199u8, 210u8, 23u8, 24u8, + 36u8, 17u8, 138u8, 151u8, 179u8, 77u8, 235u8, 101u8, 16u8, 153u8, 5u8, ], ) } #[doc = " Information concerning any given referendum."] pub fn referendum_info_for( &self, - _0: types::referendum_info_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, - >, - types::referendum_info_for::ReferendumInfoFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (referendum_info_for::Param0,), + referendum_info_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipReferenda", "ReferendumInfoFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 100u8, 38u8, 100u8, 224u8, 1u8, 49u8, 248u8, 77u8, 107u8, 120u8, 117u8, - 239u8, 75u8, 87u8, 27u8, 160u8, 174u8, 225u8, 219u8, 216u8, 166u8, - 213u8, 47u8, 135u8, 28u8, 159u8, 28u8, 139u8, 84u8, 249u8, 223u8, 27u8, - ], - ) - } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::track_queue::TrackQueue, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipReferenda", - "TrackQueue", - (), - [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, + 220u8, 201u8, 95u8, 1u8, 247u8, 11u8, 37u8, 149u8, 83u8, 114u8, 78u8, + 52u8, 40u8, 138u8, 25u8, 65u8, 95u8, 78u8, 141u8, 138u8, 74u8, 152u8, + 163u8, 182u8, 193u8, 247u8, 197u8, 131u8, 144u8, 169u8, 228u8, 249u8, ], ) } @@ -16898,99 +14598,36 @@ pub mod api { #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] pub fn track_queue( &self, - _0: types::track_queue::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, - >, - types::track_queue::TrackQueue, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (track_queue::Param0,), + track_queue::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipReferenda", "TrackQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, - ], - ) - } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::deciding_count::DecidingCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipReferenda", - "DecidingCount", - (), - [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 100u8, 84u8, 204u8, 8u8, 215u8, 19u8, 11u8, 95u8, 17u8, 120u8, 32u8, + 56u8, 236u8, 171u8, 59u8, 174u8, 66u8, 117u8, 54u8, 204u8, 68u8, 154u8, + 226u8, 43u8, 32u8, 199u8, 196u8, 122u8, 18u8, 28u8, 99u8, 221u8, ], ) } #[doc = " The number of referenda being decided currently."] pub fn deciding_count( &self, - _0: types::deciding_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, - >, - types::deciding_count::DecidingCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (deciding_count::Param0,), + deciding_count::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipReferenda", "DecidingCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, - ], - ) - } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::metadata_of::MetadataOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "FellowshipReferenda", - "MetadataOf", - (), - [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 85u8, 33u8, 77u8, 180u8, 1u8, 53u8, 133u8, 150u8, 62u8, 158u8, 45u8, + 170u8, 50u8, 163u8, 251u8, 43u8, 190u8, 99u8, 228u8, 162u8, 0u8, 243u8, + 26u8, 253u8, 8u8, 71u8, 247u8, 201u8, 146u8, 51u8, 192u8, 169u8, ], ) } @@ -17002,29 +14639,81 @@ pub mod api { #[doc = " large preimages."] pub fn metadata_of( &self, - _0: types::metadata_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, - >, - types::metadata_of::MetadataOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (metadata_of::Param0,), + metadata_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "FellowshipReferenda", "MetadataOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 253u8, 126u8, 86u8, 30u8, 183u8, 33u8, 216u8, 248u8, 166u8, 223u8, + 103u8, 119u8, 212u8, 100u8, 81u8, 230u8, 85u8, 98u8, 250u8, 2u8, 101u8, + 217u8, 184u8, 248u8, 176u8, 167u8, 9u8, 79u8, 242u8, 107u8, 192u8, + 141u8, ], ) } } + pub mod referendum_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod referendum_info_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::rococo_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + ::core::primitive::u128, + runtime_types::pallet_ranked_collective::Tally, + ::subxt::ext::subxt_core::utils::AccountId32, + (::core::primitive::u32, ::core::primitive::u32), + >; + } + } + pub mod track_queue { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u16; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + (::core::primitive::u32, ::core::primitive::u32), + >; + } + } + pub mod deciding_count { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u16; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod metadata_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } } pub mod constants { use super::runtime_types; @@ -17391,61 +15080,37 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod whitelisted_call { - use super::runtime_types; - pub type WhitelistedCall = (); - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - } pub struct StorageApi; impl StorageApi { - pub fn whitelisted_call_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::whitelisted_call::WhitelistedCall, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Whitelist", - "WhitelistedCall", - (), - [ - 82u8, 208u8, 214u8, 72u8, 225u8, 35u8, 51u8, 212u8, 25u8, 138u8, 30u8, - 87u8, 54u8, 232u8, 72u8, 132u8, 4u8, 9u8, 28u8, 143u8, 251u8, 106u8, - 167u8, 218u8, 130u8, 185u8, 253u8, 185u8, 113u8, 154u8, 202u8, 66u8, - ], - ) - } pub fn whitelisted_call( &self, - _0: types::whitelisted_call::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::whitelisted_call::Param0, - >, - types::whitelisted_call::WhitelistedCall, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (whitelisted_call::Param0,), + whitelisted_call::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Whitelist", "WhitelistedCall", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 82u8, 208u8, 214u8, 72u8, 225u8, 35u8, 51u8, 212u8, 25u8, 138u8, 30u8, - 87u8, 54u8, 232u8, 72u8, 132u8, 4u8, 9u8, 28u8, 143u8, 251u8, 106u8, - 167u8, 218u8, 130u8, 185u8, 253u8, 185u8, 113u8, 154u8, 202u8, 66u8, + 11u8, 76u8, 254u8, 248u8, 71u8, 202u8, 180u8, 86u8, 42u8, 160u8, 237u8, + 70u8, 252u8, 189u8, 14u8, 204u8, 250u8, 103u8, 94u8, 92u8, 208u8, + 210u8, 224u8, 68u8, 31u8, 178u8, 214u8, 36u8, 176u8, 51u8, 90u8, 206u8, ], ) } } + pub mod whitelisted_call { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = (); + } + } } } pub mod claims { @@ -17910,87 +15575,25 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod claims { - use super::runtime_types; - pub type Claims = ::core::primitive::u128; - pub type Param0 = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; - } - pub mod total { - use super::runtime_types; - pub type Total = ::core::primitive::u128; - } - pub mod vesting { - use super::runtime_types; - pub type Vesting = ( - ::core::primitive::u128, - ::core::primitive::u128, - ::core::primitive::u32, - ); - pub type Param0 = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; - } - pub mod signing { - use super::runtime_types; - pub type Signing = - runtime_types::polkadot_runtime_common::claims::StatementKind; - pub type Param0 = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; - } - pub mod preclaims { - use super::runtime_types; - pub type Preclaims = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { - pub fn claims_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::claims::Claims, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Claims", - "Claims", - (), - [ - 148u8, 115u8, 159u8, 169u8, 36u8, 116u8, 15u8, 108u8, 57u8, 195u8, - 226u8, 180u8, 187u8, 112u8, 114u8, 63u8, 3u8, 205u8, 113u8, 141u8, - 149u8, 149u8, 118u8, 246u8, 45u8, 245u8, 148u8, 108u8, 22u8, 184u8, - 152u8, 132u8, - ], - ) - } pub fn claims( &self, - _0: types::claims::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claims::Param0, - >, - types::claims::Claims, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (claims::Param0,), + claims::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Claims", "Claims", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 148u8, 115u8, 159u8, 169u8, 36u8, 116u8, 15u8, 108u8, 57u8, 195u8, - 226u8, 180u8, 187u8, 112u8, 114u8, 63u8, 3u8, 205u8, 113u8, 141u8, - 149u8, 149u8, 118u8, 246u8, 45u8, 245u8, 148u8, 108u8, 22u8, 184u8, - 152u8, 132u8, + 30u8, 138u8, 223u8, 254u8, 10u8, 216u8, 101u8, 121u8, 158u8, 151u8, + 76u8, 241u8, 165u8, 187u8, 117u8, 44u8, 180u8, 189u8, 143u8, 116u8, + 137u8, 94u8, 68u8, 173u8, 124u8, 1u8, 82u8, 21u8, 191u8, 206u8, 96u8, + 202u8, ], ) } @@ -17998,45 +15601,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::total::Total, - ::subxt::ext::subxt_core::utils::Yes, + total::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Claims", "Total", - (), [ - 188u8, 31u8, 219u8, 189u8, 49u8, 213u8, 203u8, 89u8, 125u8, 58u8, - 232u8, 159u8, 131u8, 155u8, 166u8, 113u8, 99u8, 24u8, 40u8, 242u8, - 118u8, 183u8, 108u8, 230u8, 135u8, 150u8, 84u8, 86u8, 118u8, 91u8, - 168u8, 62u8, - ], - ) - } - #[doc = " Vesting schedule for a claim."] - #[doc = " First balance is the total amount that should be held for vesting."] - #[doc = " Second balance is how much should be unlocked per block."] - #[doc = " The block number is when the vesting should start."] - pub fn vesting_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::vesting::Vesting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Claims", - "Vesting", - (), - [ - 206u8, 106u8, 195u8, 101u8, 55u8, 137u8, 50u8, 105u8, 137u8, 87u8, - 230u8, 34u8, 255u8, 94u8, 210u8, 186u8, 179u8, 72u8, 24u8, 194u8, - 209u8, 173u8, 115u8, 65u8, 227u8, 224u8, 58u8, 113u8, 200u8, 166u8, - 108u8, 198u8, + 168u8, 254u8, 90u8, 202u8, 108u8, 235u8, 16u8, 61u8, 122u8, 30u8, + 249u8, 26u8, 238u8, 48u8, 146u8, 240u8, 117u8, 143u8, 199u8, 125u8, + 109u8, 134u8, 189u8, 254u8, 67u8, 155u8, 155u8, 50u8, 254u8, 79u8, + 229u8, 15u8, ], ) } @@ -18046,121 +15621,108 @@ pub mod api { #[doc = " The block number is when the vesting should start."] pub fn vesting( &self, - _0: types::vesting::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::vesting::Param0, - >, - types::vesting::Vesting, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (vesting::Param0,), + vesting::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Claims", "Vesting", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 206u8, 106u8, 195u8, 101u8, 55u8, 137u8, 50u8, 105u8, 137u8, 87u8, - 230u8, 34u8, 255u8, 94u8, 210u8, 186u8, 179u8, 72u8, 24u8, 194u8, - 209u8, 173u8, 115u8, 65u8, 227u8, 224u8, 58u8, 113u8, 200u8, 166u8, - 108u8, 198u8, - ], - ) - } - #[doc = " The statement kind that must be signed, if any."] - pub fn signing_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::signing::Signing, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Claims", - "Signing", - (), - [ - 111u8, 90u8, 178u8, 121u8, 241u8, 28u8, 169u8, 231u8, 61u8, 189u8, - 113u8, 207u8, 26u8, 153u8, 189u8, 15u8, 192u8, 25u8, 22u8, 22u8, 124u8, - 26u8, 191u8, 39u8, 130u8, 164u8, 34u8, 4u8, 44u8, 91u8, 82u8, 186u8, + 64u8, 162u8, 151u8, 207u8, 64u8, 159u8, 118u8, 203u8, 107u8, 88u8, + 78u8, 221u8, 114u8, 124u8, 87u8, 30u8, 203u8, 142u8, 217u8, 68u8, 33u8, + 140u8, 177u8, 203u8, 185u8, 33u8, 90u8, 68u8, 134u8, 0u8, 159u8, 103u8, ], ) } #[doc = " The statement kind that must be signed, if any."] pub fn signing( &self, - _0: types::signing::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::signing::Param0, - >, - types::signing::Signing, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (signing::Param0,), + signing::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Claims", "Signing", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 111u8, 90u8, 178u8, 121u8, 241u8, 28u8, 169u8, 231u8, 61u8, 189u8, - 113u8, 207u8, 26u8, 153u8, 189u8, 15u8, 192u8, 25u8, 22u8, 22u8, 124u8, - 26u8, 191u8, 39u8, 130u8, 164u8, 34u8, 4u8, 44u8, 91u8, 82u8, 186u8, - ], - ) - } - #[doc = " Pre-claimed Ethereum accounts, by the Account ID that they are claimed to."] - pub fn preclaims_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::preclaims::Preclaims, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Claims", - "Preclaims", - (), [ - 197u8, 114u8, 147u8, 235u8, 203u8, 255u8, 94u8, 113u8, 151u8, 119u8, - 224u8, 147u8, 48u8, 246u8, 124u8, 38u8, 190u8, 237u8, 226u8, 65u8, - 91u8, 163u8, 129u8, 40u8, 71u8, 137u8, 220u8, 242u8, 51u8, 75u8, 3u8, - 204u8, + 124u8, 78u8, 130u8, 190u8, 11u8, 12u8, 232u8, 123u8, 249u8, 148u8, + 211u8, 137u8, 160u8, 253u8, 110u8, 195u8, 89u8, 68u8, 14u8, 61u8, + 148u8, 127u8, 0u8, 246u8, 53u8, 252u8, 134u8, 14u8, 78u8, 195u8, 232u8, + 232u8, ], ) } #[doc = " Pre-claimed Ethereum accounts, by the Account ID that they are claimed to."] pub fn preclaims( &self, - _0: types::preclaims::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::preclaims::Param0, - >, - types::preclaims::Preclaims, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (preclaims::Param0,), + preclaims::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Claims", "Preclaims", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 197u8, 114u8, 147u8, 235u8, 203u8, 255u8, 94u8, 113u8, 151u8, 119u8, - 224u8, 147u8, 48u8, 246u8, 124u8, 38u8, 190u8, 237u8, 226u8, 65u8, - 91u8, 163u8, 129u8, 40u8, 71u8, 137u8, 220u8, 242u8, 51u8, 75u8, 3u8, - 204u8, + 208u8, 78u8, 37u8, 158u8, 181u8, 89u8, 77u8, 149u8, 230u8, 238u8, + 143u8, 169u8, 187u8, 110u8, 239u8, 45u8, 43u8, 24u8, 80u8, 69u8, 230u8, + 69u8, 98u8, 176u8, 229u8, 64u8, 210u8, 244u8, 156u8, 120u8, 71u8, 98u8, ], ) } } + pub mod claims { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_runtime_common::claims::EthereumAddress; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod total { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod vesting { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_runtime_common::claims::EthereumAddress; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + ); + } + } + pub mod signing { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_runtime_common::claims::EthereumAddress; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_runtime_common::claims::StatementKind; + } + } + pub mod preclaims { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_common::claims::EthereumAddress; + } + } } pub mod constants { use super::runtime_types; @@ -20766,213 +18328,47 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod identity_of { - use super::runtime_types; - pub type IdentityOf = runtime_types::pallet_identity::types::Registration< - ::core::primitive::u128, - runtime_types::pallet_identity::legacy::IdentityInfo, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod username_of { - use super::runtime_types; - pub type UsernameOf = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod super_of { - use super::runtime_types; - pub type SuperOf = ( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::pallet_identity::types::Data, - ); - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod subs_of { - use super::runtime_types; - pub type SubsOf = ( - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - ); - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod registrars { - use super::runtime_types; - pub type Registrars = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_identity::types::RegistrarInfo< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u64, - >, - >, - >; - } - pub mod authority_of { - use super::runtime_types; - pub type AuthorityOf = - runtime_types::pallet_identity::types::AuthorityProperties< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - pub mod username_info_of { - use super::runtime_types; - pub type UsernameInfoOf = - runtime_types::pallet_identity::types::UsernameInformation< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - pub mod pending_usernames { - use super::runtime_types; - pub type PendingUsernames = ( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - runtime_types::pallet_identity::types::Provider<::core::primitive::u128>, - ); - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - pub mod unbinding_usernames { - use super::runtime_types; - pub type UnbindingUsernames = ::core::primitive::u32; - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Information that is pertinent to identify the entity behind an account. First item is the"] - #[doc = " registration, second is the account's primary username."] - #[doc = ""] - #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub fn identity_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::identity_of::IdentityOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "IdentityOf", - (), - [ - 112u8, 2u8, 209u8, 123u8, 138u8, 171u8, 80u8, 243u8, 226u8, 88u8, 81u8, - 49u8, 59u8, 172u8, 88u8, 180u8, 255u8, 119u8, 57u8, 16u8, 169u8, 149u8, - 77u8, 239u8, 73u8, 182u8, 28u8, 112u8, 150u8, 110u8, 65u8, 139u8, - ], - ) - } #[doc = " Information that is pertinent to identify the entity behind an account. First item is the"] #[doc = " registration, second is the account's primary username."] #[doc = ""] #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] pub fn identity_of( &self, - _0: types::identity_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::identity_of::Param0, - >, - types::identity_of::IdentityOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (identity_of::Param0,), + identity_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "IdentityOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 112u8, 2u8, 209u8, 123u8, 138u8, 171u8, 80u8, 243u8, 226u8, 88u8, 81u8, - 49u8, 59u8, 172u8, 88u8, 180u8, 255u8, 119u8, 57u8, 16u8, 169u8, 149u8, - 77u8, 239u8, 73u8, 182u8, 28u8, 112u8, 150u8, 110u8, 65u8, 139u8, - ], - ) - } - #[doc = " Identifies the primary username of an account."] - pub fn username_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::username_of::UsernameOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "UsernameOf", - (), [ - 244u8, 21u8, 1u8, 155u8, 204u8, 65u8, 229u8, 41u8, 67u8, 9u8, 51u8, - 153u8, 6u8, 234u8, 151u8, 41u8, 221u8, 68u8, 144u8, 43u8, 197u8, 133u8, - 35u8, 252u8, 159u8, 128u8, 208u8, 1u8, 129u8, 102u8, 134u8, 142u8, + 21u8, 16u8, 159u8, 130u8, 123u8, 151u8, 22u8, 140u8, 140u8, 250u8, + 74u8, 182u8, 135u8, 217u8, 211u8, 222u8, 233u8, 217u8, 13u8, 128u8, + 36u8, 160u8, 128u8, 159u8, 10u8, 34u8, 190u8, 106u8, 150u8, 239u8, + 238u8, 173u8, ], ) } #[doc = " Identifies the primary username of an account."] pub fn username_of( &self, - _0: types::username_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::username_of::Param0, - >, - types::username_of::UsernameOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (username_of::Param0,), + username_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "UsernameOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 244u8, 21u8, 1u8, 155u8, 204u8, 65u8, 229u8, 41u8, 67u8, 9u8, 51u8, - 153u8, 6u8, 234u8, 151u8, 41u8, 221u8, 68u8, 144u8, 43u8, 197u8, 133u8, - 35u8, 252u8, 159u8, 128u8, 208u8, 1u8, 129u8, 102u8, 134u8, 142u8, - ], - ) - } - #[doc = " The super-identity of an alternative \"sub\" identity together with its name, within that"] - #[doc = " context. If the account is not some other account's sub-identity, then just `None`."] - pub fn super_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::super_of::SuperOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "SuperOf", - (), - [ - 84u8, 72u8, 64u8, 14u8, 56u8, 9u8, 143u8, 100u8, 141u8, 163u8, 36u8, - 55u8, 38u8, 254u8, 164u8, 17u8, 3u8, 110u8, 88u8, 175u8, 161u8, 65u8, - 159u8, 40u8, 46u8, 8u8, 177u8, 81u8, 130u8, 38u8, 193u8, 28u8, + 242u8, 73u8, 159u8, 110u8, 46u8, 128u8, 21u8, 164u8, 42u8, 65u8, 59u8, + 104u8, 75u8, 202u8, 221u8, 51u8, 237u8, 201u8, 159u8, 154u8, 127u8, + 174u8, 162u8, 45u8, 46u8, 61u8, 109u8, 9u8, 210u8, 38u8, 215u8, 169u8, ], ) } @@ -20980,50 +18376,19 @@ pub mod api { #[doc = " context. If the account is not some other account's sub-identity, then just `None`."] pub fn super_of( &self, - _0: types::super_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::super_of::Param0, - >, - types::super_of::SuperOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (super_of::Param0,), + super_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "SuperOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 84u8, 72u8, 64u8, 14u8, 56u8, 9u8, 143u8, 100u8, 141u8, 163u8, 36u8, - 55u8, 38u8, 254u8, 164u8, 17u8, 3u8, 110u8, 88u8, 175u8, 161u8, 65u8, - 159u8, 40u8, 46u8, 8u8, 177u8, 81u8, 130u8, 38u8, 193u8, 28u8, - ], - ) - } - #[doc = " Alternative \"sub\" identities of this account."] - #[doc = ""] - #[doc = " The first item is the deposit, the second is a vector of the accounts."] - #[doc = ""] - #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] - pub fn subs_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::subs_of::SubsOf, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "SubsOf", - (), - [ - 164u8, 140u8, 52u8, 123u8, 220u8, 118u8, 147u8, 3u8, 67u8, 22u8, 191u8, - 18u8, 186u8, 21u8, 154u8, 8u8, 205u8, 224u8, 163u8, 173u8, 174u8, - 107u8, 144u8, 215u8, 116u8, 64u8, 159u8, 115u8, 159u8, 205u8, 91u8, - 28u8, + 140u8, 192u8, 254u8, 84u8, 61u8, 71u8, 240u8, 84u8, 165u8, 249u8, + 244u8, 179u8, 248u8, 198u8, 98u8, 131u8, 26u8, 111u8, 120u8, 78u8, + 60u8, 136u8, 106u8, 217u8, 178u8, 8u8, 195u8, 186u8, 25u8, 149u8, + 149u8, 31u8, ], ) } @@ -21034,25 +18399,18 @@ pub mod api { #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] pub fn subs_of( &self, - _0: types::subs_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::subs_of::Param0, - >, - types::subs_of::SubsOf, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (subs_of::Param0,), + subs_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "SubsOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 164u8, 140u8, 52u8, 123u8, 220u8, 118u8, 147u8, 3u8, 67u8, 22u8, 191u8, - 18u8, 186u8, 21u8, 154u8, 8u8, 205u8, 224u8, 163u8, 173u8, 174u8, - 107u8, 144u8, 215u8, 116u8, 64u8, 159u8, 115u8, 159u8, 205u8, 91u8, - 28u8, + 9u8, 96u8, 97u8, 246u8, 23u8, 34u8, 133u8, 12u8, 242u8, 87u8, 194u8, + 32u8, 144u8, 82u8, 255u8, 224u8, 252u8, 254u8, 158u8, 227u8, 192u8, + 244u8, 116u8, 64u8, 90u8, 52u8, 76u8, 36u8, 226u8, 71u8, 198u8, 73u8, ], ) } @@ -21064,91 +18422,35 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::registrars::Registrars, - ::subxt::ext::subxt_core::utils::Yes, + registrars::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "Registrars", - (), [ - 167u8, 99u8, 159u8, 117u8, 103u8, 243u8, 208u8, 113u8, 57u8, 225u8, - 27u8, 25u8, 188u8, 120u8, 15u8, 40u8, 134u8, 169u8, 108u8, 134u8, 83u8, - 184u8, 223u8, 170u8, 194u8, 19u8, 168u8, 43u8, 119u8, 76u8, 94u8, - 154u8, - ], - ) - } - #[doc = " A map of the accounts who are authorized to grant usernames."] - pub fn authority_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::authority_of::AuthorityOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "AuthorityOf", - (), - [ - 29u8, 200u8, 4u8, 178u8, 88u8, 232u8, 90u8, 28u8, 236u8, 206u8, 135u8, - 39u8, 154u8, 91u8, 160u8, 212u8, 30u8, 45u8, 126u8, 198u8, 219u8, 50u8, - 37u8, 83u8, 87u8, 44u8, 179u8, 131u8, 152u8, 1u8, 25u8, 141u8, + 108u8, 236u8, 100u8, 28u8, 125u8, 16u8, 127u8, 131u8, 179u8, 180u8, + 132u8, 212u8, 251u8, 166u8, 31u8, 230u8, 7u8, 35u8, 154u8, 180u8, 25u8, + 88u8, 73u8, 76u8, 215u8, 22u8, 191u8, 114u8, 115u8, 212u8, 87u8, 78u8, ], ) } #[doc = " A map of the accounts who are authorized to grant usernames."] pub fn authority_of( &self, - _0: types::authority_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::authority_of::Param0, - >, - types::authority_of::AuthorityOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (authority_of::Param0,), + authority_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "AuthorityOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 29u8, 200u8, 4u8, 178u8, 88u8, 232u8, 90u8, 28u8, 236u8, 206u8, 135u8, - 39u8, 154u8, 91u8, 160u8, 212u8, 30u8, 45u8, 126u8, 198u8, 219u8, 50u8, - 37u8, 83u8, 87u8, 44u8, 179u8, 131u8, 152u8, 1u8, 25u8, 141u8, - ], - ) - } - #[doc = " Reverse lookup from `username` to the `AccountId` that has registered it and the provider of"] - #[doc = " the username. The `owner` value should be a key in the `UsernameOf` map, but it may not if"] - #[doc = " the user has cleared their username or it has been removed."] - #[doc = ""] - #[doc = " Multiple usernames may map to the same `AccountId`, but `UsernameOf` will only map to one"] - #[doc = " primary username."] - pub fn username_info_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::username_info_of::UsernameInfoOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "UsernameInfoOf", - (), - [ - 178u8, 18u8, 32u8, 252u8, 199u8, 40u8, 12u8, 69u8, 228u8, 214u8, 161u8, - 210u8, 236u8, 179u8, 63u8, 40u8, 49u8, 16u8, 238u8, 30u8, 78u8, 111u8, - 14u8, 141u8, 181u8, 3u8, 40u8, 78u8, 83u8, 174u8, 80u8, 20u8, + 200u8, 11u8, 176u8, 34u8, 138u8, 149u8, 120u8, 61u8, 148u8, 162u8, + 101u8, 249u8, 222u8, 255u8, 219u8, 175u8, 57u8, 44u8, 28u8, 245u8, + 193u8, 175u8, 154u8, 159u8, 195u8, 128u8, 175u8, 252u8, 170u8, 122u8, + 192u8, 188u8, ], ) } @@ -21160,51 +18462,19 @@ pub mod api { #[doc = " primary username."] pub fn username_info_of( &self, - _0: types::username_info_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::username_info_of::Param0, - >, - types::username_info_of::UsernameInfoOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (username_info_of::Param0,), + username_info_of::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "UsernameInfoOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 178u8, 18u8, 32u8, 252u8, 199u8, 40u8, 12u8, 69u8, 228u8, 214u8, 161u8, - 210u8, 236u8, 179u8, 63u8, 40u8, 49u8, 16u8, 238u8, 30u8, 78u8, 111u8, - 14u8, 141u8, 181u8, 3u8, 40u8, 78u8, 83u8, 174u8, 80u8, 20u8, - ], - ) - } - #[doc = " Usernames that an authority has granted, but that the account controller has not confirmed"] - #[doc = " that they want it. Used primarily in cases where the `AccountId` cannot provide a signature"] - #[doc = " because they are a pure proxy, multisig, etc. In order to confirm it, they should call"] - #[doc = " [accept_username](`Call::accept_username`)."] - #[doc = ""] - #[doc = " First tuple item is the account and second is the acceptance deadline."] - pub fn pending_usernames_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_usernames::PendingUsernames, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "PendingUsernames", - (), - [ - 18u8, 46u8, 0u8, 180u8, 231u8, 237u8, 159u8, 69u8, 216u8, 142u8, 172u8, - 114u8, 193u8, 49u8, 239u8, 71u8, 119u8, 189u8, 155u8, 56u8, 19u8, - 225u8, 70u8, 123u8, 140u8, 32u8, 69u8, 22u8, 115u8, 240u8, 192u8, - 210u8, + 114u8, 213u8, 7u8, 111u8, 158u8, 180u8, 99u8, 109u8, 93u8, 193u8, + 160u8, 59u8, 39u8, 108u8, 209u8, 120u8, 215u8, 71u8, 58u8, 221u8, 49u8, + 110u8, 114u8, 121u8, 244u8, 154u8, 47u8, 189u8, 83u8, 14u8, 108u8, + 63u8, ], ) } @@ -21216,49 +18486,19 @@ pub mod api { #[doc = " First tuple item is the account and second is the acceptance deadline."] pub fn pending_usernames( &self, - _0: types::pending_usernames::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_usernames::Param0, - >, - types::pending_usernames::PendingUsernames, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (pending_usernames::Param0,), + pending_usernames::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "PendingUsernames", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 18u8, 46u8, 0u8, 180u8, 231u8, 237u8, 159u8, 69u8, 216u8, 142u8, 172u8, - 114u8, 193u8, 49u8, 239u8, 71u8, 119u8, 189u8, 155u8, 56u8, 19u8, - 225u8, 70u8, 123u8, 140u8, 32u8, 69u8, 22u8, 115u8, 240u8, 192u8, - 210u8, - ], - ) - } - #[doc = " Usernames for which the authority that granted them has started the removal process by"] - #[doc = " unbinding them. Each unbinding username maps to its grace period expiry, which is the first"] - #[doc = " block in which the username could be deleted through a"] - #[doc = " [remove_username](`Call::remove_username`) call."] - pub fn unbinding_usernames_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::unbinding_usernames::UnbindingUsernames, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Identity", - "UnbindingUsernames", - (), [ - 145u8, 43u8, 133u8, 230u8, 34u8, 51u8, 136u8, 184u8, 144u8, 51u8, 72u8, - 134u8, 216u8, 235u8, 201u8, 241u8, 6u8, 34u8, 41u8, 111u8, 150u8, - 137u8, 244u8, 79u8, 97u8, 249u8, 30u8, 98u8, 178u8, 103u8, 9u8, 78u8, + 4u8, 117u8, 36u8, 178u8, 72u8, 249u8, 169u8, 138u8, 16u8, 244u8, 95u8, + 252u8, 231u8, 124u8, 199u8, 127u8, 169u8, 106u8, 164u8, 243u8, 239u8, + 184u8, 215u8, 116u8, 226u8, 118u8, 17u8, 54u8, 153u8, 227u8, 188u8, + 245u8, ], ) } @@ -21268,28 +18508,140 @@ pub mod api { #[doc = " [remove_username](`Call::remove_username`) call."] pub fn unbinding_usernames( &self, - _0: types::unbinding_usernames::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::unbinding_usernames::Param0, - >, - types::unbinding_usernames::UnbindingUsernames, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (unbinding_usernames::Param0,), + unbinding_usernames::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Identity", "UnbindingUsernames", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 145u8, 43u8, 133u8, 230u8, 34u8, 51u8, 136u8, 184u8, 144u8, 51u8, 72u8, - 134u8, 216u8, 235u8, 201u8, 241u8, 6u8, 34u8, 41u8, 111u8, 150u8, - 137u8, 244u8, 79u8, 97u8, 249u8, 30u8, 98u8, 178u8, 103u8, 9u8, 78u8, + 86u8, 56u8, 22u8, 203u8, 6u8, 71u8, 144u8, 115u8, 31u8, 210u8, 122u8, + 198u8, 10u8, 160u8, 187u8, 250u8, 177u8, 241u8, 159u8, 254u8, 100u8, + 198u8, 36u8, 11u8, 77u8, 68u8, 65u8, 235u8, 89u8, 24u8, 164u8, 50u8, ], ) } } + pub mod identity_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + runtime_types::pallet_identity::legacy::IdentityInfo, + >; + } + } + pub mod username_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + } + pub mod super_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::pallet_identity::types::Data, + ); + } + } + pub mod subs_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + ); + } + } + pub mod registrars { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_identity::types::RegistrarInfo< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u64, + >, + >, + >; + } + } + pub mod authority_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_identity::types::AuthorityProperties< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + } + } + pub mod username_info_of { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_identity::types::UsernameInformation< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + } + } + pub mod pending_usernames { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + runtime_types::pallet_identity::types::Provider<::core::primitive::u128>, + ); + } + } + pub mod unbinding_usernames { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } } pub mod constants { use super::runtime_types; @@ -22981,133 +20333,8 @@ pub mod api { } } pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod parameters { - use super::runtime_types; - pub type Parameters = - runtime_types::pallet_society::GroupParams<::core::primitive::u128>; - } - pub mod pot { - use super::runtime_types; - pub type Pot = ::core::primitive::u128; - } - pub mod founder { - use super::runtime_types; - pub type Founder = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod head { - use super::runtime_types; - pub type Head = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod rules { - use super::runtime_types; - pub type Rules = ::subxt::ext::subxt_core::utils::H256; - } - pub mod members { - use super::runtime_types; - pub type Members = runtime_types::pallet_society::MemberRecord; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod payouts { - use super::runtime_types; - pub type Payouts = runtime_types::pallet_society::PayoutRecord< - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u128, - )>, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod member_count { - use super::runtime_types; - pub type MemberCount = ::core::primitive::u32; - } - pub mod member_by_index { - use super::runtime_types; - pub type MemberByIndex = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::core::primitive::u32; - } - pub mod suspended_members { - use super::runtime_types; - pub type SuspendedMembers = runtime_types::pallet_society::MemberRecord; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod round_count { - use super::runtime_types; - pub type RoundCount = ::core::primitive::u32; - } - pub mod bids { - use super::runtime_types; - pub type Bids = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_society::Bid< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >, - >; - } - pub mod candidates { - use super::runtime_types; - pub type Candidates = runtime_types::pallet_society::Candidacy< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod skeptic { - use super::runtime_types; - pub type Skeptic = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod votes { - use super::runtime_types; - pub type Votes = runtime_types::pallet_society::Vote; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod vote_clear_cursor { - use super::runtime_types; - pub type VoteClearCursor = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod next_head { - use super::runtime_types; - pub type NextHead = runtime_types::pallet_society::IntakeRecord< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - } - pub mod challenge_round_count { - use super::runtime_types; - pub type ChallengeRoundCount = ::core::primitive::u32; - } - pub mod defending { - use super::runtime_types; - pub type Defending = ( - ::subxt::ext::subxt_core::utils::AccountId32, - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::pallet_society::Tally, - ); - } - pub mod defender_votes { - use super::runtime_types; - pub type DefenderVotes = runtime_types::pallet_society::Vote; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod next_intake_at { - use super::runtime_types; - pub type NextIntakeAt = ::core::primitive::u32; - } - pub mod next_challenge_at { - use super::runtime_types; - pub type NextChallengeAt = ::core::primitive::u32; - } - } + use super::root_mod; + use super::runtime_types; pub struct StorageApi; impl StorageApi { #[doc = " The max number of members for the society at one time."] @@ -23115,20 +20342,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::parameters::Parameters, + parameters::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Parameters", - (), [ - 69u8, 147u8, 95u8, 26u8, 245u8, 207u8, 83u8, 57u8, 229u8, 34u8, 205u8, - 202u8, 182u8, 180u8, 219u8, 86u8, 152u8, 140u8, 212u8, 145u8, 7u8, - 98u8, 185u8, 36u8, 60u8, 173u8, 120u8, 49u8, 164u8, 102u8, 133u8, - 248u8, + 122u8, 176u8, 245u8, 89u8, 173u8, 181u8, 159u8, 19u8, 119u8, 100u8, + 125u8, 116u8, 240u8, 35u8, 94u8, 8u8, 51u8, 54u8, 236u8, 140u8, 118u8, + 57u8, 239u8, 106u8, 91u8, 242u8, 222u8, 109u8, 254u8, 15u8, 155u8, + 103u8, ], ) } @@ -23137,19 +20361,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::pot::Pot, - ::subxt::ext::subxt_core::utils::Yes, + pot::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Pot", - (), [ - 98u8, 77u8, 215u8, 220u8, 51u8, 87u8, 188u8, 65u8, 72u8, 231u8, 34u8, - 161u8, 61u8, 59u8, 66u8, 105u8, 128u8, 23u8, 249u8, 27u8, 10u8, 0u8, - 251u8, 16u8, 235u8, 163u8, 239u8, 74u8, 197u8, 226u8, 58u8, 215u8, + 153u8, 78u8, 93u8, 247u8, 36u8, 162u8, 220u8, 108u8, 89u8, 187u8, + 159u8, 201u8, 223u8, 10u8, 51u8, 93u8, 180u8, 152u8, 156u8, 98u8, 91u8, + 185u8, 151u8, 20u8, 32u8, 96u8, 179u8, 189u8, 91u8, 157u8, 93u8, 4u8, ], ) } @@ -23158,19 +20379,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::founder::Founder, + founder::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Founder", - (), [ - 14u8, 6u8, 181u8, 186u8, 64u8, 213u8, 48u8, 110u8, 242u8, 50u8, 144u8, - 77u8, 38u8, 127u8, 161u8, 54u8, 204u8, 119u8, 1u8, 218u8, 12u8, 57u8, - 165u8, 32u8, 28u8, 34u8, 46u8, 12u8, 217u8, 65u8, 27u8, 1u8, + 196u8, 24u8, 101u8, 164u8, 151u8, 214u8, 176u8, 57u8, 39u8, 50u8, 95u8, + 41u8, 232u8, 219u8, 183u8, 131u8, 150u8, 251u8, 107u8, 237u8, 114u8, + 56u8, 177u8, 191u8, 98u8, 22u8, 167u8, 141u8, 112u8, 183u8, 169u8, + 96u8, ], ) } @@ -23179,19 +20398,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::head::Head, + head::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Head", - (), [ - 95u8, 2u8, 23u8, 237u8, 130u8, 169u8, 84u8, 51u8, 1u8, 178u8, 234u8, - 194u8, 139u8, 35u8, 222u8, 150u8, 246u8, 176u8, 97u8, 103u8, 211u8, - 198u8, 165u8, 1u8, 224u8, 204u8, 10u8, 91u8, 6u8, 179u8, 189u8, 170u8, + 251u8, 81u8, 67u8, 151u8, 1u8, 163u8, 109u8, 231u8, 61u8, 152u8, 164u8, + 52u8, 70u8, 83u8, 120u8, 49u8, 205u8, 46u8, 189u8, 221u8, 165u8, 120u8, + 74u8, 65u8, 115u8, 212u8, 42u8, 211u8, 76u8, 112u8, 241u8, 121u8, ], ) } @@ -23201,110 +20417,53 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::rules::Rules, + rules::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Rules", - (), - [ - 119u8, 249u8, 119u8, 89u8, 243u8, 239u8, 149u8, 15u8, 238u8, 40u8, - 172u8, 198u8, 24u8, 107u8, 57u8, 39u8, 155u8, 36u8, 13u8, 72u8, 153u8, - 101u8, 39u8, 146u8, 38u8, 161u8, 195u8, 69u8, 79u8, 204u8, 172u8, - 207u8, - ], - ) - } - #[doc = " The current members and their rank. Doesn't include `SuspendedMembers`."] - pub fn members_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::members::Members, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "Members", - (), [ - 207u8, 227u8, 130u8, 247u8, 29u8, 198u8, 129u8, 83u8, 3u8, 6u8, 19u8, - 37u8, 163u8, 227u8, 0u8, 94u8, 8u8, 166u8, 111u8, 70u8, 101u8, 65u8, - 104u8, 8u8, 94u8, 84u8, 80u8, 158u8, 208u8, 152u8, 4u8, 33u8, + 233u8, 192u8, 158u8, 113u8, 23u8, 14u8, 143u8, 89u8, 23u8, 66u8, 157u8, + 58u8, 98u8, 188u8, 103u8, 137u8, 42u8, 211u8, 33u8, 66u8, 168u8, 190u8, + 84u8, 222u8, 162u8, 80u8, 129u8, 53u8, 65u8, 131u8, 133u8, 184u8, ], ) } #[doc = " The current members and their rank. Doesn't include `SuspendedMembers`."] pub fn members( &self, - _0: types::members::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::members::Param0, - >, - types::members::Members, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (members::Param0,), + members::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Members", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 207u8, 227u8, 130u8, 247u8, 29u8, 198u8, 129u8, 83u8, 3u8, 6u8, 19u8, - 37u8, 163u8, 227u8, 0u8, 94u8, 8u8, 166u8, 111u8, 70u8, 101u8, 65u8, - 104u8, 8u8, 94u8, 84u8, 80u8, 158u8, 208u8, 152u8, 4u8, 33u8, - ], - ) - } - #[doc = " Information regarding rank-0 payouts, past and future."] - pub fn payouts_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::payouts::Payouts, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "Payouts", - (), [ - 251u8, 249u8, 170u8, 219u8, 131u8, 113u8, 178u8, 165u8, 173u8, 36u8, - 175u8, 199u8, 57u8, 188u8, 59u8, 226u8, 4u8, 45u8, 36u8, 173u8, 113u8, - 50u8, 153u8, 205u8, 21u8, 132u8, 30u8, 111u8, 95u8, 51u8, 194u8, 126u8, + 138u8, 33u8, 132u8, 153u8, 86u8, 108u8, 101u8, 151u8, 104u8, 93u8, + 90u8, 202u8, 74u8, 138u8, 190u8, 168u8, 94u8, 141u8, 138u8, 70u8, 69u8, + 240u8, 216u8, 199u8, 110u8, 28u8, 213u8, 78u8, 139u8, 104u8, 111u8, + 17u8, ], ) } #[doc = " Information regarding rank-0 payouts, past and future."] pub fn payouts( &self, - _0: types::payouts::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::payouts::Param0, - >, - types::payouts::Payouts, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (payouts::Param0,), + payouts::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Payouts", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 251u8, 249u8, 170u8, 219u8, 131u8, 113u8, 178u8, 165u8, 173u8, 36u8, - 175u8, 199u8, 57u8, 188u8, 59u8, 226u8, 4u8, 45u8, 36u8, 173u8, 113u8, - 50u8, 153u8, 205u8, 21u8, 132u8, 30u8, 111u8, 95u8, 51u8, 194u8, 126u8, + 231u8, 42u8, 64u8, 126u8, 229u8, 235u8, 133u8, 38u8, 124u8, 87u8, 30u8, + 57u8, 157u8, 32u8, 81u8, 107u8, 120u8, 93u8, 164u8, 132u8, 233u8, + 239u8, 67u8, 27u8, 146u8, 98u8, 179u8, 170u8, 71u8, 52u8, 117u8, 122u8, ], ) } @@ -23313,43 +20472,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::member_count::MemberCount, - ::subxt::ext::subxt_core::utils::Yes, + member_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "MemberCount", - (), [ - 251u8, 200u8, 97u8, 38u8, 125u8, 162u8, 19u8, 100u8, 249u8, 254u8, - 42u8, 93u8, 64u8, 171u8, 2u8, 200u8, 129u8, 228u8, 211u8, 229u8, 152u8, - 170u8, 228u8, 158u8, 212u8, 94u8, 17u8, 226u8, 194u8, 87u8, 189u8, - 213u8, - ], - ) - } - #[doc = " The current items in `Members` keyed by their unique index. Keys are densely populated"] - #[doc = " `0..MemberCount` (does not include `MemberCount`)."] - pub fn member_by_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::member_by_index::MemberByIndex, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "MemberByIndex", - (), - [ - 13u8, 233u8, 212u8, 149u8, 220u8, 158u8, 17u8, 27u8, 201u8, 61u8, - 202u8, 248u8, 192u8, 37u8, 199u8, 73u8, 32u8, 140u8, 204u8, 206u8, - 239u8, 43u8, 241u8, 41u8, 9u8, 51u8, 125u8, 171u8, 47u8, 149u8, 63u8, - 159u8, + 221u8, 200u8, 51u8, 126u8, 198u8, 224u8, 167u8, 90u8, 91u8, 51u8, + 219u8, 133u8, 68u8, 52u8, 22u8, 88u8, 134u8, 107u8, 209u8, 91u8, 43u8, + 112u8, 138u8, 133u8, 156u8, 157u8, 140u8, 0u8, 251u8, 124u8, 144u8, + 253u8, ], ) } @@ -23357,72 +20490,36 @@ pub mod api { #[doc = " `0..MemberCount` (does not include `MemberCount`)."] pub fn member_by_index( &self, - _0: types::member_by_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::member_by_index::Param0, - >, - types::member_by_index::MemberByIndex, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (member_by_index::Param0,), + member_by_index::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "MemberByIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 13u8, 233u8, 212u8, 149u8, 220u8, 158u8, 17u8, 27u8, 201u8, 61u8, - 202u8, 248u8, 192u8, 37u8, 199u8, 73u8, 32u8, 140u8, 204u8, 206u8, - 239u8, 43u8, 241u8, 41u8, 9u8, 51u8, 125u8, 171u8, 47u8, 149u8, 63u8, - 159u8, - ], - ) - } - #[doc = " The set of suspended members, with their old membership record."] - pub fn suspended_members_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::suspended_members::SuspendedMembers, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "SuspendedMembers", - (), [ - 156u8, 11u8, 75u8, 79u8, 74u8, 79u8, 98u8, 89u8, 63u8, 83u8, 84u8, - 249u8, 177u8, 227u8, 113u8, 21u8, 26u8, 165u8, 129u8, 5u8, 129u8, - 152u8, 241u8, 85u8, 231u8, 139u8, 54u8, 102u8, 230u8, 203u8, 26u8, - 94u8, + 15u8, 69u8, 52u8, 32u8, 78u8, 20u8, 85u8, 129u8, 78u8, 91u8, 46u8, + 206u8, 95u8, 160u8, 25u8, 113u8, 69u8, 177u8, 247u8, 22u8, 117u8, + 107u8, 67u8, 87u8, 88u8, 153u8, 5u8, 28u8, 3u8, 106u8, 185u8, 70u8, ], ) } #[doc = " The set of suspended members, with their old membership record."] pub fn suspended_members( &self, - _0: types::suspended_members::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::suspended_members::Param0, - >, - types::suspended_members::SuspendedMembers, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (suspended_members::Param0,), + suspended_members::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "SuspendedMembers", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 156u8, 11u8, 75u8, 79u8, 74u8, 79u8, 98u8, 89u8, 63u8, 83u8, 84u8, - 249u8, 177u8, 227u8, 113u8, 21u8, 26u8, 165u8, 129u8, 5u8, 129u8, - 152u8, 241u8, 85u8, 231u8, 139u8, 54u8, 102u8, 230u8, 203u8, 26u8, - 94u8, + 184u8, 37u8, 191u8, 14u8, 215u8, 57u8, 199u8, 32u8, 21u8, 47u8, 222u8, + 90u8, 116u8, 18u8, 199u8, 91u8, 14u8, 85u8, 188u8, 189u8, 5u8, 19u8, + 131u8, 240u8, 253u8, 36u8, 174u8, 152u8, 108u8, 108u8, 104u8, 6u8, ], ) } @@ -23431,20 +20528,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::round_count::RoundCount, - ::subxt::ext::subxt_core::utils::Yes, + round_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "RoundCount", - (), [ - 61u8, 189u8, 115u8, 157u8, 36u8, 97u8, 192u8, 96u8, 138u8, 168u8, - 222u8, 58u8, 117u8, 199u8, 176u8, 146u8, 232u8, 167u8, 52u8, 190u8, - 41u8, 11u8, 181u8, 214u8, 79u8, 183u8, 134u8, 86u8, 164u8, 47u8, 178u8, - 192u8, + 85u8, 204u8, 31u8, 108u8, 255u8, 3u8, 156u8, 124u8, 103u8, 5u8, 116u8, + 110u8, 188u8, 131u8, 51u8, 9u8, 169u8, 244u8, 69u8, 178u8, 241u8, + 190u8, 114u8, 162u8, 249u8, 101u8, 139u8, 38u8, 51u8, 29u8, 212u8, + 94u8, ], ) } @@ -23453,62 +20547,35 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::bids::Bids, + bids::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Bids", - (), - [ - 220u8, 159u8, 208u8, 176u8, 118u8, 11u8, 21u8, 34u8, 3u8, 101u8, 233u8, - 212u8, 149u8, 156u8, 235u8, 135u8, 142u8, 220u8, 76u8, 99u8, 60u8, - 29u8, 204u8, 134u8, 53u8, 82u8, 80u8, 129u8, 208u8, 149u8, 96u8, 231u8, - ], - ) - } - pub fn candidates_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::candidates::Candidates, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "Candidates", - (), [ - 52u8, 250u8, 201u8, 163u8, 0u8, 5u8, 156u8, 84u8, 96u8, 130u8, 228u8, - 205u8, 34u8, 75u8, 121u8, 209u8, 82u8, 15u8, 247u8, 21u8, 54u8, 177u8, - 138u8, 183u8, 64u8, 191u8, 209u8, 19u8, 38u8, 235u8, 129u8, 136u8, + 62u8, 17u8, 191u8, 195u8, 22u8, 60u8, 20u8, 252u8, 17u8, 73u8, 142u8, + 185u8, 68u8, 162u8, 64u8, 125u8, 121u8, 123u8, 48u8, 234u8, 254u8, + 193u8, 239u8, 229u8, 193u8, 143u8, 254u8, 138u8, 246u8, 138u8, 75u8, + 66u8, ], ) } pub fn candidates( &self, - _0: types::candidates::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::candidates::Param0, - >, - types::candidates::Candidates, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (candidates::Param0,), + candidates::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Candidates", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 52u8, 250u8, 201u8, 163u8, 0u8, 5u8, 156u8, 84u8, 96u8, 130u8, 228u8, - 205u8, 34u8, 75u8, 121u8, 209u8, 82u8, 15u8, 247u8, 21u8, 54u8, 177u8, - 138u8, 183u8, 64u8, 191u8, 209u8, 19u8, 38u8, 235u8, 129u8, 136u8, + 235u8, 23u8, 144u8, 122u8, 179u8, 52u8, 33u8, 235u8, 85u8, 203u8, 18u8, + 209u8, 196u8, 81u8, 118u8, 83u8, 161u8, 64u8, 130u8, 131u8, 224u8, + 173u8, 124u8, 101u8, 104u8, 29u8, 201u8, 237u8, 114u8, 72u8, 142u8, + 171u8, ], ) } @@ -23517,148 +20584,53 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::skeptic::Skeptic, + skeptic::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Skeptic", - (), - [ - 121u8, 103u8, 195u8, 11u8, 87u8, 129u8, 61u8, 69u8, 218u8, 17u8, 101u8, - 207u8, 249u8, 207u8, 18u8, 103u8, 253u8, 240u8, 132u8, 46u8, 47u8, - 27u8, 85u8, 194u8, 34u8, 145u8, 16u8, 208u8, 245u8, 192u8, 191u8, - 118u8, - ], - ) - } - #[doc = " Double map from Candidate -> Voter -> (Maybe) Vote."] - pub fn votes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::votes::Votes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "Votes", - (), - [ - 34u8, 201u8, 151u8, 130u8, 149u8, 159u8, 32u8, 201u8, 127u8, 178u8, - 77u8, 214u8, 73u8, 158u8, 11u8, 247u8, 188u8, 156u8, 146u8, 59u8, - 160u8, 7u8, 109u8, 7u8, 131u8, 212u8, 185u8, 92u8, 172u8, 219u8, 140u8, - 238u8, - ], - ) - } - #[doc = " Double map from Candidate -> Voter -> (Maybe) Vote."] - pub fn votes_iter1( - &self, - _0: types::votes::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::votes::Param0, - >, - types::votes::Votes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "Votes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 34u8, 201u8, 151u8, 130u8, 149u8, 159u8, 32u8, 201u8, 127u8, 178u8, - 77u8, 214u8, 73u8, 158u8, 11u8, 247u8, 188u8, 156u8, 146u8, 59u8, - 160u8, 7u8, 109u8, 7u8, 131u8, 212u8, 185u8, 92u8, 172u8, 219u8, 140u8, - 238u8, + 189u8, 27u8, 185u8, 187u8, 5u8, 108u8, 19u8, 46u8, 103u8, 27u8, 94u8, + 182u8, 19u8, 234u8, 202u8, 194u8, 198u8, 14u8, 161u8, 73u8, 134u8, + 128u8, 15u8, 110u8, 219u8, 74u8, 8u8, 237u8, 56u8, 246u8, 60u8, 143u8, ], ) } #[doc = " Double map from Candidate -> Voter -> (Maybe) Vote."] pub fn votes( &self, - _0: types::votes::Param0, - _1: types::votes::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::votes::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::votes::Param1, - >, - ), - types::votes::Votes, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (votes::Param0, votes::Param1), + votes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Votes", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 34u8, 201u8, 151u8, 130u8, 149u8, 159u8, 32u8, 201u8, 127u8, 178u8, - 77u8, 214u8, 73u8, 158u8, 11u8, 247u8, 188u8, 156u8, 146u8, 59u8, - 160u8, 7u8, 109u8, 7u8, 131u8, 212u8, 185u8, 92u8, 172u8, 219u8, 140u8, - 238u8, - ], - ) - } - #[doc = " Clear-cursor for Vote, map from Candidate -> (Maybe) Cursor."] - pub fn vote_clear_cursor_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::vote_clear_cursor::VoteClearCursor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "VoteClearCursor", - (), [ - 157u8, 200u8, 216u8, 228u8, 235u8, 144u8, 13u8, 111u8, 252u8, 213u8, - 209u8, 114u8, 157u8, 159u8, 47u8, 125u8, 45u8, 152u8, 27u8, 145u8, - 55u8, 108u8, 217u8, 16u8, 251u8, 98u8, 172u8, 108u8, 23u8, 136u8, 93u8, - 250u8, + 80u8, 141u8, 50u8, 147u8, 196u8, 110u8, 169u8, 135u8, 202u8, 58u8, + 78u8, 85u8, 209u8, 44u8, 127u8, 248u8, 147u8, 36u8, 81u8, 215u8, 12u8, + 248u8, 151u8, 123u8, 122u8, 122u8, 86u8, 170u8, 103u8, 119u8, 18u8, + 134u8, ], ) } #[doc = " Clear-cursor for Vote, map from Candidate -> (Maybe) Cursor."] pub fn vote_clear_cursor( &self, - _0: types::vote_clear_cursor::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::vote_clear_cursor::Param0, - >, - types::vote_clear_cursor::VoteClearCursor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (vote_clear_cursor::Param0,), + vote_clear_cursor::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "VoteClearCursor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 157u8, 200u8, 216u8, 228u8, 235u8, 144u8, 13u8, 111u8, 252u8, 213u8, - 209u8, 114u8, 157u8, 159u8, 47u8, 125u8, 45u8, 152u8, 27u8, 145u8, - 55u8, 108u8, 217u8, 16u8, 251u8, 98u8, 172u8, 108u8, 23u8, 136u8, 93u8, - 250u8, + 179u8, 150u8, 118u8, 8u8, 213u8, 44u8, 137u8, 111u8, 65u8, 97u8, 90u8, + 28u8, 253u8, 114u8, 22u8, 105u8, 15u8, 225u8, 243u8, 235u8, 103u8, + 16u8, 106u8, 207u8, 48u8, 164u8, 53u8, 118u8, 170u8, 240u8, 1u8, 156u8, ], ) } @@ -23669,19 +20641,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_head::NextHead, + next_head::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "NextHead", - (), [ - 64u8, 118u8, 253u8, 247u8, 56u8, 39u8, 156u8, 38u8, 150u8, 234u8, - 190u8, 11u8, 45u8, 236u8, 15u8, 181u8, 6u8, 165u8, 226u8, 99u8, 46u8, - 55u8, 254u8, 40u8, 2u8, 233u8, 22u8, 211u8, 133u8, 36u8, 177u8, 46u8, + 253u8, 99u8, 30u8, 125u8, 20u8, 98u8, 97u8, 17u8, 31u8, 119u8, 216u8, + 56u8, 211u8, 200u8, 63u8, 155u8, 233u8, 206u8, 214u8, 178u8, 53u8, + 211u8, 66u8, 187u8, 1u8, 104u8, 194u8, 84u8, 146u8, 72u8, 72u8, 184u8, ], ) } @@ -23690,19 +20659,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::challenge_round_count::ChallengeRoundCount, - ::subxt::ext::subxt_core::utils::Yes, + challenge_round_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "ChallengeRoundCount", - (), [ - 111u8, 74u8, 218u8, 126u8, 43u8, 20u8, 75u8, 119u8, 166u8, 4u8, 56u8, - 24u8, 206u8, 10u8, 236u8, 17u8, 62u8, 124u8, 129u8, 39u8, 197u8, 157u8, - 153u8, 147u8, 68u8, 167u8, 220u8, 125u8, 44u8, 95u8, 82u8, 64u8, + 52u8, 20u8, 17u8, 16u8, 45u8, 77u8, 184u8, 146u8, 211u8, 87u8, 85u8, + 252u8, 34u8, 19u8, 120u8, 46u8, 143u8, 242u8, 142u8, 227u8, 138u8, + 142u8, 21u8, 196u8, 252u8, 87u8, 147u8, 105u8, 5u8, 207u8, 174u8, + 140u8, ], ) } @@ -23711,100 +20678,34 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::defending::Defending, + defending::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "Defending", - (), - [ - 22u8, 165u8, 42u8, 82u8, 129u8, 214u8, 77u8, 50u8, 110u8, 35u8, 16u8, - 44u8, 222u8, 47u8, 238u8, 209u8, 171u8, 254u8, 208u8, 3u8, 2u8, 87u8, - 48u8, 20u8, 227u8, 127u8, 188u8, 84u8, 118u8, 207u8, 68u8, 247u8, - ], - ) - } - #[doc = " Votes for the defender, keyed by challenge round."] - pub fn defender_votes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::defender_votes::DefenderVotes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "DefenderVotes", - (), - [ - 208u8, 137u8, 138u8, 215u8, 215u8, 207u8, 236u8, 140u8, 175u8, 50u8, - 110u8, 228u8, 48u8, 174u8, 16u8, 59u8, 72u8, 108u8, 7u8, 183u8, 119u8, - 171u8, 125u8, 159u8, 93u8, 129u8, 186u8, 115u8, 208u8, 5u8, 194u8, - 199u8, - ], - ) - } - #[doc = " Votes for the defender, keyed by challenge round."] - pub fn defender_votes_iter1( - &self, - _0: types::defender_votes::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::defender_votes::Param0, - >, - types::defender_votes::DefenderVotes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Society", - "DefenderVotes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 208u8, 137u8, 138u8, 215u8, 215u8, 207u8, 236u8, 140u8, 175u8, 50u8, - 110u8, 228u8, 48u8, 174u8, 16u8, 59u8, 72u8, 108u8, 7u8, 183u8, 119u8, - 171u8, 125u8, 159u8, 93u8, 129u8, 186u8, 115u8, 208u8, 5u8, 194u8, - 199u8, + 174u8, 164u8, 91u8, 161u8, 232u8, 175u8, 44u8, 33u8, 104u8, 196u8, 3u8, + 29u8, 74u8, 250u8, 70u8, 216u8, 131u8, 33u8, 152u8, 156u8, 128u8, 7u8, + 24u8, 219u8, 240u8, 182u8, 111u8, 174u8, 121u8, 213u8, 197u8, 72u8, ], ) } #[doc = " Votes for the defender, keyed by challenge round."] pub fn defender_votes( &self, - _0: types::defender_votes::Param0, - _1: types::defender_votes::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::defender_votes::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::defender_votes::Param1, - >, - ), - types::defender_votes::DefenderVotes, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (defender_votes::Param0, defender_votes::Param1), + defender_votes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "DefenderVotes", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), [ - 208u8, 137u8, 138u8, 215u8, 215u8, 207u8, 236u8, 140u8, 175u8, 50u8, - 110u8, 228u8, 48u8, 174u8, 16u8, 59u8, 72u8, 108u8, 7u8, 183u8, 119u8, - 171u8, 125u8, 159u8, 93u8, 129u8, 186u8, 115u8, 208u8, 5u8, 194u8, - 199u8, + 210u8, 78u8, 11u8, 241u8, 95u8, 246u8, 22u8, 127u8, 1u8, 235u8, 46u8, + 39u8, 54u8, 247u8, 156u8, 148u8, 215u8, 16u8, 45u8, 174u8, 91u8, 240u8, + 89u8, 139u8, 96u8, 20u8, 19u8, 86u8, 144u8, 70u8, 174u8, 10u8, ], ) } @@ -23813,19 +20714,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_intake_at::NextIntakeAt, + next_intake_at::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "NextIntakeAt", - (), [ - 26u8, 30u8, 212u8, 232u8, 53u8, 129u8, 143u8, 142u8, 35u8, 244u8, 99u8, - 100u8, 66u8, 249u8, 153u8, 134u8, 160u8, 55u8, 252u8, 28u8, 99u8, 52u8, - 209u8, 1u8, 105u8, 146u8, 207u8, 206u8, 37u8, 62u8, 240u8, 100u8, + 71u8, 212u8, 22u8, 80u8, 70u8, 63u8, 253u8, 83u8, 141u8, 175u8, 52u8, + 81u8, 0u8, 122u8, 136u8, 178u8, 236u8, 169u8, 58u8, 51u8, 45u8, 140u8, + 199u8, 108u8, 176u8, 81u8, 61u8, 247u8, 128u8, 252u8, 15u8, 104u8, ], ) } @@ -23834,23 +20732,231 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_challenge_at::NextChallengeAt, + next_challenge_at::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Society", "NextChallengeAt", - (), [ - 8u8, 207u8, 221u8, 191u8, 189u8, 224u8, 158u8, 60u8, 235u8, 1u8, 233u8, - 141u8, 199u8, 19u8, 210u8, 62u8, 200u8, 70u8, 124u8, 154u8, 113u8, - 71u8, 82u8, 28u8, 174u8, 206u8, 81u8, 238u8, 76u8, 238u8, 182u8, 245u8, + 35u8, 198u8, 23u8, 215u8, 91u8, 230u8, 2u8, 88u8, 16u8, 28u8, 87u8, + 156u8, 60u8, 228u8, 200u8, 174u8, 54u8, 78u8, 67u8, 115u8, 129u8, + 238u8, 50u8, 191u8, 103u8, 154u8, 124u8, 35u8, 187u8, 149u8, 35u8, + 144u8, ], ) } } + pub mod parameters { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_society::GroupParams<::core::primitive::u128>; + } + } + pub mod pot { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod founder { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } + pub mod head { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } + pub mod rules { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } + pub mod members { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_society::MemberRecord; + } + } + pub mod payouts { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_society::PayoutRecord< + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u128, + )>, + >; + } + } + pub mod member_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod member_by_index { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } + pub mod suspended_members { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_society::MemberRecord; + } + } + pub mod round_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod bids { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_society::Bid< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >, + >; + } + } + pub mod candidates { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_society::Candidacy< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + } + } + pub mod skeptic { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } + pub mod votes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_society::Vote; + } + } + pub mod vote_clear_cursor { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + } + pub mod next_head { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_society::IntakeRecord< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + } + } + pub mod challenge_round_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod defending { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::subxt::ext::subxt_core::utils::AccountId32, + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::pallet_society::Tally, + ); + } + } + pub mod defender_votes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_society::Vote; + } + } + pub mod next_intake_at { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod next_challenge_at { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } } pub mod constants { use super::runtime_types; @@ -24854,135 +21960,26 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod recoverable { - use super::runtime_types; - pub type Recoverable = runtime_types::pallet_recovery::RecoveryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod active_recoveries { - use super::runtime_types; - pub type ActiveRecoveries = runtime_types::pallet_recovery::ActiveRecovery< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod proxy { - use super::runtime_types; - pub type Proxy = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The set of recoverable accounts and their recovery configuration."] - pub fn recoverable_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::recoverable::Recoverable, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Recoverable", - (), - [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, - ], - ) - } #[doc = " The set of recoverable accounts and their recovery configuration."] pub fn recoverable( &self, - _0: types::recoverable::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::recoverable::Param0, - >, - types::recoverable::Recoverable, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (recoverable::Param0,), + recoverable::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Recovery", "Recoverable", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, - ], - ) - } - #[doc = " Active recovery attempts."] - #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - (), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " Active recovery attempts."] - #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter1( - &self, - _0: types::active_recoveries::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, + 92u8, 36u8, 203u8, 193u8, 48u8, 241u8, 235u8, 152u8, 130u8, 98u8, + 126u8, 33u8, 133u8, 28u8, 28u8, 110u8, 29u8, 186u8, 82u8, 233u8, 1u8, + 200u8, 54u8, 18u8, 220u8, 86u8, 218u8, 249u8, 45u8, 118u8, 169u8, + 147u8, ], ) } @@ -24992,57 +21989,18 @@ pub mod api { #[doc = " is the user trying to recover the account."] pub fn active_recoveries( &self, - _0: types::active_recoveries::Param0, - _1: types::active_recoveries::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param1, - >, - ), - types::active_recoveries::ActiveRecoveries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (active_recoveries::Param0, active_recoveries::Param1), + active_recoveries::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Recovery", "ActiveRecoveries", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " The list of allowed proxy accounts."] - #[doc = ""] - #[doc = " Map from the user who can access it to the recovered account."] - pub fn proxy_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proxy::Proxy, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Proxy", - (), [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, + 81u8, 91u8, 163u8, 177u8, 62u8, 126u8, 136u8, 201u8, 88u8, 233u8, + 248u8, 194u8, 75u8, 36u8, 9u8, 155u8, 113u8, 0u8, 95u8, 57u8, 64u8, + 46u8, 92u8, 199u8, 234u8, 213u8, 176u8, 174u8, 14u8, 36u8, 204u8, 6u8, ], ) } @@ -25051,28 +22009,63 @@ pub mod api { #[doc = " Map from the user who can access it to the recovered account."] pub fn proxy( &self, - _0: types::proxy::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proxy::Param0, - >, - types::proxy::Proxy, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (proxy::Param0,), + proxy::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Recovery", "Proxy", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, + 132u8, 51u8, 255u8, 46u8, 204u8, 22u8, 135u8, 24u8, 187u8, 117u8, + 144u8, 146u8, 46u8, 166u8, 90u8, 233u8, 22u8, 33u8, 195u8, 234u8, + 107u8, 61u8, 102u8, 166u8, 178u8, 58u8, 135u8, 107u8, 255u8, 40u8, + 76u8, 235u8, ], ) } } + pub mod recoverable { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_recovery::RecoveryConfig< + ::core::primitive::u32, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + >; + } + } + pub mod active_recoveries { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_recovery::ActiveRecovery< + ::core::primitive::u32, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + >; + } + } + pub mod proxy { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } } pub mod constants { use super::runtime_types; @@ -25668,70 +22661,26 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod vesting { - use super::runtime_types; - pub type Vesting = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod storage_version { - use super::runtime_types; - pub type StorageVersion = runtime_types::pallet_vesting::Releases; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Information regarding the vesting of a given account."] - pub fn vesting_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::vesting::Vesting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Vesting", - "Vesting", - (), - [ - 95u8, 168u8, 217u8, 248u8, 149u8, 86u8, 195u8, 93u8, 73u8, 206u8, - 105u8, 165u8, 33u8, 173u8, 232u8, 81u8, 147u8, 254u8, 50u8, 228u8, - 156u8, 92u8, 242u8, 149u8, 42u8, 91u8, 58u8, 209u8, 142u8, 221u8, - 230u8, 112u8, - ], - ) - } #[doc = " Information regarding the vesting of a given account."] pub fn vesting( &self, - _0: types::vesting::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::vesting::Param0, - >, - types::vesting::Vesting, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (vesting::Param0,), + vesting::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Vesting", "Vesting", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 95u8, 168u8, 217u8, 248u8, 149u8, 86u8, 195u8, 93u8, 73u8, 206u8, - 105u8, 165u8, 33u8, 173u8, 232u8, 81u8, 147u8, 254u8, 50u8, 228u8, - 156u8, 92u8, 242u8, 149u8, 42u8, 91u8, 58u8, 209u8, 142u8, 221u8, - 230u8, 112u8, + 162u8, 157u8, 162u8, 44u8, 179u8, 144u8, 85u8, 195u8, 160u8, 254u8, + 118u8, 45u8, 238u8, 179u8, 230u8, 31u8, 86u8, 92u8, 176u8, 190u8, + 163u8, 229u8, 85u8, 191u8, 1u8, 69u8, 18u8, 124u8, 95u8, 7u8, 113u8, + 143u8, ], ) } @@ -25742,23 +22691,43 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::storage_version::StorageVersion, + storage_version::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Vesting", "StorageVersion", - (), [ - 230u8, 137u8, 180u8, 133u8, 142u8, 124u8, 231u8, 234u8, 223u8, 10u8, - 154u8, 98u8, 158u8, 253u8, 228u8, 80u8, 5u8, 9u8, 91u8, 210u8, 252u8, - 9u8, 13u8, 195u8, 193u8, 164u8, 129u8, 113u8, 128u8, 218u8, 8u8, 40u8, + 220u8, 249u8, 222u8, 3u8, 60u8, 166u8, 13u8, 96u8, 217u8, 194u8, 225u8, + 141u8, 112u8, 147u8, 70u8, 225u8, 183u8, 96u8, 101u8, 186u8, 92u8, + 246u8, 232u8, 49u8, 186u8, 247u8, 2u8, 115u8, 205u8, 131u8, 185u8, + 89u8, ], ) } } + pub mod vesting { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >; + } + } + pub mod storage_version { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_vesting::Releases; + } + } } pub mod constants { use super::runtime_types; @@ -26580,43 +23549,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod incomplete_since { - use super::runtime_types; - pub type IncompleteSince = ::core::primitive::u32; - } - pub mod agenda { - use super::runtime_types; - pub type Agenda = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_scheduler::Scheduled< - [::core::primitive::u8; 32usize], - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::rococo_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u32, - runtime_types::rococo_runtime::OriginCaller, - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod retries { - use super::runtime_types; - pub type Retries = - runtime_types::pallet_scheduler::RetryConfig<::core::primitive::u32>; - pub type Param0 = (::core::primitive::u32, ::core::primitive::u32); - } - pub mod lookup { - use super::runtime_types; - pub type Lookup = (::core::primitive::u32, ::core::primitive::u32); - pub type Param0 = [::core::primitive::u8; 32usize]; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Block number at which the agenda began incomplete execution."] @@ -26624,135 +23558,52 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::incomplete_since::IncompleteSince, + incomplete_since::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", "IncompleteSince", - (), - [ - 250u8, 83u8, 64u8, 167u8, 205u8, 59u8, 225u8, 97u8, 205u8, 12u8, 76u8, - 130u8, 197u8, 4u8, 111u8, 208u8, 92u8, 217u8, 145u8, 119u8, 38u8, - 135u8, 1u8, 242u8, 228u8, 143u8, 56u8, 25u8, 115u8, 233u8, 227u8, 66u8, - ], - ) - } - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] - pub fn agenda_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::agenda::Agenda, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Agenda", - (), [ - 148u8, 16u8, 2u8, 44u8, 137u8, 244u8, 124u8, 103u8, 156u8, 203u8, 79u8, - 36u8, 95u8, 50u8, 189u8, 52u8, 53u8, 67u8, 1u8, 161u8, 43u8, 194u8, - 225u8, 148u8, 19u8, 232u8, 184u8, 238u8, 63u8, 25u8, 18u8, 125u8, + 19u8, 68u8, 50u8, 230u8, 235u8, 127u8, 58u8, 99u8, 131u8, 124u8, 44u8, + 153u8, 17u8, 222u8, 93u8, 91u8, 103u8, 22u8, 81u8, 82u8, 158u8, 224u8, + 10u8, 165u8, 78u8, 126u8, 232u8, 177u8, 200u8, 34u8, 77u8, 192u8, ], ) } #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda( &self, - _0: types::agenda::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::agenda::Param0, - >, - types::agenda::Agenda, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (agenda::Param0,), + agenda::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", "Agenda", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 148u8, 16u8, 2u8, 44u8, 137u8, 244u8, 124u8, 103u8, 156u8, 203u8, 79u8, - 36u8, 95u8, 50u8, 189u8, 52u8, 53u8, 67u8, 1u8, 161u8, 43u8, 194u8, - 225u8, 148u8, 19u8, 232u8, 184u8, 238u8, 63u8, 25u8, 18u8, 125u8, - ], - ) - } - #[doc = " Retry configurations for items to be executed, indexed by task address."] - pub fn retries_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::retries::Retries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Retries", - (), - [ - 164u8, 27u8, 208u8, 185u8, 19u8, 232u8, 190u8, 97u8, 137u8, 73u8, - 146u8, 10u8, 241u8, 176u8, 251u8, 140u8, 133u8, 65u8, 190u8, 162u8, - 59u8, 32u8, 77u8, 201u8, 27u8, 78u8, 183u8, 164u8, 74u8, 46u8, 139u8, - 145u8, + 112u8, 83u8, 79u8, 55u8, 12u8, 47u8, 132u8, 101u8, 154u8, 88u8, 181u8, + 175u8, 213u8, 8u8, 245u8, 168u8, 132u8, 92u8, 39u8, 1u8, 8u8, 20u8, + 73u8, 214u8, 25u8, 232u8, 106u8, 227u8, 143u8, 208u8, 123u8, 177u8, ], ) } #[doc = " Retry configurations for items to be executed, indexed by task address."] pub fn retries( &self, - _0: types::retries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::retries::Param0, - >, - types::retries::Retries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (retries::Param0,), + retries::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", "Retries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 164u8, 27u8, 208u8, 185u8, 19u8, 232u8, 190u8, 97u8, 137u8, 73u8, - 146u8, 10u8, 241u8, 176u8, 251u8, 140u8, 133u8, 65u8, 190u8, 162u8, - 59u8, 32u8, 77u8, 201u8, 27u8, 78u8, 183u8, 164u8, 74u8, 46u8, 139u8, - 145u8, - ], - ) - } - #[doc = " Lookup from a name to the block number and index of the task."] - #[doc = ""] - #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] - #[doc = " identities."] - pub fn lookup_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::lookup::Lookup, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Lookup", - (), - [ - 24u8, 87u8, 96u8, 127u8, 136u8, 205u8, 238u8, 174u8, 71u8, 110u8, 65u8, - 98u8, 228u8, 167u8, 99u8, 71u8, 171u8, 186u8, 12u8, 218u8, 137u8, 70u8, - 70u8, 228u8, 153u8, 111u8, 165u8, 114u8, 229u8, 136u8, 118u8, 131u8, + 81u8, 168u8, 89u8, 22u8, 140u8, 48u8, 1u8, 90u8, 95u8, 116u8, 91u8, + 50u8, 52u8, 16u8, 32u8, 133u8, 218u8, 238u8, 160u8, 164u8, 167u8, 45u8, + 54u8, 155u8, 45u8, 125u8, 129u8, 180u8, 95u8, 3u8, 121u8, 199u8, ], ) } @@ -26762,28 +23613,72 @@ pub mod api { #[doc = " identities."] pub fn lookup( &self, - _0: types::lookup::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::lookup::Param0, - >, - types::lookup::Lookup, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (lookup::Param0,), + lookup::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", "Lookup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 24u8, 87u8, 96u8, 127u8, 136u8, 205u8, 238u8, 174u8, 71u8, 110u8, 65u8, - 98u8, 228u8, 167u8, 99u8, 71u8, 171u8, 186u8, 12u8, 218u8, 137u8, 70u8, - 70u8, 228u8, 153u8, 111u8, 165u8, 114u8, 229u8, 136u8, 118u8, 131u8, + 38u8, 155u8, 168u8, 232u8, 82u8, 169u8, 100u8, 173u8, 77u8, 154u8, + 107u8, 199u8, 164u8, 25u8, 181u8, 127u8, 28u8, 213u8, 154u8, 84u8, + 193u8, 49u8, 109u8, 82u8, 107u8, 147u8, 82u8, 163u8, 169u8, 198u8, + 119u8, 252u8, ], ) } } + pub mod incomplete_since { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod agenda { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_scheduler::Scheduled< + [::core::primitive::u8; 32usize], + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::rococo_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + ::core::primitive::u32, + runtime_types::rococo_runtime::OriginCaller, + ::subxt::ext::subxt_core::utils::AccountId32, + >, + >, + >; + } + } + pub mod retries { + use super::root_mod; + use super::runtime_types; + pub type Param0 = (::core::primitive::u32, ::core::primitive::u32); + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_scheduler::RetryConfig<::core::primitive::u32>; + } + } + pub mod lookup { + use super::root_mod; + use super::runtime_types; + pub type Param0 = [::core::primitive::u8; 32usize]; + pub mod output { + use super::runtime_types; + pub type Output = (::core::primitive::u32, ::core::primitive::u32); + } + } } pub mod constants { use super::runtime_types; @@ -27788,135 +24683,84 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod proxies { - use super::runtime_types; - pub type Proxies = ( - runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::rococo_runtime::ProxyType, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod announcements { - use super::runtime_types; - pub type Announcements = ( - runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::ext::subxt_core::utils::AccountId32, - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The set of account proxies. Maps the account which has delegated to the accounts"] - #[doc = " which are being delegated to, together with the amount held on deposit."] - pub fn proxies_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proxies::Proxies, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Proxy", - "Proxies", - (), - [ - 92u8, 131u8, 10u8, 14u8, 241u8, 148u8, 230u8, 81u8, 54u8, 152u8, 147u8, - 180u8, 85u8, 28u8, 87u8, 215u8, 110u8, 13u8, 158u8, 207u8, 77u8, 102u8, - 97u8, 57u8, 179u8, 237u8, 153u8, 148u8, 99u8, 141u8, 15u8, 126u8, - ], - ) - } #[doc = " The set of account proxies. Maps the account which has delegated to the accounts"] #[doc = " which are being delegated to, together with the amount held on deposit."] pub fn proxies( &self, - _0: types::proxies::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proxies::Param0, - >, - types::proxies::Proxies, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (proxies::Param0,), + proxies::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Proxy", "Proxies", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 92u8, 131u8, 10u8, 14u8, 241u8, 148u8, 230u8, 81u8, 54u8, 152u8, 147u8, - 180u8, 85u8, 28u8, 87u8, 215u8, 110u8, 13u8, 158u8, 207u8, 77u8, 102u8, - 97u8, 57u8, 179u8, 237u8, 153u8, 148u8, 99u8, 141u8, 15u8, 126u8, - ], - ) - } - #[doc = " The announcements made by the proxy (key)."] - pub fn announcements_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::announcements::Announcements, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Proxy", - "Announcements", - (), [ - 129u8, 228u8, 198u8, 210u8, 90u8, 69u8, 151u8, 198u8, 206u8, 174u8, - 148u8, 58u8, 134u8, 14u8, 53u8, 56u8, 234u8, 71u8, 84u8, 247u8, 246u8, - 207u8, 117u8, 221u8, 84u8, 72u8, 254u8, 215u8, 102u8, 49u8, 21u8, - 173u8, + 171u8, 150u8, 235u8, 243u8, 57u8, 30u8, 191u8, 2u8, 188u8, 11u8, 10u8, + 167u8, 228u8, 82u8, 134u8, 170u8, 57u8, 169u8, 9u8, 216u8, 132u8, + 202u8, 112u8, 120u8, 196u8, 192u8, 52u8, 218u8, 40u8, 2u8, 227u8, 44u8, ], ) } #[doc = " The announcements made by the proxy (key)."] pub fn announcements( &self, - _0: types::announcements::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::announcements::Param0, - >, - types::announcements::Announcements, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (announcements::Param0,), + announcements::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Proxy", "Announcements", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 129u8, 228u8, 198u8, 210u8, 90u8, 69u8, 151u8, 198u8, 206u8, 174u8, - 148u8, 58u8, 134u8, 14u8, 53u8, 56u8, 234u8, 71u8, 84u8, 247u8, 246u8, - 207u8, 117u8, 221u8, 84u8, 72u8, 254u8, 215u8, 102u8, 49u8, 21u8, - 173u8, + 0u8, 171u8, 210u8, 152u8, 196u8, 122u8, 224u8, 100u8, 239u8, 154u8, + 131u8, 30u8, 232u8, 9u8, 13u8, 76u8, 45u8, 18u8, 143u8, 228u8, 34u8, + 82u8, 205u8, 243u8, 252u8, 8u8, 9u8, 199u8, 204u8, 51u8, 13u8, 157u8, ], ) } } + pub mod proxies { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::ProxyDefinition< + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::rococo_runtime::ProxyType, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ); + } + } + pub mod announcements { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::Announcement< + ::subxt::ext::subxt_core::utils::AccountId32, + ::subxt::ext::subxt_core::utils::H256, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ); + } + } } pub mod constants { use super::runtime_types; @@ -28694,101 +25538,44 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod multisigs { - use super::runtime_types; - pub type Multisigs = runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = [::core::primitive::u8; 32usize]; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The set of open multisig operations."] - pub fn multisigs_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::multisigs::Multisigs, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Multisig", - "Multisigs", - (), - [ - 154u8, 109u8, 45u8, 18u8, 155u8, 151u8, 81u8, 28u8, 86u8, 127u8, 189u8, - 151u8, 49u8, 61u8, 12u8, 149u8, 84u8, 61u8, 110u8, 197u8, 200u8, 140u8, - 37u8, 100u8, 14u8, 162u8, 158u8, 161u8, 48u8, 117u8, 102u8, 61u8, - ], - ) - } - #[doc = " The set of open multisig operations."] - pub fn multisigs_iter1( - &self, - _0: types::multisigs::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::multisigs::Param0, - >, - types::multisigs::Multisigs, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Multisig", - "Multisigs", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 154u8, 109u8, 45u8, 18u8, 155u8, 151u8, 81u8, 28u8, 86u8, 127u8, 189u8, - 151u8, 49u8, 61u8, 12u8, 149u8, 84u8, 61u8, 110u8, 197u8, 200u8, 140u8, - 37u8, 100u8, 14u8, 162u8, 158u8, 161u8, 48u8, 117u8, 102u8, 61u8, - ], - ) - } #[doc = " The set of open multisig operations."] pub fn multisigs( &self, - _0: types::multisigs::Param0, - _1: types::multisigs::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::multisigs::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::multisigs::Param1, - >, - ), - types::multisigs::Multisigs, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (multisigs::Param0, multisigs::Param1), + multisigs::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Multisig", "Multisigs", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), [ - 154u8, 109u8, 45u8, 18u8, 155u8, 151u8, 81u8, 28u8, 86u8, 127u8, 189u8, - 151u8, 49u8, 61u8, 12u8, 149u8, 84u8, 61u8, 110u8, 197u8, 200u8, 140u8, - 37u8, 100u8, 14u8, 162u8, 158u8, 161u8, 48u8, 117u8, 102u8, 61u8, + 226u8, 165u8, 8u8, 191u8, 30u8, 241u8, 101u8, 41u8, 175u8, 251u8, 97u8, + 189u8, 203u8, 125u8, 115u8, 111u8, 90u8, 200u8, 7u8, 221u8, 37u8, + 137u8, 46u8, 185u8, 170u8, 218u8, 140u8, 165u8, 166u8, 104u8, 122u8, + 157u8, ], ) } } + pub mod multisigs { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = [::core::primitive::u8; 32usize]; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_multisig::Multisig< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + >; + } + } } pub mod constants { use super::runtime_types; @@ -29170,177 +25957,104 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod status_for { - use super::runtime_types; - pub type StatusFor = runtime_types::pallet_preimage::OldRequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - pub mod request_status_for { - use super::runtime_types; - pub type RequestStatusFor = runtime_types::pallet_preimage::RequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::frame_support::traits::tokens::fungible::HoldConsideration, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - pub mod preimage_for { - use super::runtime_types; - pub type PreimageFor = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ( - ::subxt::ext::subxt_core::utils::H256, - ::core::primitive::u32, - ); - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The request status of a given hash."] - pub fn status_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::status_for::StatusFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "StatusFor", - (), - [ - 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, - 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, - 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, - 209u8, - ], - ) - } #[doc = " The request status of a given hash."] pub fn status_for( &self, - _0: types::status_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::status_for::Param0, - >, - types::status_for::StatusFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (status_for::Param0,), + status_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Preimage", "StatusFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, - 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, - 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, - 209u8, - ], - ) - } - #[doc = " The request status of a given hash."] - pub fn request_status_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::request_status_for::RequestStatusFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", - (), - [ - 72u8, 59u8, 254u8, 211u8, 96u8, 223u8, 10u8, 64u8, 6u8, 139u8, 213u8, - 85u8, 14u8, 29u8, 166u8, 37u8, 140u8, 124u8, 186u8, 156u8, 172u8, - 157u8, 73u8, 5u8, 121u8, 117u8, 51u8, 6u8, 249u8, 203u8, 75u8, 190u8, + 235u8, 42u8, 191u8, 165u8, 253u8, 255u8, 9u8, 25u8, 212u8, 37u8, 160u8, + 141u8, 76u8, 19u8, 152u8, 47u8, 70u8, 169u8, 168u8, 102u8, 227u8, + 162u8, 152u8, 171u8, 152u8, 146u8, 107u8, 117u8, 70u8, 88u8, 107u8, + 85u8, ], ) } #[doc = " The request status of a given hash."] pub fn request_status_for( &self, - _0: types::request_status_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::request_status_for::Param0, - >, - types::request_status_for::RequestStatusFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (request_status_for::Param0,), + request_status_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Preimage", "RequestStatusFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 72u8, 59u8, 254u8, 211u8, 96u8, 223u8, 10u8, 64u8, 6u8, 139u8, 213u8, - 85u8, 14u8, 29u8, 166u8, 37u8, 140u8, 124u8, 186u8, 156u8, 172u8, - 157u8, 73u8, 5u8, 121u8, 117u8, 51u8, 6u8, 249u8, 203u8, 75u8, 190u8, - ], - ) - } - pub fn preimage_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::preimage_for::PreimageFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", - (), [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 253u8, 111u8, 140u8, 168u8, 48u8, 6u8, 139u8, 254u8, 120u8, 161u8, 4u8, + 250u8, 215u8, 229u8, 236u8, 121u8, 136u8, 33u8, 84u8, 115u8, 109u8, + 163u8, 8u8, 97u8, 173u8, 26u8, 25u8, 159u8, 106u8, 114u8, 146u8, 243u8, ], ) } pub fn preimage_for( &self, - _0: types::preimage_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::preimage_for::Param0, - >, - types::preimage_for::PreimageFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (preimage_for::Param0,), + preimage_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Preimage", "PreimageFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 237u8, 141u8, 81u8, 17u8, 238u8, 42u8, 71u8, 117u8, 210u8, 197u8, + 222u8, 249u8, 97u8, 233u8, 153u8, 182u8, 136u8, 80u8, 72u8, 45u8, + 179u8, 37u8, 249u8, 127u8, 91u8, 162u8, 81u8, 205u8, 49u8, 253u8, + 255u8, 38u8, ], ) } } + pub mod status_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_preimage::OldRequestStatus< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + } + } + pub mod request_status_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_preimage::RequestStatus< + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::frame_support::traits::tokens::fungible::HoldConsideration, + >; + } + } + pub mod preimage_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ( + ::subxt::ext::subxt_core::utils::H256, + ::core::primitive::u32, + ); + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + } } } pub mod asset_rate { @@ -29592,69 +26306,41 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod conversion_rate_to_native { - use super::runtime_types; - pub type ConversionRateToNative = - runtime_types::sp_arithmetic::fixed_point::FixedU128; - pub type Param0 = - runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Maps an asset to its fixed point representation in the native balance."] - #[doc = ""] - #[doc = " E.g. `native_amount = asset_amount * ConversionRateToNative::::get(asset_kind)`"] - pub fn conversion_rate_to_native_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::conversion_rate_to_native::ConversionRateToNative, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetRate", - "ConversionRateToNative", - (), - [ - 102u8, 116u8, 47u8, 128u8, 65u8, 18u8, 208u8, 127u8, 21u8, 115u8, 49u8, - 131u8, 2u8, 198u8, 162u8, 114u8, 158u8, 246u8, 235u8, 161u8, 117u8, - 39u8, 199u8, 156u8, 7u8, 165u8, 9u8, 89u8, 202u8, 59u8, 170u8, 221u8, - ], - ) - } #[doc = " Maps an asset to its fixed point representation in the native balance."] #[doc = ""] #[doc = " E.g. `native_amount = asset_amount * ConversionRateToNative::::get(asset_kind)`"] pub fn conversion_rate_to_native( &self, - _0: types::conversion_rate_to_native::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::conversion_rate_to_native::Param0, - >, - types::conversion_rate_to_native::ConversionRateToNative, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (conversion_rate_to_native::Param0,), + conversion_rate_to_native::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssetRate", "ConversionRateToNative", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 102u8, 116u8, 47u8, 128u8, 65u8, 18u8, 208u8, 127u8, 21u8, 115u8, 49u8, - 131u8, 2u8, 198u8, 162u8, 114u8, 158u8, 246u8, 235u8, 161u8, 117u8, - 39u8, 199u8, 156u8, 7u8, 165u8, 9u8, 89u8, 202u8, 59u8, 170u8, 221u8, + 176u8, 57u8, 238u8, 25u8, 229u8, 201u8, 84u8, 164u8, 90u8, 229u8, + 103u8, 122u8, 27u8, 241u8, 74u8, 225u8, 207u8, 42u8, 29u8, 27u8, 15u8, + 43u8, 248u8, 23u8, 136u8, 96u8, 136u8, 177u8, 13u8, 98u8, 41u8, 144u8, ], ) } } + pub mod conversion_rate_to_native { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_runtime_common::impls::VersionedLocatableAsset; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; + } + } } } pub mod bounties { @@ -30631,38 +27317,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod bounty_count { - use super::runtime_types; - pub type BountyCount = ::core::primitive::u32; - } - pub mod bounties { - use super::runtime_types; - pub type Bounties = runtime_types::pallet_bounties::Bounty< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod bounty_descriptions { - use super::runtime_types; - pub type BountyDescriptions = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod bounty_approvals { - use super::runtime_types; - pub type BountyApprovals = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Number of bounty proposals that have been made."] @@ -30670,112 +27326,54 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::bounty_count::BountyCount, - ::subxt::ext::subxt_core::utils::Yes, + bounty_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Bounties", "BountyCount", - (), [ - 120u8, 204u8, 26u8, 150u8, 37u8, 81u8, 43u8, 223u8, 180u8, 252u8, - 142u8, 144u8, 109u8, 5u8, 184u8, 72u8, 223u8, 230u8, 66u8, 196u8, 14u8, - 14u8, 164u8, 190u8, 246u8, 168u8, 190u8, 56u8, 212u8, 73u8, 175u8, - 26u8, - ], - ) - } - #[doc = " Bounties that have been made."] - pub fn bounties_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::bounties::Bounties, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Bounties", - "Bounties", - (), - [ - 69u8, 96u8, 25u8, 88u8, 96u8, 159u8, 96u8, 120u8, 90u8, 165u8, 177u8, - 60u8, 61u8, 180u8, 13u8, 252u8, 154u8, 255u8, 249u8, 42u8, 179u8, - 124u8, 182u8, 46u8, 84u8, 210u8, 145u8, 21u8, 197u8, 230u8, 242u8, - 203u8, + 180u8, 143u8, 192u8, 81u8, 137u8, 171u8, 129u8, 66u8, 33u8, 167u8, + 192u8, 58u8, 20u8, 51u8, 179u8, 108u8, 79u8, 170u8, 26u8, 192u8, 5u8, + 247u8, 22u8, 169u8, 71u8, 116u8, 127u8, 144u8, 208u8, 72u8, 10u8, 30u8, ], ) } #[doc = " Bounties that have been made."] pub fn bounties( &self, - _0: types::bounties::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::bounties::Param0, - >, - types::bounties::Bounties, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (bounties::Param0,), + bounties::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Bounties", "Bounties", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 69u8, 96u8, 25u8, 88u8, 96u8, 159u8, 96u8, 120u8, 90u8, 165u8, 177u8, - 60u8, 61u8, 180u8, 13u8, 252u8, 154u8, 255u8, 249u8, 42u8, 179u8, - 124u8, 182u8, 46u8, 84u8, 210u8, 145u8, 21u8, 197u8, 230u8, 242u8, - 203u8, - ], - ) - } - #[doc = " The description of each bounty."] - pub fn bounty_descriptions_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::bounty_descriptions::BountyDescriptions, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Bounties", - "BountyDescriptions", - (), - [ - 71u8, 40u8, 133u8, 84u8, 55u8, 207u8, 169u8, 189u8, 160u8, 51u8, 202u8, - 144u8, 15u8, 226u8, 97u8, 114u8, 54u8, 247u8, 53u8, 26u8, 36u8, 54u8, - 186u8, 163u8, 198u8, 100u8, 191u8, 121u8, 186u8, 160u8, 85u8, 97u8, + 51u8, 6u8, 39u8, 186u8, 111u8, 207u8, 134u8, 132u8, 249u8, 212u8, + 200u8, 121u8, 90u8, 147u8, 86u8, 125u8, 17u8, 222u8, 213u8, 88u8, + 122u8, 5u8, 16u8, 207u8, 197u8, 190u8, 213u8, 73u8, 5u8, 180u8, 47u8, + 228u8, ], ) } #[doc = " The description of each bounty."] pub fn bounty_descriptions( &self, - _0: types::bounty_descriptions::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::bounty_descriptions::Param0, - >, - types::bounty_descriptions::BountyDescriptions, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (bounty_descriptions::Param0,), + bounty_descriptions::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Bounties", "BountyDescriptions", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 71u8, 40u8, 133u8, 84u8, 55u8, 207u8, 169u8, 189u8, 160u8, 51u8, 202u8, - 144u8, 15u8, 226u8, 97u8, 114u8, 54u8, 247u8, 53u8, 26u8, 36u8, 54u8, - 186u8, 163u8, 198u8, 100u8, 191u8, 121u8, 186u8, 160u8, 85u8, 97u8, + 1u8, 183u8, 235u8, 160u8, 235u8, 209u8, 158u8, 179u8, 220u8, 217u8, + 158u8, 104u8, 49u8, 27u8, 147u8, 126u8, 171u8, 45u8, 160u8, 117u8, + 57u8, 183u8, 79u8, 109u8, 11u8, 74u8, 80u8, 123u8, 12u8, 109u8, 6u8, + 109u8, ], ) } @@ -30784,23 +27382,62 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::bounty_approvals::BountyApprovals, + bounty_approvals::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Bounties", "BountyApprovals", - (), [ - 182u8, 228u8, 0u8, 46u8, 176u8, 25u8, 222u8, 180u8, 51u8, 57u8, 14u8, - 0u8, 69u8, 160u8, 64u8, 27u8, 88u8, 29u8, 227u8, 146u8, 2u8, 121u8, - 27u8, 85u8, 45u8, 110u8, 244u8, 62u8, 134u8, 77u8, 175u8, 188u8, + 139u8, 89u8, 73u8, 125u8, 174u8, 134u8, 137u8, 151u8, 31u8, 79u8, + 134u8, 203u8, 58u8, 168u8, 233u8, 45u8, 6u8, 222u8, 53u8, 230u8, 215u8, + 234u8, 116u8, 44u8, 195u8, 23u8, 253u8, 253u8, 67u8, 18u8, 184u8, 68u8, ], ) } } + pub mod bounty_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod bounties { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_bounties::Bounty< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + } + } + pub mod bounty_descriptions { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + } + pub mod bounty_approvals { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; + } + } } pub mod constants { use super::runtime_types; @@ -31715,54 +28352,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod child_bounty_count { - use super::runtime_types; - pub type ChildBountyCount = ::core::primitive::u32; - } - pub mod parent_child_bounties { - use super::runtime_types; - pub type ParentChildBounties = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u32; - } - pub mod parent_total_child_bounties { - use super::runtime_types; - pub type ParentTotalChildBounties = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u32; - } - pub mod child_bounties { - use super::runtime_types; - pub type ChildBounties = runtime_types::pallet_child_bounties::ChildBounty< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::core::primitive::u32; - } - pub mod child_bounty_descriptions_v1 { - use super::runtime_types; - pub type ChildBountyDescriptionsV1 = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::core::primitive::u32; - } - pub mod v0_to_v1_child_bounty_ids { - use super::runtime_types; - pub type V0ToV1ChildBountyIds = - (::core::primitive::u32, ::core::primitive::u32); - pub type Param0 = ::core::primitive::u32; - } - pub mod children_curator_fees { - use super::runtime_types; - pub type ChildrenCuratorFees = ::core::primitive::u128; - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " DEPRECATED: Replaced with `ParentTotalChildBounties` storage item keeping dedicated counts"] @@ -31771,41 +28362,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::child_bounty_count::ChildBountyCount, - ::subxt::ext::subxt_core::utils::Yes, + child_bounty_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ChildBounties", "ChildBountyCount", - (), - [ - 206u8, 1u8, 40u8, 132u8, 51u8, 139u8, 234u8, 20u8, 89u8, 86u8, 247u8, - 107u8, 169u8, 252u8, 5u8, 180u8, 218u8, 24u8, 232u8, 94u8, 82u8, 135u8, - 24u8, 16u8, 134u8, 23u8, 201u8, 86u8, 12u8, 19u8, 199u8, 0u8, - ], - ) - } - #[doc = " Number of active child bounties per parent bounty."] - #[doc = " Map of parent bounty index to number of child bounties."] - pub fn parent_child_bounties_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::parent_child_bounties::ParentChildBounties, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "ParentChildBounties", - (), [ - 52u8, 179u8, 242u8, 212u8, 91u8, 185u8, 176u8, 52u8, 100u8, 200u8, 1u8, - 41u8, 184u8, 234u8, 234u8, 8u8, 123u8, 252u8, 131u8, 55u8, 109u8, - 123u8, 89u8, 75u8, 101u8, 165u8, 117u8, 175u8, 92u8, 71u8, 62u8, 67u8, + 125u8, 210u8, 39u8, 252u8, 135u8, 219u8, 252u8, 0u8, 13u8, 47u8, 10u8, + 8u8, 114u8, 135u8, 75u8, 126u8, 219u8, 142u8, 140u8, 47u8, 18u8, 116u8, + 219u8, 249u8, 84u8, 92u8, 50u8, 114u8, 89u8, 85u8, 22u8, 201u8, ], ) } @@ -31813,199 +28379,55 @@ pub mod api { #[doc = " Map of parent bounty index to number of child bounties."] pub fn parent_child_bounties( &self, - _0: types::parent_child_bounties::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::parent_child_bounties::Param0, - >, - types::parent_child_bounties::ParentChildBounties, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (parent_child_bounties::Param0,), + parent_child_bounties::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ChildBounties", "ParentChildBounties", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 52u8, 179u8, 242u8, 212u8, 91u8, 185u8, 176u8, 52u8, 100u8, 200u8, 1u8, - 41u8, 184u8, 234u8, 234u8, 8u8, 123u8, 252u8, 131u8, 55u8, 109u8, - 123u8, 89u8, 75u8, 101u8, 165u8, 117u8, 175u8, 92u8, 71u8, 62u8, 67u8, - ], - ) - } - #[doc = " Number of total child bounties per parent bounty, including completed bounties."] - pub fn parent_total_child_bounties_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::parent_total_child_bounties::ParentTotalChildBounties, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "ParentTotalChildBounties", - (), [ - 219u8, 151u8, 60u8, 233u8, 115u8, 32u8, 180u8, 227u8, 121u8, 103u8, - 197u8, 124u8, 86u8, 35u8, 140u8, 73u8, 158u8, 86u8, 240u8, 96u8, 49u8, - 220u8, 3u8, 238u8, 20u8, 118u8, 200u8, 113u8, 117u8, 179u8, 89u8, 9u8, + 76u8, 150u8, 44u8, 115u8, 163u8, 88u8, 54u8, 209u8, 175u8, 15u8, 186u8, + 9u8, 170u8, 53u8, 181u8, 153u8, 59u8, 142u8, 105u8, 138u8, 246u8, + 217u8, 1u8, 60u8, 209u8, 95u8, 243u8, 62u8, 37u8, 57u8, 226u8, 58u8, ], ) } #[doc = " Number of total child bounties per parent bounty, including completed bounties."] pub fn parent_total_child_bounties( &self, - _0: types::parent_total_child_bounties::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::parent_total_child_bounties::Param0, - >, - types::parent_total_child_bounties::ParentTotalChildBounties, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (parent_total_child_bounties::Param0,), + parent_total_child_bounties::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ChildBounties", "ParentTotalChildBounties", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 219u8, 151u8, 60u8, 233u8, 115u8, 32u8, 180u8, 227u8, 121u8, 103u8, - 197u8, 124u8, 86u8, 35u8, 140u8, 73u8, 158u8, 86u8, 240u8, 96u8, 49u8, - 220u8, 3u8, 238u8, 20u8, 118u8, 200u8, 113u8, 117u8, 179u8, 89u8, 9u8, - ], - ) - } - #[doc = " Child bounties that have been added."] - pub fn child_bounties_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::child_bounties::ChildBounties, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "ChildBounties", - (), - [ - 165u8, 240u8, 158u8, 204u8, 183u8, 190u8, 129u8, 65u8, 226u8, 8u8, - 182u8, 103u8, 46u8, 162u8, 35u8, 155u8, 131u8, 45u8, 163u8, 64u8, - 154u8, 137u8, 126u8, 249u8, 238u8, 156u8, 233u8, 78u8, 28u8, 95u8, - 242u8, 147u8, - ], - ) - } - #[doc = " Child bounties that have been added."] - pub fn child_bounties_iter1( - &self, - _0: types::child_bounties::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::child_bounties::Param0, - >, - types::child_bounties::ChildBounties, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "ChildBounties", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 165u8, 240u8, 158u8, 204u8, 183u8, 190u8, 129u8, 65u8, 226u8, 8u8, - 182u8, 103u8, 46u8, 162u8, 35u8, 155u8, 131u8, 45u8, 163u8, 64u8, - 154u8, 137u8, 126u8, 249u8, 238u8, 156u8, 233u8, 78u8, 28u8, 95u8, - 242u8, 147u8, + 210u8, 130u8, 240u8, 34u8, 60u8, 142u8, 84u8, 110u8, 128u8, 189u8, + 65u8, 175u8, 169u8, 63u8, 178u8, 38u8, 26u8, 17u8, 38u8, 159u8, 98u8, + 89u8, 70u8, 3u8, 57u8, 107u8, 119u8, 34u8, 91u8, 98u8, 5u8, 149u8, ], ) } #[doc = " Child bounties that have been added."] pub fn child_bounties( &self, - _0: types::child_bounties::Param0, - _1: types::child_bounties::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::child_bounties::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::child_bounties::Param1, - >, - ), - types::child_bounties::ChildBounties, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (child_bounties::Param0, child_bounties::Param1), + child_bounties::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ChildBounties", "ChildBounties", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), [ - 165u8, 240u8, 158u8, 204u8, 183u8, 190u8, 129u8, 65u8, 226u8, 8u8, - 182u8, 103u8, 46u8, 162u8, 35u8, 155u8, 131u8, 45u8, 163u8, 64u8, - 154u8, 137u8, 126u8, 249u8, 238u8, 156u8, 233u8, 78u8, 28u8, 95u8, - 242u8, 147u8, - ], - ) - } - #[doc = " The description of each child-bounty. Indexed by `(parent_id, child_id)`."] - #[doc = ""] - #[doc = " This item replaces the `ChildBountyDescriptions` storage item from the V0 storage version."] - pub fn child_bounty_descriptions_v1_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::child_bounty_descriptions_v1::ChildBountyDescriptionsV1, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "ChildBountyDescriptionsV1", - (), - [ - 143u8, 206u8, 114u8, 60u8, 75u8, 87u8, 46u8, 170u8, 249u8, 59u8, 12u8, - 6u8, 34u8, 16u8, 232u8, 251u8, 73u8, 132u8, 229u8, 77u8, 177u8, 57u8, - 59u8, 202u8, 231u8, 60u8, 178u8, 31u8, 38u8, 2u8, 253u8, 255u8, - ], - ) - } - #[doc = " The description of each child-bounty. Indexed by `(parent_id, child_id)`."] - #[doc = ""] - #[doc = " This item replaces the `ChildBountyDescriptions` storage item from the V0 storage version."] - pub fn child_bounty_descriptions_v1_iter1( - &self, - _0: types::child_bounty_descriptions_v1::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::child_bounty_descriptions_v1::Param0, - >, - types::child_bounty_descriptions_v1::ChildBountyDescriptionsV1, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "ChildBountyDescriptionsV1", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 143u8, 206u8, 114u8, 60u8, 75u8, 87u8, 46u8, 170u8, 249u8, 59u8, 12u8, - 6u8, 34u8, 16u8, 232u8, 251u8, 73u8, 132u8, 229u8, 77u8, 177u8, 57u8, - 59u8, 202u8, 231u8, 60u8, 178u8, 31u8, 38u8, 2u8, 253u8, 255u8, + 61u8, 33u8, 171u8, 207u8, 170u8, 13u8, 33u8, 249u8, 196u8, 142u8, + 127u8, 37u8, 89u8, 237u8, 65u8, 26u8, 179u8, 153u8, 148u8, 123u8, + 133u8, 115u8, 74u8, 27u8, 223u8, 90u8, 55u8, 113u8, 65u8, 232u8, 235u8, + 201u8, ], ) } @@ -32014,59 +28436,22 @@ pub mod api { #[doc = " This item replaces the `ChildBountyDescriptions` storage item from the V0 storage version."] pub fn child_bounty_descriptions_v1( &self, - _0: types::child_bounty_descriptions_v1::Param0, - _1: types::child_bounty_descriptions_v1::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::child_bounty_descriptions_v1::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::child_bounty_descriptions_v1::Param1, - >, + child_bounty_descriptions_v1::Param0, + child_bounty_descriptions_v1::Param1, ), - types::child_bounty_descriptions_v1::ChildBountyDescriptionsV1, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + child_bounty_descriptions_v1::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ChildBounties", "ChildBountyDescriptionsV1", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), [ - 143u8, 206u8, 114u8, 60u8, 75u8, 87u8, 46u8, 170u8, 249u8, 59u8, 12u8, - 6u8, 34u8, 16u8, 232u8, 251u8, 73u8, 132u8, 229u8, 77u8, 177u8, 57u8, - 59u8, 202u8, 231u8, 60u8, 178u8, 31u8, 38u8, 2u8, 253u8, 255u8, - ], - ) - } - #[doc = " The mapping of the child bounty ids from storage version `V0` to the new `V1` version."] - #[doc = ""] - #[doc = " The `V0` ids based on total child bounty count [`ChildBountyCount`]`. The `V1` version ids"] - #[doc = " based on the child bounty count per parent bounty [`ParentTotalChildBounties`]."] - #[doc = " The item intended solely for client convenience and not used in the pallet's core logic."] - pub fn v0_to_v1_child_bounty_ids_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::v0_to_v1_child_bounty_ids::V0ToV1ChildBountyIds, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "V0ToV1ChildBountyIds", - (), - [ - 254u8, 251u8, 192u8, 11u8, 206u8, 216u8, 21u8, 48u8, 209u8, 242u8, - 189u8, 46u8, 185u8, 122u8, 225u8, 237u8, 169u8, 99u8, 55u8, 245u8, - 122u8, 27u8, 29u8, 235u8, 105u8, 99u8, 98u8, 208u8, 227u8, 227u8, - 127u8, 206u8, + 103u8, 172u8, 32u8, 8u8, 71u8, 100u8, 231u8, 129u8, 167u8, 87u8, 241u8, + 140u8, 136u8, 54u8, 178u8, 132u8, 123u8, 196u8, 228u8, 161u8, 154u8, + 35u8, 11u8, 194u8, 175u8, 157u8, 75u8, 166u8, 197u8, 189u8, 223u8, + 20u8, ], ) } @@ -32077,74 +28462,111 @@ pub mod api { #[doc = " The item intended solely for client convenience and not used in the pallet's core logic."] pub fn v0_to_v1_child_bounty_ids( &self, - _0: types::v0_to_v1_child_bounty_ids::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::v0_to_v1_child_bounty_ids::Param0, - >, - types::v0_to_v1_child_bounty_ids::V0ToV1ChildBountyIds, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (v0_to_v1_child_bounty_ids::Param0,), + v0_to_v1_child_bounty_ids::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ChildBounties", "V0ToV1ChildBountyIds", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 254u8, 251u8, 192u8, 11u8, 206u8, 216u8, 21u8, 48u8, 209u8, 242u8, - 189u8, 46u8, 185u8, 122u8, 225u8, 237u8, 169u8, 99u8, 55u8, 245u8, - 122u8, 27u8, 29u8, 235u8, 105u8, 99u8, 98u8, 208u8, 227u8, 227u8, - 127u8, 206u8, - ], - ) - } - #[doc = " The cumulative child-bounty curator fee for each parent bounty."] - pub fn children_curator_fees_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::children_curator_fees::ChildrenCuratorFees, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ChildBounties", - "ChildrenCuratorFees", - (), [ - 32u8, 16u8, 190u8, 193u8, 6u8, 80u8, 163u8, 16u8, 85u8, 111u8, 39u8, - 141u8, 209u8, 70u8, 213u8, 167u8, 22u8, 12u8, 93u8, 17u8, 104u8, 94u8, - 129u8, 37u8, 179u8, 41u8, 156u8, 117u8, 39u8, 202u8, 227u8, 235u8, + 65u8, 50u8, 101u8, 181u8, 153u8, 164u8, 229u8, 23u8, 37u8, 207u8, 33u8, + 13u8, 40u8, 52u8, 154u8, 107u8, 186u8, 236u8, 73u8, 96u8, 37u8, 206u8, + 152u8, 143u8, 213u8, 234u8, 216u8, 92u8, 80u8, 242u8, 202u8, 138u8, ], ) } #[doc = " The cumulative child-bounty curator fee for each parent bounty."] pub fn children_curator_fees( &self, - _0: types::children_curator_fees::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::children_curator_fees::Param0, - >, - types::children_curator_fees::ChildrenCuratorFees, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (children_curator_fees::Param0,), + children_curator_fees::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ChildBounties", "ChildrenCuratorFees", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 32u8, 16u8, 190u8, 193u8, 6u8, 80u8, 163u8, 16u8, 85u8, 111u8, 39u8, - 141u8, 209u8, 70u8, 213u8, 167u8, 22u8, 12u8, 93u8, 17u8, 104u8, 94u8, - 129u8, 37u8, 179u8, 41u8, 156u8, 117u8, 39u8, 202u8, 227u8, 235u8, + 33u8, 169u8, 254u8, 15u8, 105u8, 243u8, 81u8, 203u8, 212u8, 157u8, + 121u8, 62u8, 131u8, 132u8, 67u8, 159u8, 102u8, 102u8, 115u8, 70u8, + 93u8, 199u8, 183u8, 229u8, 38u8, 120u8, 41u8, 151u8, 244u8, 82u8, + 192u8, 62u8, ], ) } } + pub mod child_bounty_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod parent_child_bounties { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod parent_total_child_bounties { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod child_bounties { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_child_bounties::ChildBounty< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + } + } + pub mod child_bounty_descriptions_v1 { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + } + pub mod v0_to_v1_child_bounty_ids { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = (::core::primitive::u32, ::core::primitive::u32); + } + } + pub mod children_curator_fees { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } } pub mod constants { use super::runtime_types; @@ -32733,44 +29155,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod queue_totals { - use super::runtime_types; - pub type QueueTotals = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u128, - )>; - } - pub mod queues { - use super::runtime_types; - pub type Queues = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_nis::pallet::Bid< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod summary { - use super::runtime_types; - pub type Summary = runtime_types::pallet_nis::pallet::SummaryRecord< - ::core::primitive::u32, - ::core::primitive::u128, - >; - } - pub mod receipts { - use super::runtime_types; - pub type Receipts = runtime_types::pallet_nis::pallet::ReceiptRecord< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u128, - >; - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The totals of items and balances within each queue. Saves a lot of storage reads in the"] @@ -32782,66 +29168,34 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::queue_totals::QueueTotals, - ::subxt::ext::subxt_core::utils::Yes, + queue_totals::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Nis", "QueueTotals", - (), - [ - 40u8, 120u8, 43u8, 203u8, 97u8, 129u8, 61u8, 184u8, 137u8, 45u8, 201u8, - 90u8, 227u8, 161u8, 52u8, 179u8, 9u8, 74u8, 104u8, 225u8, 209u8, 62u8, - 69u8, 222u8, 124u8, 202u8, 36u8, 137u8, 183u8, 102u8, 234u8, 58u8, - ], - ) - } - #[doc = " The queues of bids. Indexed by duration (in `Period`s)."] - pub fn queues_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::queues::Queues, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Nis", - "Queues", - (), [ - 144u8, 181u8, 173u8, 134u8, 6u8, 165u8, 174u8, 91u8, 75u8, 241u8, - 142u8, 192u8, 246u8, 71u8, 132u8, 146u8, 181u8, 158u8, 125u8, 34u8, - 5u8, 151u8, 136u8, 148u8, 228u8, 11u8, 226u8, 229u8, 8u8, 50u8, 205u8, - 75u8, + 141u8, 176u8, 111u8, 4u8, 147u8, 0u8, 96u8, 157u8, 183u8, 212u8, 178u8, + 5u8, 91u8, 133u8, 38u8, 150u8, 223u8, 249u8, 39u8, 133u8, 104u8, 185u8, + 247u8, 8u8, 46u8, 50u8, 74u8, 13u8, 101u8, 82u8, 75u8, 236u8, ], ) } #[doc = " The queues of bids. Indexed by duration (in `Period`s)."] pub fn queues( &self, - _0: types::queues::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::queues::Param0, - >, - types::queues::Queues, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (queues::Param0,), + queues::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Nis", "Queues", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 144u8, 181u8, 173u8, 134u8, 6u8, 165u8, 174u8, 91u8, 75u8, 241u8, - 142u8, 192u8, 246u8, 71u8, 132u8, 146u8, 181u8, 158u8, 125u8, 34u8, - 5u8, 151u8, 136u8, 148u8, 228u8, 11u8, 226u8, 229u8, 8u8, 50u8, 205u8, - 75u8, + 23u8, 28u8, 12u8, 158u8, 31u8, 88u8, 62u8, 93u8, 188u8, 48u8, 63u8, + 41u8, 251u8, 170u8, 78u8, 194u8, 204u8, 222u8, 225u8, 106u8, 90u8, + 70u8, 43u8, 201u8, 109u8, 75u8, 61u8, 77u8, 174u8, 215u8, 59u8, 76u8, ], ) } @@ -32850,69 +29204,86 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::summary::Summary, - ::subxt::ext::subxt_core::utils::Yes, + summary::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Nis", "Summary", - (), [ - 106u8, 21u8, 103u8, 47u8, 211u8, 234u8, 50u8, 222u8, 25u8, 209u8, 67u8, - 117u8, 111u8, 6u8, 231u8, 245u8, 109u8, 52u8, 177u8, 20u8, 179u8, - 253u8, 251u8, 197u8, 218u8, 163u8, 229u8, 187u8, 172u8, 122u8, 126u8, - 57u8, - ], - ) - } - #[doc = " The currently outstanding receipts, indexed according to the order of creation."] - pub fn receipts_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::receipts::Receipts, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Nis", - "Receipts", - (), - [ - 123u8, 179u8, 0u8, 14u8, 5u8, 132u8, 165u8, 192u8, 163u8, 22u8, 174u8, - 22u8, 252u8, 44u8, 167u8, 22u8, 116u8, 170u8, 186u8, 118u8, 131u8, 5u8, - 237u8, 121u8, 35u8, 146u8, 206u8, 239u8, 155u8, 108u8, 46u8, 0u8, + 192u8, 140u8, 82u8, 81u8, 151u8, 37u8, 97u8, 145u8, 30u8, 155u8, 57u8, + 92u8, 116u8, 50u8, 161u8, 34u8, 9u8, 197u8, 222u8, 29u8, 205u8, 207u8, + 27u8, 153u8, 33u8, 189u8, 201u8, 59u8, 130u8, 248u8, 43u8, 57u8, ], ) } #[doc = " The currently outstanding receipts, indexed according to the order of creation."] pub fn receipts( &self, - _0: types::receipts::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::receipts::Param0, - >, - types::receipts::Receipts, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (receipts::Param0,), + receipts::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Nis", "Receipts", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 123u8, 179u8, 0u8, 14u8, 5u8, 132u8, 165u8, 192u8, 163u8, 22u8, 174u8, - 22u8, 252u8, 44u8, 167u8, 22u8, 116u8, 170u8, 186u8, 118u8, 131u8, 5u8, - 237u8, 121u8, 35u8, 146u8, 206u8, 239u8, 155u8, 108u8, 46u8, 0u8, + 235u8, 76u8, 110u8, 234u8, 26u8, 2u8, 170u8, 6u8, 181u8, 239u8, 237u8, + 129u8, 178u8, 125u8, 75u8, 81u8, 77u8, 224u8, 180u8, 252u8, 50u8, 55u8, + 174u8, 132u8, 124u8, 39u8, 150u8, 143u8, 223u8, 46u8, 92u8, 10u8, ], ) } } + pub mod queue_totals { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + (::core::primitive::u32, ::core::primitive::u128), + >; + } + } + pub mod queues { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_nis::pallet::Bid< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + >, + >; + } + } + pub mod summary { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_nis::pallet::SummaryRecord< + ::core::primitive::u32, + ::core::primitive::u128, + >; + } + } + pub mod receipts { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_nis::pallet::ReceiptRecord< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + ::core::primitive::u128, + >; + } + } } pub mod constants { use super::runtime_types; @@ -34288,64 +30659,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod total_issuance { - use super::runtime_types; - pub type TotalIssuance = ::core::primitive::u128; - } - pub mod inactive_issuance { - use super::runtime_types; - pub type InactiveIssuance = ::core::primitive::u128; - } - pub mod account { - use super::runtime_types; - pub type Account = - runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod locks { - use super::runtime_types; - pub type Locks = - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_balances::types::BalanceLock< - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod reserves { - use super::runtime_types; - pub type Reserves = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_balances::types::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod holds { - use super::runtime_types; - pub type Holds = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - runtime_types::rococo_runtime::RuntimeHoldReason, - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod freezes { - use super::runtime_types; - pub type Freezes = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - (), - ::core::primitive::u128, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The total units issued in the system."] @@ -34353,20 +30668,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::total_issuance::TotalIssuance, - ::subxt::ext::subxt_core::utils::Yes, + total_issuance::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "NisCounterpartBalances", "TotalIssuance", - (), [ - 116u8, 70u8, 119u8, 194u8, 69u8, 37u8, 116u8, 206u8, 171u8, 70u8, - 171u8, 210u8, 226u8, 111u8, 184u8, 204u8, 206u8, 11u8, 68u8, 72u8, - 255u8, 19u8, 194u8, 11u8, 27u8, 194u8, 81u8, 204u8, 59u8, 224u8, 202u8, - 185u8, + 138u8, 120u8, 138u8, 119u8, 4u8, 166u8, 22u8, 216u8, 227u8, 249u8, + 161u8, 193u8, 54u8, 68u8, 55u8, 74u8, 230u8, 68u8, 131u8, 253u8, 146u8, + 73u8, 54u8, 85u8, 212u8, 83u8, 162u8, 188u8, 171u8, 5u8, 232u8, 21u8, ], ) } @@ -34375,63 +30686,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::inactive_issuance::InactiveIssuance, - ::subxt::ext::subxt_core::utils::Yes, + inactive_issuance::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "NisCounterpartBalances", "InactiveIssuance", - (), - [ - 212u8, 185u8, 19u8, 50u8, 250u8, 72u8, 173u8, 50u8, 4u8, 104u8, 161u8, - 249u8, 77u8, 247u8, 204u8, 248u8, 11u8, 18u8, 57u8, 4u8, 82u8, 110u8, - 30u8, 216u8, 16u8, 37u8, 87u8, 67u8, 189u8, 235u8, 214u8, 155u8, - ], - ) - } - #[doc = " The Balances pallet example of storing the balance of an account."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " You can also store the balance of an account in the `System` pallet."] - #[doc = ""] - #[doc = " # Example"] - #[doc = ""] - #[doc = " ```nocompile"] - #[doc = " impl pallet_balances::Config for Runtime {"] - #[doc = " type AccountStore = System"] - #[doc = " }"] - #[doc = " ```"] - #[doc = ""] - #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] - #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] - #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] - #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] - pub fn account_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::account::Account, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Account", - (), [ - 213u8, 38u8, 200u8, 69u8, 218u8, 0u8, 112u8, 181u8, 160u8, 23u8, 96u8, - 90u8, 3u8, 88u8, 126u8, 22u8, 103u8, 74u8, 64u8, 69u8, 29u8, 247u8, - 18u8, 17u8, 234u8, 143u8, 189u8, 22u8, 247u8, 194u8, 154u8, 249u8, + 97u8, 194u8, 82u8, 3u8, 40u8, 108u8, 109u8, 245u8, 175u8, 189u8, 212u8, + 193u8, 229u8, 82u8, 107u8, 169u8, 9u8, 176u8, 124u8, 102u8, 151u8, + 98u8, 87u8, 194u8, 82u8, 130u8, 41u8, 137u8, 3u8, 230u8, 145u8, 58u8, ], ) } @@ -34461,48 +30725,19 @@ pub mod api { #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] pub fn account( &self, - _0: types::account::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, - >, - types::account::Account, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (account::Param0,), + account::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "NisCounterpartBalances", "Account", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 213u8, 38u8, 200u8, 69u8, 218u8, 0u8, 112u8, 181u8, 160u8, 23u8, 96u8, - 90u8, 3u8, 88u8, 126u8, 22u8, 103u8, 74u8, 64u8, 69u8, 29u8, 247u8, - 18u8, 17u8, 234u8, 143u8, 189u8, 22u8, 247u8, 194u8, 154u8, 249u8, - ], - ) - } - #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] - #[doc = ""] - #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn locks_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::locks::Locks, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Locks", - (), [ - 10u8, 223u8, 55u8, 0u8, 249u8, 69u8, 168u8, 41u8, 75u8, 35u8, 120u8, - 167u8, 18u8, 132u8, 9u8, 20u8, 91u8, 51u8, 27u8, 69u8, 136u8, 187u8, - 13u8, 220u8, 163u8, 122u8, 26u8, 141u8, 174u8, 249u8, 85u8, 37u8, + 14u8, 88u8, 174u8, 192u8, 241u8, 142u8, 159u8, 255u8, 178u8, 117u8, + 55u8, 78u8, 218u8, 161u8, 146u8, 139u8, 170u8, 180u8, 187u8, 177u8, + 89u8, 157u8, 91u8, 225u8, 90u8, 174u8, 247u8, 47u8, 47u8, 23u8, 234u8, + 50u8, ], ) } @@ -34512,47 +30747,19 @@ pub mod api { #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn locks( &self, - _0: types::locks::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::locks::Param0, - >, - types::locks::Locks, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (locks::Param0,), + locks::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "NisCounterpartBalances", "Locks", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 10u8, 223u8, 55u8, 0u8, 249u8, 69u8, 168u8, 41u8, 75u8, 35u8, 120u8, - 167u8, 18u8, 132u8, 9u8, 20u8, 91u8, 51u8, 27u8, 69u8, 136u8, 187u8, - 13u8, 220u8, 163u8, 122u8, 26u8, 141u8, 174u8, 249u8, 85u8, 37u8, - ], - ) - } - #[doc = " Named reserves on some account balances."] - #[doc = ""] - #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] - pub fn reserves_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::reserves::Reserves, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Reserves", - (), [ - 112u8, 10u8, 241u8, 77u8, 64u8, 187u8, 106u8, 159u8, 13u8, 153u8, - 140u8, 178u8, 182u8, 50u8, 1u8, 55u8, 149u8, 92u8, 196u8, 229u8, 170u8, - 106u8, 193u8, 88u8, 255u8, 244u8, 2u8, 193u8, 62u8, 235u8, 204u8, 91u8, + 201u8, 50u8, 65u8, 126u8, 43u8, 153u8, 207u8, 145u8, 240u8, 59u8, + 160u8, 111u8, 144u8, 245u8, 193u8, 13u8, 227u8, 118u8, 72u8, 168u8, + 37u8, 147u8, 139u8, 221u8, 36u8, 177u8, 202u8, 209u8, 152u8, 122u8, + 250u8, 89u8, ], ) } @@ -34561,118 +30768,142 @@ pub mod api { #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] pub fn reserves( &self, - _0: types::reserves::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::reserves::Param0, - >, - types::reserves::Reserves, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (reserves::Param0,), + reserves::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "NisCounterpartBalances", "Reserves", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 112u8, 10u8, 241u8, 77u8, 64u8, 187u8, 106u8, 159u8, 13u8, 153u8, - 140u8, 178u8, 182u8, 50u8, 1u8, 55u8, 149u8, 92u8, 196u8, 229u8, 170u8, - 106u8, 193u8, 88u8, 255u8, 244u8, 2u8, 193u8, 62u8, 235u8, 204u8, 91u8, - ], - ) - } - #[doc = " Holds on account balances."] - pub fn holds_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::holds::Holds, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Holds", - (), [ - 6u8, 68u8, 133u8, 169u8, 100u8, 31u8, 19u8, 164u8, 80u8, 22u8, 132u8, - 73u8, 190u8, 31u8, 34u8, 82u8, 132u8, 79u8, 92u8, 15u8, 204u8, 149u8, - 109u8, 203u8, 169u8, 162u8, 250u8, 223u8, 182u8, 170u8, 251u8, 178u8, + 76u8, 220u8, 133u8, 100u8, 127u8, 174u8, 237u8, 103u8, 211u8, 104u8, + 140u8, 100u8, 49u8, 169u8, 114u8, 112u8, 193u8, 115u8, 234u8, 160u8, + 97u8, 104u8, 194u8, 47u8, 119u8, 136u8, 132u8, 196u8, 136u8, 121u8, + 45u8, 161u8, ], ) } #[doc = " Holds on account balances."] pub fn holds( &self, - _0: types::holds::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param0, - >, - types::holds::Holds, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (holds::Param0,), + holds::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "NisCounterpartBalances", "Holds", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 6u8, 68u8, 133u8, 169u8, 100u8, 31u8, 19u8, 164u8, 80u8, 22u8, 132u8, - 73u8, 190u8, 31u8, 34u8, 82u8, 132u8, 79u8, 92u8, 15u8, 204u8, 149u8, - 109u8, 203u8, 169u8, 162u8, 250u8, 223u8, 182u8, 170u8, 251u8, 178u8, - ], - ) - } - #[doc = " Freeze locks on account balances."] - pub fn freezes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::freezes::Freezes, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "NisCounterpartBalances", - "Freezes", - (), - [ - 69u8, 49u8, 165u8, 76u8, 135u8, 142u8, 179u8, 118u8, 50u8, 109u8, 53u8, - 112u8, 110u8, 94u8, 30u8, 93u8, 173u8, 38u8, 27u8, 142u8, 19u8, 5u8, - 163u8, 4u8, 68u8, 218u8, 179u8, 224u8, 118u8, 218u8, 115u8, 64u8, + 243u8, 190u8, 61u8, 27u8, 177u8, 143u8, 74u8, 255u8, 22u8, 109u8, + 167u8, 85u8, 179u8, 42u8, 42u8, 37u8, 8u8, 190u8, 38u8, 60u8, 158u8, + 138u8, 66u8, 201u8, 131u8, 136u8, 85u8, 160u8, 98u8, 110u8, 33u8, 50u8, ], ) } #[doc = " Freeze locks on account balances."] pub fn freezes( &self, - _0: types::freezes::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::freezes::Param0, - >, - types::freezes::Freezes, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (freezes::Param0,), + freezes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "NisCounterpartBalances", "Freezes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 69u8, 49u8, 165u8, 76u8, 135u8, 142u8, 179u8, 118u8, 50u8, 109u8, 53u8, - 112u8, 110u8, 94u8, 30u8, 93u8, 173u8, 38u8, 27u8, 142u8, 19u8, 5u8, - 163u8, 4u8, 68u8, 218u8, 179u8, 224u8, 118u8, 218u8, 115u8, 64u8, + 41u8, 196u8, 69u8, 26u8, 201u8, 141u8, 252u8, 255u8, 78u8, 216u8, + 102u8, 207u8, 133u8, 185u8, 86u8, 18u8, 79u8, 137u8, 132u8, 92u8, + 228u8, 237u8, 91u8, 125u8, 25u8, 111u8, 127u8, 212u8, 215u8, 114u8, + 219u8, 72u8, ], ) } } + pub mod total_issuance { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod inactive_issuance { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod account { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; + } + } + pub mod locks { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_balances::types::BalanceLock< + ::core::primitive::u128, + >, + >; + } + } + pub mod reserves { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_balances::types::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >; + } + } + pub mod holds { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + runtime_types::rococo_runtime::RuntimeHoldReason, + ::core::primitive::u128, + >, + >; + } + } + pub mod freezes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + (), + ::core::primitive::u128, + >, + >; + } + } } pub mod constants { use super::runtime_types; @@ -36707,22 +32938,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod active_config { - use super::runtime_types; - pub type ActiveConfig = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ; - } - pub mod pending_configs { - use super::runtime_types; - pub type PendingConfigs = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > ; - } - pub mod bypass_consistency_check { - use super::runtime_types; - pub type BypassConsistencyCheck = ::core::primitive::bool; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The active configuration for the current session."] @@ -36730,19 +32947,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::active_config::ActiveConfig, - ::subxt::ext::subxt_core::utils::Yes, + active_config::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Configuration", "ActiveConfig", - (), [ - 9u8, 85u8, 45u8, 253u8, 3u8, 175u8, 115u8, 58u8, 71u8, 169u8, 68u8, - 163u8, 231u8, 24u8, 231u8, 216u8, 61u8, 134u8, 59u8, 89u8, 31u8, 103u8, - 105u8, 8u8, 182u8, 99u8, 51u8, 130u8, 255u8, 2u8, 0u8, 147u8, + 200u8, 38u8, 35u8, 73u8, 173u8, 169u8, 14u8, 138u8, 251u8, 82u8, 200u8, + 111u8, 233u8, 36u8, 217u8, 66u8, 118u8, 145u8, 27u8, 225u8, 218u8, + 251u8, 61u8, 192u8, 187u8, 34u8, 197u8, 163u8, 187u8, 152u8, 185u8, + 135u8, ], ) } @@ -36757,19 +32972,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::pending_configs::PendingConfigs, - ::subxt::ext::subxt_core::utils::Yes, + pending_configs::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Configuration", "PendingConfigs", - (), [ - 7u8, 170u8, 38u8, 177u8, 76u8, 75u8, 198u8, 192u8, 247u8, 137u8, 85u8, - 17u8, 74u8, 93u8, 170u8, 177u8, 198u8, 208u8, 183u8, 28u8, 178u8, 5u8, - 39u8, 246u8, 175u8, 78u8, 145u8, 37u8, 212u8, 20u8, 52u8, 110u8, + 49u8, 215u8, 163u8, 168u8, 182u8, 52u8, 216u8, 228u8, 150u8, 159u8, + 47u8, 138u8, 12u8, 39u8, 174u8, 31u8, 130u8, 94u8, 46u8, 141u8, 3u8, + 171u8, 39u8, 153u8, 87u8, 31u8, 38u8, 131u8, 44u8, 122u8, 186u8, 195u8, ], ) } @@ -36779,24 +32991,44 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::bypass_consistency_check::BypassConsistencyCheck, - ::subxt::ext::subxt_core::utils::Yes, + bypass_consistency_check::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Configuration", "BypassConsistencyCheck", - (), [ - 109u8, 201u8, 130u8, 189u8, 167u8, 112u8, 171u8, 180u8, 100u8, 146u8, - 23u8, 174u8, 199u8, 230u8, 185u8, 155u8, 178u8, 45u8, 24u8, 66u8, - 211u8, 234u8, 11u8, 103u8, 148u8, 12u8, 247u8, 101u8, 147u8, 18u8, - 11u8, 89u8, + 75u8, 229u8, 175u8, 164u8, 203u8, 15u8, 4u8, 72u8, 188u8, 127u8, 6u8, + 193u8, 72u8, 66u8, 121u8, 24u8, 45u8, 154u8, 24u8, 58u8, 152u8, 255u8, + 191u8, 136u8, 166u8, 22u8, 154u8, 21u8, 182u8, 251u8, 193u8, 249u8, ], ) } } + pub mod active_config { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ; + } + } + pub mod pending_configs { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > ; + } + } + pub mod bypass_consistency_check { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } } } pub mod paras_shared { @@ -36815,30 +33047,8 @@ pub mod api { impl TransactionApi {} } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod current_session_index { - use super::runtime_types; - pub type CurrentSessionIndex = ::core::primitive::u32; - } - pub mod active_validator_indices { - use super::runtime_types; - pub type ActiveValidatorIndices = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >; - } - pub mod active_validator_keys { - use super::runtime_types; - pub type ActiveValidatorKeys = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::validator_app::Public, - >; - } - pub mod allowed_relay_parents { - use super::runtime_types; - pub type AllowedRelayParents = runtime_types :: polkadot_runtime_parachains :: shared :: AllowedRelayParentsTracker < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > ; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The current session index."] @@ -36846,20 +33056,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::current_session_index::CurrentSessionIndex, - ::subxt::ext::subxt_core::utils::Yes, + current_session_index::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasShared", "CurrentSessionIndex", - (), [ - 250u8, 164u8, 179u8, 84u8, 199u8, 245u8, 116u8, 48u8, 86u8, 127u8, - 50u8, 117u8, 236u8, 41u8, 107u8, 238u8, 151u8, 236u8, 68u8, 78u8, - 152u8, 5u8, 155u8, 107u8, 69u8, 197u8, 222u8, 94u8, 150u8, 2u8, 31u8, - 191u8, + 110u8, 120u8, 129u8, 94u8, 92u8, 16u8, 70u8, 25u8, 70u8, 252u8, 86u8, + 110u8, 239u8, 128u8, 103u8, 94u8, 177u8, 183u8, 50u8, 74u8, 238u8, + 53u8, 19u8, 38u8, 228u8, 5u8, 221u8, 164u8, 212u8, 3u8, 90u8, 156u8, ], ) } @@ -36869,19 +33075,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::active_validator_indices::ActiveValidatorIndices, - ::subxt::ext::subxt_core::utils::Yes, + active_validator_indices::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasShared", "ActiveValidatorIndices", - (), [ - 80u8, 207u8, 217u8, 195u8, 69u8, 151u8, 27u8, 205u8, 227u8, 89u8, 71u8, - 180u8, 91u8, 116u8, 82u8, 193u8, 108u8, 115u8, 40u8, 247u8, 160u8, - 39u8, 85u8, 99u8, 42u8, 87u8, 54u8, 168u8, 230u8, 201u8, 212u8, 39u8, + 161u8, 23u8, 175u8, 177u8, 129u8, 156u8, 226u8, 176u8, 15u8, 195u8, + 117u8, 76u8, 43u8, 73u8, 41u8, 202u8, 66u8, 174u8, 32u8, 96u8, 164u8, + 143u8, 95u8, 192u8, 66u8, 134u8, 157u8, 56u8, 32u8, 218u8, 97u8, 206u8, ], ) } @@ -36891,19 +33094,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::active_validator_keys::ActiveValidatorKeys, - ::subxt::ext::subxt_core::utils::Yes, + active_validator_keys::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasShared", "ActiveValidatorKeys", - (), [ - 228u8, 111u8, 152u8, 198u8, 158u8, 9u8, 193u8, 222u8, 92u8, 190u8, - 91u8, 24u8, 98u8, 156u8, 88u8, 231u8, 255u8, 1u8, 74u8, 56u8, 44u8, - 110u8, 175u8, 29u8, 45u8, 242u8, 129u8, 181u8, 145u8, 5u8, 28u8, 40u8, + 4u8, 253u8, 203u8, 154u8, 244u8, 78u8, 177u8, 130u8, 126u8, 85u8, 30u8, + 70u8, 136u8, 29u8, 12u8, 130u8, 170u8, 103u8, 247u8, 184u8, 161u8, + 98u8, 240u8, 215u8, 23u8, 148u8, 6u8, 31u8, 110u8, 42u8, 128u8, 184u8, ], ) } @@ -36912,23 +33112,57 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::allowed_relay_parents::AllowedRelayParents, - ::subxt::ext::subxt_core::utils::Yes, + allowed_relay_parents::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasShared", "AllowedRelayParents", - (), [ - 19u8, 136u8, 83u8, 71u8, 147u8, 131u8, 0u8, 128u8, 2u8, 78u8, 136u8, - 126u8, 42u8, 42u8, 76u8, 33u8, 22u8, 254u8, 25u8, 74u8, 140u8, 126u8, - 142u8, 229u8, 76u8, 163u8, 30u8, 192u8, 104u8, 50u8, 6u8, 121u8, + 116u8, 133u8, 100u8, 23u8, 87u8, 154u8, 56u8, 150u8, 56u8, 32u8, 132u8, + 142u8, 249u8, 35u8, 250u8, 246u8, 37u8, 48u8, 152u8, 227u8, 195u8, + 51u8, 246u8, 10u8, 159u8, 238u8, 227u8, 26u8, 181u8, 209u8, 208u8, + 212u8, ], ) } } + pub mod current_session_index { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod active_validator_indices { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::ValidatorIndex, + >; + } + } + pub mod active_validator_keys { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::validator_app::Public, + >; + } + } + pub mod allowed_relay_parents { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_parachains :: shared :: AllowedRelayParentsTracker < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > ; + } + } } } pub mod para_inclusion { @@ -37057,43 +33291,10 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod v1 { - use super::runtime_types; - pub type V1 = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > > ; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Candidates pending availability by `ParaId`. They form a chain starting from the latest"] - #[doc = " included head of the para."] - #[doc = " Use a different prefix post-migration to v1, since the v0 `PendingAvailability` storage"] - #[doc = " would otherwise have the exact same prefix which could cause undefined behaviour when doing"] - #[doc = " the migration."] - pub fn v1_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::v1::V1, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParaInclusion", - "V1", - (), - [ - 163u8, 193u8, 111u8, 157u8, 84u8, 109u8, 186u8, 223u8, 76u8, 169u8, - 221u8, 212u8, 74u8, 197u8, 126u8, 44u8, 170u8, 85u8, 158u8, 255u8, - 144u8, 62u8, 61u8, 171u8, 59u8, 97u8, 242u8, 92u8, 252u8, 196u8, 225u8, - 205u8, - ], - ) - } #[doc = " Candidates pending availability by `ParaId`. They form a chain starting from the latest"] #[doc = " included head of the para."] #[doc = " Use a different prefix post-migration to v1, since the v0 `PendingAvailability` storage"] @@ -37101,27 +33302,31 @@ pub mod api { #[doc = " the migration."] pub fn v1( &self, - _0: types::v1::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey, - types::v1::V1, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (v1::Param0,), + v1::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaInclusion", "V1", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 163u8, 193u8, 111u8, 157u8, 84u8, 109u8, 186u8, 223u8, 76u8, 169u8, - 221u8, 212u8, 74u8, 197u8, 126u8, 44u8, 170u8, 85u8, 158u8, 255u8, - 144u8, 62u8, 61u8, 171u8, 59u8, 97u8, 242u8, 92u8, 252u8, 196u8, 225u8, - 205u8, + 25u8, 119u8, 186u8, 58u8, 230u8, 195u8, 8u8, 110u8, 222u8, 136u8, 75u8, + 52u8, 26u8, 14u8, 228u8, 88u8, 118u8, 175u8, 148u8, 76u8, 237u8, 52u8, + 196u8, 165u8, 214u8, 2u8, 184u8, 234u8, 85u8, 140u8, 128u8, 130u8, ], ) } } + pub mod v1 { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: ext :: subxt_core :: utils :: H256 , :: core :: primitive :: u32 > > ; + } + } } } pub mod para_inherent { @@ -37185,21 +33390,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod included { - use super::runtime_types; - pub type Included = (); - } - pub mod on_chain_votes { - use super::runtime_types; - pub type OnChainVotes = - runtime_types::polkadot_primitives::v9::ScrapedOnChainVotes< - ::subxt::ext::subxt_core::utils::H256, - >; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Whether the paras inherent was included within this block."] @@ -37212,19 +33404,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::included::Included, + included::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaInherent", "Included", - (), [ - 108u8, 164u8, 163u8, 34u8, 27u8, 124u8, 202u8, 167u8, 48u8, 130u8, - 155u8, 211u8, 148u8, 130u8, 76u8, 16u8, 5u8, 250u8, 211u8, 174u8, 90u8, - 77u8, 198u8, 153u8, 175u8, 168u8, 131u8, 244u8, 27u8, 93u8, 60u8, 46u8, + 54u8, 66u8, 25u8, 224u8, 247u8, 87u8, 123u8, 147u8, 143u8, 210u8, 60u8, + 187u8, 96u8, 251u8, 27u8, 197u8, 247u8, 218u8, 82u8, 180u8, 16u8, + 230u8, 98u8, 239u8, 10u8, 136u8, 15u8, 29u8, 202u8, 69u8, 184u8, 251u8, ], ) } @@ -37233,50 +33422,46 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::on_chain_votes::OnChainVotes, + on_chain_votes::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaInherent", "OnChainVotes", - (), [ - 77u8, 63u8, 4u8, 215u8, 83u8, 144u8, 57u8, 27u8, 119u8, 37u8, 195u8, - 53u8, 237u8, 133u8, 118u8, 231u8, 158u8, 207u8, 91u8, 48u8, 85u8, - 102u8, 235u8, 118u8, 188u8, 88u8, 132u8, 60u8, 200u8, 33u8, 67u8, - 159u8, + 153u8, 4u8, 81u8, 211u8, 55u8, 148u8, 41u8, 197u8, 76u8, 15u8, 198u8, + 168u8, 101u8, 237u8, 152u8, 207u8, 212u8, 35u8, 118u8, 230u8, 231u8, + 157u8, 18u8, 188u8, 204u8, 65u8, 62u8, 193u8, 141u8, 6u8, 73u8, 60u8, ], ) } } + pub mod included { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = (); + } + } + pub mod on_chain_votes { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_primitives::v9::ScrapedOnChainVotes< + ::subxt::ext::subxt_core::utils::H256, + >; + } + } } } pub mod para_scheduler { use super::root_mod; use super::runtime_types; pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod validator_groups { - use super::runtime_types; - pub type ValidatorGroups = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >, - >; - } - pub mod session_start_block { - use super::runtime_types; - pub type SessionStartBlock = ::core::primitive::u32; - } - pub mod claim_queue { - use super::runtime_types; - pub type ClaimQueue = :: subxt :: ext :: subxt_core :: utils :: KeyedVec < runtime_types :: polkadot_primitives :: v9 :: CoreIndex , :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: common :: Assignment > > ; - } - } pub struct StorageApi; impl StorageApi { #[doc = " All the validator groups. One for each core. Indices are into `ActiveValidators` - not the"] @@ -37290,19 +33475,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::validator_groups::ValidatorGroups, + validator_groups::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaScheduler", "ValidatorGroups", - (), [ - 129u8, 58u8, 65u8, 112u8, 4u8, 172u8, 167u8, 19u8, 96u8, 154u8, 159u8, - 83u8, 94u8, 125u8, 60u8, 43u8, 60u8, 70u8, 1u8, 58u8, 222u8, 31u8, - 73u8, 53u8, 71u8, 181u8, 49u8, 64u8, 212u8, 90u8, 128u8, 185u8, + 65u8, 129u8, 143u8, 30u8, 138u8, 227u8, 246u8, 9u8, 119u8, 189u8, + 165u8, 139u8, 138u8, 252u8, 126u8, 132u8, 148u8, 118u8, 163u8, 247u8, + 127u8, 122u8, 61u8, 229u8, 252u8, 110u8, 223u8, 19u8, 41u8, 94u8, + 215u8, 211u8, ], ) } @@ -37317,19 +33500,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::session_start_block::SessionStartBlock, - ::subxt::ext::subxt_core::utils::Yes, + session_start_block::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaScheduler", "SessionStartBlock", - (), [ - 185u8, 76u8, 120u8, 75u8, 154u8, 31u8, 33u8, 243u8, 16u8, 77u8, 100u8, - 249u8, 21u8, 44u8, 199u8, 195u8, 37u8, 9u8, 218u8, 148u8, 222u8, 90u8, - 113u8, 34u8, 152u8, 215u8, 114u8, 134u8, 81u8, 139u8, 164u8, 71u8, + 163u8, 214u8, 47u8, 240u8, 94u8, 129u8, 137u8, 32u8, 89u8, 184u8, 32u8, + 162u8, 245u8, 150u8, 172u8, 225u8, 236u8, 37u8, 62u8, 156u8, 165u8, + 41u8, 6u8, 190u8, 144u8, 92u8, 210u8, 243u8, 34u8, 216u8, 168u8, 144u8, ], ) } @@ -37339,24 +33519,48 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::claim_queue::ClaimQueue, - ::subxt::ext::subxt_core::utils::Yes, + claim_queue::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaScheduler", "ClaimQueue", - (), [ - 240u8, 46u8, 91u8, 20u8, 166u8, 224u8, 110u8, 71u8, 239u8, 139u8, 55u8, - 228u8, 184u8, 34u8, 165u8, 115u8, 192u8, 243u8, 244u8, 44u8, 107u8, - 14u8, 67u8, 146u8, 186u8, 179u8, 9u8, 134u8, 181u8, 240u8, 254u8, - 112u8, + 90u8, 69u8, 52u8, 236u8, 241u8, 89u8, 171u8, 235u8, 79u8, 15u8, 67u8, + 77u8, 230u8, 202u8, 8u8, 228u8, 243u8, 95u8, 131u8, 185u8, 110u8, 23u8, + 254u8, 165u8, 145u8, 76u8, 75u8, 239u8, 77u8, 41u8, 209u8, 63u8, ], ) } } + pub mod validator_groups { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::ValidatorIndex, + >, + >; + } + } + pub mod session_start_block { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod claim_queue { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt :: ext :: subxt_core :: utils :: KeyedVec < runtime_types :: polkadot_primitives :: v9 :: CoreIndex , :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: common :: Assignment > > ; + } + } } } pub mod paras { @@ -38189,195 +34393,29 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod pvf_active_vote_map { - use super::runtime_types; - pub type PvfActiveVoteMap = - runtime_types::polkadot_runtime_parachains::paras::PvfCheckActiveVoteState< - ::core::primitive::u32, - >; - pub type Param0 = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - } - pub mod pvf_active_vote_list { - use super::runtime_types; - pub type PvfActiveVoteList = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; - } - pub mod parachains { - use super::runtime_types; - pub type Parachains = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; - } - pub mod para_lifecycles { - use super::runtime_types; - pub type ParaLifecycles = - runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod heads { - use super::runtime_types; - pub type Heads = - runtime_types::polkadot_parachain_primitives::primitives::HeadData; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod most_recent_context { - use super::runtime_types; - pub type MostRecentContext = ::core::primitive::u32; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod current_code_hash { - use super::runtime_types; - pub type CurrentCodeHash = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod past_code_hash { - use super::runtime_types; - pub type PastCodeHash = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - pub type Param0 = ( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - ); - } - pub mod past_code_meta { - use super::runtime_types; - pub type PastCodeMeta = - runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - ::core::primitive::u32, - >; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod past_code_pruning { - use super::runtime_types; - pub type PastCodePruning = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; - } - pub mod future_code_upgrades { - use super::runtime_types; - pub type FutureCodeUpgrades = ::core::primitive::u32; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod future_code_upgrades_at { - use super::runtime_types; - pub type FutureCodeUpgradesAt = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; - } - pub mod future_code_hash { - use super::runtime_types; - pub type FutureCodeHash = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod authorized_code_hash { - use super::runtime_types; - pub type AuthorizedCodeHash = runtime_types :: polkadot_runtime_parachains :: paras :: AuthorizedCodeHashAndExpiry < :: core :: primitive :: u32 > ; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod upgrade_go_ahead_signal { - use super::runtime_types; - pub type UpgradeGoAheadSignal = - runtime_types::polkadot_primitives::v9::UpgradeGoAhead; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod upgrade_restriction_signal { - use super::runtime_types; - pub type UpgradeRestrictionSignal = - runtime_types::polkadot_primitives::v9::UpgradeRestriction; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod upgrade_cooldowns { - use super::runtime_types; - pub type UpgradeCooldowns = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; - } - pub mod upcoming_upgrades { - use super::runtime_types; - pub type UpcomingUpgrades = ::subxt::ext::subxt_core::alloc::vec::Vec<( - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u32, - )>; - } - pub mod actions_queue { - use super::runtime_types; - pub type ActionsQueue = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod upcoming_paras_genesis { - use super::runtime_types; - pub type UpcomingParasGenesis = - runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod code_by_hash_refs { - use super::runtime_types; - pub type CodeByHashRefs = ::core::primitive::u32; - pub type Param0 = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - } - pub mod code_by_hash { - use super::runtime_types; - pub type CodeByHash = - runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; - pub type Param0 = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " All currently active PVF pre-checking votes."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - There are no PVF pre-checking votes that exists in list but not in the set and vice versa."] - pub fn pvf_active_vote_map_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pvf_active_vote_map::PvfActiveVoteMap, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "PvfActiveVoteMap", - (), - [ - 180u8, 73u8, 103u8, 207u8, 245u8, 111u8, 142u8, 8u8, 159u8, 143u8, - 245u8, 212u8, 149u8, 78u8, 213u8, 224u8, 206u8, 8u8, 95u8, 40u8, 24u8, - 72u8, 123u8, 41u8, 198u8, 190u8, 9u8, 33u8, 247u8, 205u8, 60u8, 199u8, - ], - ) - } #[doc = " All currently active PVF pre-checking votes."] #[doc = ""] #[doc = " Invariant:"] #[doc = " - There are no PVF pre-checking votes that exists in list but not in the set and vice versa."] pub fn pvf_active_vote_map( &self, - _0: types::pvf_active_vote_map::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pvf_active_vote_map::Param0, - >, - types::pvf_active_vote_map::PvfActiveVoteMap, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (pvf_active_vote_map::Param0,), + pvf_active_vote_map::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "PvfActiveVoteMap", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 180u8, 73u8, 103u8, 207u8, 245u8, 111u8, 142u8, 8u8, 159u8, 143u8, - 245u8, 212u8, 149u8, 78u8, 213u8, 224u8, 206u8, 8u8, 95u8, 40u8, 24u8, - 72u8, 123u8, 41u8, 198u8, 190u8, 9u8, 33u8, 247u8, 205u8, 60u8, 199u8, + 206u8, 12u8, 195u8, 156u8, 193u8, 47u8, 230u8, 154u8, 142u8, 204u8, + 221u8, 136u8, 1u8, 160u8, 15u8, 142u8, 138u8, 187u8, 112u8, 23u8, + 194u8, 4u8, 183u8, 206u8, 250u8, 154u8, 111u8, 189u8, 35u8, 200u8, + 251u8, 44u8, ], ) } @@ -38386,19 +34424,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::pvf_active_vote_list::PvfActiveVoteList, + pvf_active_vote_list::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "PvfActiveVoteList", - (), [ - 172u8, 215u8, 137u8, 191u8, 52u8, 104u8, 106u8, 118u8, 134u8, 82u8, - 137u8, 6u8, 175u8, 158u8, 58u8, 230u8, 231u8, 152u8, 195u8, 17u8, 51u8, - 133u8, 10u8, 205u8, 212u8, 6u8, 24u8, 59u8, 114u8, 222u8, 96u8, 42u8, + 237u8, 164u8, 220u8, 41u8, 123u8, 184u8, 75u8, 78u8, 231u8, 202u8, + 128u8, 219u8, 149u8, 139u8, 113u8, 167u8, 57u8, 7u8, 76u8, 51u8, 222u8, + 49u8, 160u8, 224u8, 138u8, 104u8, 100u8, 159u8, 56u8, 207u8, 52u8, + 130u8, ], ) } @@ -38410,232 +34446,93 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::parachains::Parachains, + parachains::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "Parachains", - (), - [ - 242u8, 228u8, 175u8, 107u8, 242u8, 39u8, 52u8, 181u8, 32u8, 171u8, - 21u8, 169u8, 204u8, 19u8, 21u8, 217u8, 121u8, 239u8, 218u8, 252u8, - 80u8, 188u8, 119u8, 157u8, 235u8, 218u8, 221u8, 113u8, 0u8, 108u8, - 245u8, 210u8, - ], - ) - } - #[doc = " The current lifecycle of a all known Para IDs."] - pub fn para_lifecycles_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::para_lifecycles::ParaLifecycles, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "ParaLifecycles", - (), [ - 2u8, 203u8, 32u8, 194u8, 76u8, 227u8, 250u8, 9u8, 168u8, 201u8, 171u8, - 180u8, 18u8, 169u8, 206u8, 183u8, 48u8, 189u8, 204u8, 192u8, 237u8, - 233u8, 156u8, 255u8, 102u8, 22u8, 101u8, 110u8, 194u8, 55u8, 118u8, - 81u8, + 250u8, 6u8, 40u8, 73u8, 242u8, 62u8, 214u8, 58u8, 170u8, 213u8, 21u8, + 195u8, 217u8, 220u8, 243u8, 157u8, 103u8, 172u8, 106u8, 179u8, 50u8, + 176u8, 199u8, 235u8, 210u8, 116u8, 102u8, 135u8, 151u8, 194u8, 237u8, + 9u8, ], ) } #[doc = " The current lifecycle of a all known Para IDs."] pub fn para_lifecycles( &self, - _0: types::para_lifecycles::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::para_lifecycles::Param0, - >, - types::para_lifecycles::ParaLifecycles, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (para_lifecycles::Param0,), + para_lifecycles::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "ParaLifecycles", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 2u8, 203u8, 32u8, 194u8, 76u8, 227u8, 250u8, 9u8, 168u8, 201u8, 171u8, - 180u8, 18u8, 169u8, 206u8, 183u8, 48u8, 189u8, 204u8, 192u8, 237u8, - 233u8, 156u8, 255u8, 102u8, 22u8, 101u8, 110u8, 194u8, 55u8, 118u8, - 81u8, - ], - ) - } - #[doc = " The head-data of every registered para."] - pub fn heads_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::heads::Heads, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "Heads", - (), [ - 222u8, 116u8, 180u8, 190u8, 172u8, 192u8, 174u8, 132u8, 225u8, 180u8, - 119u8, 90u8, 5u8, 39u8, 92u8, 230u8, 116u8, 202u8, 92u8, 99u8, 135u8, - 201u8, 10u8, 58u8, 55u8, 211u8, 209u8, 86u8, 93u8, 133u8, 99u8, 139u8, + 125u8, 190u8, 80u8, 32u8, 58u8, 252u8, 12u8, 59u8, 136u8, 47u8, 58u8, + 217u8, 29u8, 155u8, 133u8, 23u8, 180u8, 241u8, 142u8, 74u8, 32u8, + 191u8, 98u8, 153u8, 47u8, 200u8, 177u8, 32u8, 27u8, 192u8, 32u8, 49u8, ], ) } #[doc = " The head-data of every registered para."] pub fn heads( &self, - _0: types::heads::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::heads::Param0, - >, - types::heads::Heads, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (heads::Param0,), + heads::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "Heads", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 222u8, 116u8, 180u8, 190u8, 172u8, 192u8, 174u8, 132u8, 225u8, 180u8, - 119u8, 90u8, 5u8, 39u8, 92u8, 230u8, 116u8, 202u8, 92u8, 99u8, 135u8, - 201u8, 10u8, 58u8, 55u8, 211u8, 209u8, 86u8, 93u8, 133u8, 99u8, 139u8, - ], - ) - } - #[doc = " The context (relay-chain block number) of the most recent parachain head."] - pub fn most_recent_context_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::most_recent_context::MostRecentContext, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "MostRecentContext", - (), - [ - 196u8, 150u8, 125u8, 121u8, 196u8, 182u8, 2u8, 5u8, 244u8, 170u8, 75u8, - 57u8, 162u8, 8u8, 104u8, 94u8, 114u8, 32u8, 192u8, 236u8, 120u8, 91u8, - 84u8, 118u8, 216u8, 143u8, 61u8, 208u8, 57u8, 180u8, 216u8, 243u8, + 244u8, 89u8, 123u8, 225u8, 111u8, 53u8, 196u8, 215u8, 192u8, 140u8, + 144u8, 93u8, 142u8, 226u8, 135u8, 252u8, 32u8, 16u8, 23u8, 17u8, 255u8, + 110u8, 15u8, 7u8, 192u8, 56u8, 120u8, 203u8, 132u8, 146u8, 181u8, + 253u8, ], ) } #[doc = " The context (relay-chain block number) of the most recent parachain head."] pub fn most_recent_context( - &self, - _0: types::most_recent_context::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::most_recent_context::Param0, - >, - types::most_recent_context::MostRecentContext, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "MostRecentContext", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 196u8, 150u8, 125u8, 121u8, 196u8, 182u8, 2u8, 5u8, 244u8, 170u8, 75u8, - 57u8, 162u8, 8u8, 104u8, 94u8, 114u8, 32u8, 192u8, 236u8, 120u8, 91u8, - 84u8, 118u8, 216u8, 143u8, 61u8, 208u8, 57u8, 180u8, 216u8, 243u8, - ], - ) - } - #[doc = " The validation code hash of every live para."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub fn current_code_hash_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::current_code_hash::CurrentCodeHash, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "CurrentCodeHash", - (), - [ - 251u8, 100u8, 30u8, 46u8, 191u8, 60u8, 45u8, 221u8, 218u8, 20u8, 154u8, - 233u8, 211u8, 198u8, 151u8, 195u8, 99u8, 210u8, 126u8, 165u8, 240u8, - 129u8, 183u8, 252u8, 104u8, 119u8, 38u8, 155u8, 150u8, 198u8, 127u8, - 103u8, - ], - ) - } - #[doc = " The validation code hash of every live para."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub fn current_code_hash( - &self, - _0: types::current_code_hash::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::current_code_hash::Param0, - >, - types::current_code_hash::CurrentCodeHash, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (most_recent_context::Param0,), + most_recent_context::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", - "CurrentCodeHash", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "MostRecentContext", [ - 251u8, 100u8, 30u8, 46u8, 191u8, 60u8, 45u8, 221u8, 218u8, 20u8, 154u8, - 233u8, 211u8, 198u8, 151u8, 195u8, 99u8, 210u8, 126u8, 165u8, 240u8, - 129u8, 183u8, 252u8, 104u8, 119u8, 38u8, 155u8, 150u8, 198u8, 127u8, - 103u8, + 172u8, 139u8, 105u8, 83u8, 14u8, 222u8, 173u8, 98u8, 64u8, 87u8, 242u8, + 159u8, 64u8, 12u8, 240u8, 52u8, 238u8, 88u8, 53u8, 155u8, 107u8, 52u8, + 164u8, 29u8, 94u8, 20u8, 193u8, 179u8, 255u8, 236u8, 11u8, 7u8, ], ) } - #[doc = " Actual past code hash, indicated by the para id as well as the block number at which it"] - #[doc = " became outdated."] + #[doc = " The validation code hash of every live para."] #[doc = ""] #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub fn past_code_hash_iter( + pub fn current_code_hash( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::past_code_hash::PastCodeHash, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + (current_code_hash::Param0,), + current_code_hash::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", - "PastCodeHash", - (), + "CurrentCodeHash", [ - 73u8, 209u8, 188u8, 36u8, 127u8, 42u8, 171u8, 136u8, 29u8, 126u8, - 220u8, 209u8, 230u8, 22u8, 12u8, 63u8, 8u8, 102u8, 45u8, 158u8, 178u8, - 232u8, 8u8, 6u8, 71u8, 188u8, 140u8, 41u8, 10u8, 215u8, 22u8, 153u8, + 157u8, 182u8, 111u8, 127u8, 52u8, 207u8, 239u8, 7u8, 183u8, 105u8, + 46u8, 28u8, 74u8, 197u8, 111u8, 62u8, 158u8, 226u8, 99u8, 84u8, 150u8, + 25u8, 152u8, 186u8, 15u8, 196u8, 213u8, 120u8, 244u8, 170u8, 8u8, + 198u8, ], ) } @@ -38645,47 +34542,18 @@ pub mod api { #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn past_code_hash( &self, - _0: types::past_code_hash::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::past_code_hash::Param0, - >, - types::past_code_hash::PastCodeHash, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (past_code_hash::Param0,), + past_code_hash::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "PastCodeHash", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 73u8, 209u8, 188u8, 36u8, 127u8, 42u8, 171u8, 136u8, 29u8, 126u8, - 220u8, 209u8, 230u8, 22u8, 12u8, 63u8, 8u8, 102u8, 45u8, 158u8, 178u8, - 232u8, 8u8, 6u8, 71u8, 188u8, 140u8, 41u8, 10u8, 215u8, 22u8, 153u8, - ], - ) - } - #[doc = " Past code of parachains. The parachains themselves may not be registered anymore,"] - #[doc = " but we also keep their code on-chain for the same amount of time as outdated code"] - #[doc = " to keep it available for approval checkers."] - pub fn past_code_meta_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::past_code_meta::PastCodeMeta, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "PastCodeMeta", - (), [ - 233u8, 47u8, 137u8, 174u8, 98u8, 64u8, 11u8, 75u8, 93u8, 222u8, 78u8, - 58u8, 66u8, 245u8, 151u8, 39u8, 144u8, 36u8, 84u8, 176u8, 239u8, 183u8, - 197u8, 176u8, 158u8, 139u8, 121u8, 189u8, 29u8, 244u8, 229u8, 73u8, + 210u8, 74u8, 255u8, 112u8, 254u8, 14u8, 42u8, 29u8, 136u8, 57u8, 163u8, + 23u8, 17u8, 66u8, 212u8, 205u8, 185u8, 57u8, 42u8, 227u8, 85u8, 134u8, + 33u8, 210u8, 118u8, 131u8, 139u8, 121u8, 33u8, 175u8, 126u8, 58u8, ], ) } @@ -38694,24 +34562,19 @@ pub mod api { #[doc = " to keep it available for approval checkers."] pub fn past_code_meta( &self, - _0: types::past_code_meta::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::past_code_meta::Param0, - >, - types::past_code_meta::PastCodeMeta, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (past_code_meta::Param0,), + past_code_meta::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "PastCodeMeta", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 233u8, 47u8, 137u8, 174u8, 98u8, 64u8, 11u8, 75u8, 93u8, 222u8, 78u8, - 58u8, 66u8, 245u8, 151u8, 39u8, 144u8, 36u8, 84u8, 176u8, 239u8, 183u8, - 197u8, 176u8, 158u8, 139u8, 121u8, 189u8, 29u8, 244u8, 229u8, 73u8, + 229u8, 110u8, 157u8, 46u8, 52u8, 78u8, 115u8, 233u8, 216u8, 222u8, + 147u8, 186u8, 106u8, 208u8, 219u8, 157u8, 183u8, 106u8, 36u8, 230u8, + 246u8, 208u8, 192u8, 202u8, 235u8, 109u8, 103u8, 246u8, 9u8, 237u8, + 206u8, 178u8, ], ) } @@ -38725,43 +34588,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::past_code_pruning::PastCodePruning, - ::subxt::ext::subxt_core::utils::Yes, + past_code_pruning::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "PastCodePruning", - (), - [ - 67u8, 190u8, 51u8, 133u8, 173u8, 24u8, 151u8, 111u8, 108u8, 152u8, - 106u8, 18u8, 29u8, 80u8, 104u8, 120u8, 91u8, 138u8, 209u8, 49u8, 255u8, - 211u8, 53u8, 195u8, 61u8, 188u8, 183u8, 53u8, 37u8, 230u8, 53u8, 183u8, - ], - ) - } - #[doc = " The block number at which the planned code change is expected for a parachain."] - #[doc = ""] - #[doc = " The change will be applied after the first parablock for this ID included which executes"] - #[doc = " in the context of a relay chain block with a number >= `expected_at`."] - pub fn future_code_upgrades_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::future_code_upgrades::FutureCodeUpgrades, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "FutureCodeUpgrades", - (), [ - 163u8, 168u8, 23u8, 138u8, 198u8, 70u8, 135u8, 221u8, 167u8, 187u8, - 15u8, 144u8, 228u8, 8u8, 138u8, 125u8, 101u8, 154u8, 11u8, 74u8, 173u8, - 167u8, 17u8, 97u8, 240u8, 6u8, 20u8, 161u8, 25u8, 111u8, 242u8, 9u8, + 211u8, 224u8, 199u8, 122u8, 215u8, 242u8, 76u8, 172u8, 64u8, 222u8, + 251u8, 86u8, 114u8, 212u8, 242u8, 180u8, 173u8, 254u8, 68u8, 175u8, + 94u8, 197u8, 160u8, 146u8, 0u8, 201u8, 4u8, 157u8, 188u8, 220u8, 13u8, + 209u8, ], ) } @@ -38771,24 +34608,18 @@ pub mod api { #[doc = " in the context of a relay chain block with a number >= `expected_at`."] pub fn future_code_upgrades( &self, - _0: types::future_code_upgrades::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::future_code_upgrades::Param0, - >, - types::future_code_upgrades::FutureCodeUpgrades, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (future_code_upgrades::Param0,), + future_code_upgrades::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "FutureCodeUpgrades", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 163u8, 168u8, 23u8, 138u8, 198u8, 70u8, 135u8, 221u8, 167u8, 187u8, - 15u8, 144u8, 228u8, 8u8, 138u8, 125u8, 101u8, 154u8, 11u8, 74u8, 173u8, - 167u8, 17u8, 97u8, 240u8, 6u8, 20u8, 161u8, 25u8, 111u8, 242u8, 9u8, + 46u8, 187u8, 69u8, 189u8, 0u8, 122u8, 145u8, 20u8, 166u8, 166u8, 236u8, + 82u8, 65u8, 36u8, 117u8, 245u8, 92u8, 178u8, 187u8, 119u8, 165u8, 78u8, + 66u8, 183u8, 19u8, 176u8, 222u8, 245u8, 50u8, 196u8, 29u8, 32u8, ], ) } @@ -38804,43 +34635,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::future_code_upgrades_at::FutureCodeUpgradesAt, + future_code_upgrades_at::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "FutureCodeUpgradesAt", - (), - [ - 106u8, 115u8, 201u8, 132u8, 198u8, 78u8, 236u8, 157u8, 246u8, 176u8, - 236u8, 158u8, 90u8, 166u8, 25u8, 230u8, 30u8, 149u8, 163u8, 15u8, - 108u8, 145u8, 167u8, 118u8, 74u8, 211u8, 96u8, 173u8, 56u8, 11u8, - 181u8, 146u8, - ], - ) - } - #[doc = " The actual future code hash of a para."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub fn future_code_hash_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::future_code_hash::FutureCodeHash, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "FutureCodeHash", - (), [ - 62u8, 238u8, 183u8, 12u8, 197u8, 119u8, 163u8, 239u8, 192u8, 228u8, - 110u8, 58u8, 128u8, 223u8, 32u8, 137u8, 109u8, 127u8, 41u8, 83u8, 91u8, - 98u8, 156u8, 118u8, 96u8, 147u8, 16u8, 31u8, 5u8, 92u8, 227u8, 230u8, + 244u8, 5u8, 125u8, 236u8, 147u8, 41u8, 26u8, 205u8, 251u8, 210u8, 54u8, + 147u8, 54u8, 238u8, 153u8, 27u8, 221u8, 85u8, 125u8, 55u8, 45u8, 108u8, + 31u8, 121u8, 158u8, 117u8, 229u8, 32u8, 86u8, 115u8, 81u8, 135u8, ], ) } @@ -38849,102 +34653,37 @@ pub mod api { #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] pub fn future_code_hash( &self, - _0: types::future_code_hash::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::future_code_hash::Param0, - >, - types::future_code_hash::FutureCodeHash, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (future_code_hash::Param0,), + future_code_hash::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "FutureCodeHash", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 62u8, 238u8, 183u8, 12u8, 197u8, 119u8, 163u8, 239u8, 192u8, 228u8, - 110u8, 58u8, 128u8, 223u8, 32u8, 137u8, 109u8, 127u8, 41u8, 83u8, 91u8, - 98u8, 156u8, 118u8, 96u8, 147u8, 16u8, 31u8, 5u8, 92u8, 227u8, 230u8, - ], - ) - } - #[doc = " The code hash authorizations for a para which will expire `expire_at` `BlockNumberFor`."] - pub fn authorized_code_hash_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::authorized_code_hash::AuthorizedCodeHash, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "AuthorizedCodeHash", - (), [ - 40u8, 172u8, 86u8, 193u8, 229u8, 230u8, 29u8, 63u8, 188u8, 154u8, - 240u8, 236u8, 117u8, 218u8, 221u8, 102u8, 154u8, 246u8, 136u8, 153u8, - 225u8, 171u8, 156u8, 219u8, 91u8, 2u8, 69u8, 34u8, 119u8, 119u8, 206u8, - 145u8, + 1u8, 155u8, 248u8, 4u8, 36u8, 101u8, 28u8, 214u8, 20u8, 33u8, 225u8, + 122u8, 215u8, 225u8, 43u8, 185u8, 107u8, 249u8, 26u8, 42u8, 196u8, + 105u8, 165u8, 77u8, 98u8, 190u8, 231u8, 71u8, 51u8, 131u8, 226u8, 16u8, ], ) } #[doc = " The code hash authorizations for a para which will expire `expire_at` `BlockNumberFor`."] pub fn authorized_code_hash( &self, - _0: types::authorized_code_hash::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::authorized_code_hash::Param0, - >, - types::authorized_code_hash::AuthorizedCodeHash, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (authorized_code_hash::Param0,), + authorized_code_hash::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "AuthorizedCodeHash", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 40u8, 172u8, 86u8, 193u8, 229u8, 230u8, 29u8, 63u8, 188u8, 154u8, - 240u8, 236u8, 117u8, 218u8, 221u8, 102u8, 154u8, 246u8, 136u8, 153u8, - 225u8, 171u8, 156u8, 219u8, 91u8, 2u8, 69u8, 34u8, 119u8, 119u8, 206u8, - 145u8, - ], - ) - } - #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade"] - #[doc = " procedure."] - #[doc = ""] - #[doc = " This value is absent when there are no upgrades scheduled or during the time the relay chain"] - #[doc = " performs the checks. It is set at the first relay-chain block when the corresponding"] - #[doc = " parachain can switch its upgrade function. As soon as the parachain's block is included, the"] - #[doc = " value gets reset to `None`."] - #[doc = ""] - #[doc = " NOTE that this field is used by parachains via merkle storage proofs, therefore changing"] - #[doc = " the format will require migration of parachains."] - pub fn upgrade_go_ahead_signal_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::upgrade_go_ahead_signal::UpgradeGoAheadSignal, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "UpgradeGoAheadSignal", - (), [ - 41u8, 80u8, 120u8, 6u8, 98u8, 85u8, 36u8, 37u8, 170u8, 189u8, 56u8, - 127u8, 155u8, 180u8, 112u8, 195u8, 135u8, 214u8, 235u8, 87u8, 197u8, - 247u8, 125u8, 26u8, 232u8, 82u8, 250u8, 90u8, 126u8, 106u8, 62u8, - 217u8, + 127u8, 26u8, 54u8, 80u8, 177u8, 19u8, 125u8, 114u8, 254u8, 154u8, + 232u8, 10u8, 33u8, 245u8, 0u8, 121u8, 155u8, 181u8, 99u8, 155u8, 75u8, + 117u8, 18u8, 113u8, 129u8, 127u8, 5u8, 242u8, 49u8, 213u8, 195u8, + 148u8, ], ) } @@ -38960,55 +34699,19 @@ pub mod api { #[doc = " the format will require migration of parachains."] pub fn upgrade_go_ahead_signal( &self, - _0: types::upgrade_go_ahead_signal::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::upgrade_go_ahead_signal::Param0, - >, - types::upgrade_go_ahead_signal::UpgradeGoAheadSignal, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (upgrade_go_ahead_signal::Param0,), + upgrade_go_ahead_signal::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "UpgradeGoAheadSignal", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 41u8, 80u8, 120u8, 6u8, 98u8, 85u8, 36u8, 37u8, 170u8, 189u8, 56u8, - 127u8, 155u8, 180u8, 112u8, 195u8, 135u8, 214u8, 235u8, 87u8, 197u8, - 247u8, 125u8, 26u8, 232u8, 82u8, 250u8, 90u8, 126u8, 106u8, 62u8, - 217u8, - ], - ) - } - #[doc = " This is used by the relay-chain to communicate that there are restrictions for performing"] - #[doc = " an upgrade for this parachain."] - #[doc = ""] - #[doc = " This may be a because the parachain waits for the upgrade cooldown to expire. Another"] - #[doc = " potential use case is when we want to perform some maintenance (such as storage migration)"] - #[doc = " we could restrict upgrades to make the process simpler."] - #[doc = ""] - #[doc = " NOTE that this field is used by parachains via merkle storage proofs, therefore changing"] - #[doc = " the format will require migration of parachains."] - pub fn upgrade_restriction_signal_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::upgrade_restriction_signal::UpgradeRestrictionSignal, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "UpgradeRestrictionSignal", - (), [ - 158u8, 105u8, 62u8, 252u8, 149u8, 145u8, 34u8, 92u8, 119u8, 204u8, - 46u8, 96u8, 117u8, 183u8, 134u8, 20u8, 172u8, 243u8, 145u8, 113u8, - 74u8, 119u8, 96u8, 107u8, 129u8, 109u8, 96u8, 143u8, 77u8, 14u8, 56u8, - 117u8, + 76u8, 39u8, 58u8, 45u8, 101u8, 9u8, 157u8, 196u8, 76u8, 56u8, 56u8, + 212u8, 245u8, 125u8, 86u8, 161u8, 172u8, 43u8, 59u8, 15u8, 171u8, + 173u8, 186u8, 192u8, 25u8, 151u8, 38u8, 151u8, 247u8, 13u8, 82u8, + 111u8, ], ) } @@ -39023,25 +34726,19 @@ pub mod api { #[doc = " the format will require migration of parachains."] pub fn upgrade_restriction_signal( &self, - _0: types::upgrade_restriction_signal::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::upgrade_restriction_signal::Param0, - >, - types::upgrade_restriction_signal::UpgradeRestrictionSignal, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (upgrade_restriction_signal::Param0,), + upgrade_restriction_signal::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "UpgradeRestrictionSignal", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 158u8, 105u8, 62u8, 252u8, 149u8, 145u8, 34u8, 92u8, 119u8, 204u8, - 46u8, 96u8, 117u8, 183u8, 134u8, 20u8, 172u8, 243u8, 145u8, 113u8, - 74u8, 119u8, 96u8, 107u8, 129u8, 109u8, 96u8, 143u8, 77u8, 14u8, 56u8, - 117u8, + 81u8, 0u8, 175u8, 189u8, 167u8, 136u8, 20u8, 161u8, 184u8, 106u8, + 236u8, 58u8, 72u8, 140u8, 8u8, 42u8, 213u8, 182u8, 44u8, 88u8, 203u8, + 180u8, 104u8, 69u8, 225u8, 210u8, 165u8, 75u8, 217u8, 194u8, 185u8, + 145u8, ], ) } @@ -39052,20 +34749,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::upgrade_cooldowns::UpgradeCooldowns, - ::subxt::ext::subxt_core::utils::Yes, + upgrade_cooldowns::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "UpgradeCooldowns", - (), [ - 180u8, 197u8, 115u8, 209u8, 126u8, 120u8, 133u8, 54u8, 232u8, 192u8, - 47u8, 17u8, 21u8, 8u8, 231u8, 67u8, 1u8, 89u8, 127u8, 38u8, 179u8, - 190u8, 169u8, 110u8, 20u8, 92u8, 139u8, 227u8, 26u8, 59u8, 245u8, - 174u8, + 37u8, 15u8, 74u8, 92u8, 136u8, 156u8, 190u8, 125u8, 83u8, 89u8, 198u8, + 140u8, 26u8, 22u8, 230u8, 224u8, 112u8, 241u8, 92u8, 7u8, 122u8, 109u8, + 29u8, 92u8, 172u8, 206u8, 27u8, 144u8, 57u8, 249u8, 180u8, 76u8, ], ) } @@ -39079,89 +34772,35 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::upcoming_upgrades::UpcomingUpgrades, + upcoming_upgrades::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "UpcomingUpgrades", - (), - [ - 38u8, 195u8, 15u8, 56u8, 225u8, 199u8, 105u8, 84u8, 128u8, 51u8, 44u8, - 248u8, 237u8, 32u8, 36u8, 72u8, 77u8, 137u8, 124u8, 88u8, 242u8, 185u8, - 50u8, 148u8, 216u8, 156u8, 209u8, 101u8, 207u8, 127u8, 66u8, 95u8, - ], - ) - } - #[doc = " The actions to perform during the start of a specific session index."] - pub fn actions_queue_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::actions_queue::ActionsQueue, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "ActionsQueue", - (), [ - 13u8, 25u8, 129u8, 203u8, 95u8, 206u8, 254u8, 240u8, 170u8, 209u8, - 55u8, 117u8, 70u8, 220u8, 139u8, 102u8, 9u8, 229u8, 139u8, 120u8, 67u8, - 246u8, 214u8, 59u8, 81u8, 116u8, 54u8, 67u8, 129u8, 32u8, 67u8, 92u8, + 78u8, 19u8, 9u8, 146u8, 221u8, 172u8, 122u8, 151u8, 31u8, 241u8, 10u8, + 117u8, 44u8, 47u8, 203u8, 158u8, 160u8, 224u8, 247u8, 41u8, 212u8, + 214u8, 240u8, 216u8, 136u8, 3u8, 85u8, 230u8, 91u8, 10u8, 10u8, 75u8, ], ) } #[doc = " The actions to perform during the start of a specific session index."] pub fn actions_queue( &self, - _0: types::actions_queue::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::actions_queue::Param0, - >, - types::actions_queue::ActionsQueue, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (actions_queue::Param0,), + actions_queue::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "ActionsQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 13u8, 25u8, 129u8, 203u8, 95u8, 206u8, 254u8, 240u8, 170u8, 209u8, - 55u8, 117u8, 70u8, 220u8, 139u8, 102u8, 9u8, 229u8, 139u8, 120u8, 67u8, - 246u8, 214u8, 59u8, 81u8, 116u8, 54u8, 67u8, 129u8, 32u8, 67u8, 92u8, - ], - ) - } - #[doc = " Upcoming paras instantiation arguments."] - #[doc = ""] - #[doc = " NOTE that after PVF pre-checking is enabled the para genesis arg will have it's code set"] - #[doc = " to empty. Instead, the code will be saved into the storage right away via `CodeByHash`."] - pub fn upcoming_paras_genesis_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::upcoming_paras_genesis::UpcomingParasGenesis, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "UpcomingParasGenesis", - (), [ - 215u8, 121u8, 106u8, 13u8, 102u8, 47u8, 129u8, 221u8, 153u8, 91u8, - 23u8, 94u8, 11u8, 39u8, 19u8, 180u8, 136u8, 136u8, 254u8, 152u8, 250u8, - 150u8, 40u8, 87u8, 135u8, 121u8, 219u8, 151u8, 111u8, 35u8, 43u8, - 195u8, + 201u8, 161u8, 154u8, 181u8, 164u8, 69u8, 185u8, 92u8, 219u8, 182u8, + 165u8, 144u8, 52u8, 243u8, 25u8, 73u8, 79u8, 245u8, 181u8, 9u8, 129u8, + 109u8, 49u8, 131u8, 19u8, 167u8, 105u8, 141u8, 127u8, 189u8, 171u8, + 33u8, ], ) } @@ -39171,96 +34810,38 @@ pub mod api { #[doc = " to empty. Instead, the code will be saved into the storage right away via `CodeByHash`."] pub fn upcoming_paras_genesis( &self, - _0: types::upcoming_paras_genesis::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::upcoming_paras_genesis::Param0, - >, - types::upcoming_paras_genesis::UpcomingParasGenesis, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (upcoming_paras_genesis::Param0,), + upcoming_paras_genesis::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "UpcomingParasGenesis", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 215u8, 121u8, 106u8, 13u8, 102u8, 47u8, 129u8, 221u8, 153u8, 91u8, - 23u8, 94u8, 11u8, 39u8, 19u8, 180u8, 136u8, 136u8, 254u8, 152u8, 250u8, - 150u8, 40u8, 87u8, 135u8, 121u8, 219u8, 151u8, 111u8, 35u8, 43u8, - 195u8, - ], - ) - } - #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] - pub fn code_by_hash_refs_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::code_by_hash_refs::CodeByHashRefs, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "CodeByHashRefs", - (), [ - 47u8, 50u8, 103u8, 161u8, 130u8, 252u8, 157u8, 35u8, 174u8, 37u8, - 102u8, 60u8, 195u8, 30u8, 164u8, 203u8, 67u8, 129u8, 107u8, 181u8, - 166u8, 205u8, 230u8, 91u8, 36u8, 187u8, 253u8, 150u8, 39u8, 168u8, - 223u8, 16u8, + 93u8, 116u8, 248u8, 25u8, 126u8, 84u8, 56u8, 70u8, 86u8, 154u8, 20u8, + 197u8, 174u8, 193u8, 72u8, 13u8, 212u8, 224u8, 227u8, 109u8, 181u8, + 117u8, 168u8, 159u8, 99u8, 5u8, 177u8, 107u8, 172u8, 113u8, 101u8, + 97u8, ], ) } #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] pub fn code_by_hash_refs( &self, - _0: types::code_by_hash_refs::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::code_by_hash_refs::Param0, - >, - types::code_by_hash_refs::CodeByHashRefs, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (code_by_hash_refs::Param0,), + code_by_hash_refs::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "CodeByHashRefs", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 47u8, 50u8, 103u8, 161u8, 130u8, 252u8, 157u8, 35u8, 174u8, 37u8, - 102u8, 60u8, 195u8, 30u8, 164u8, 203u8, 67u8, 129u8, 107u8, 181u8, - 166u8, 205u8, 230u8, 91u8, 36u8, 187u8, 253u8, 150u8, 39u8, 168u8, - 223u8, 16u8, - ], - ) - } - #[doc = " Validation code stored by its hash."] - #[doc = ""] - #[doc = " This storage is consistent with [`FutureCodeHash`], [`CurrentCodeHash`] and"] - #[doc = " [`PastCodeHash`]."] - pub fn code_by_hash_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::code_by_hash::CodeByHash, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Paras", - "CodeByHash", - (), [ - 155u8, 102u8, 73u8, 180u8, 127u8, 211u8, 181u8, 44u8, 56u8, 235u8, - 49u8, 4u8, 25u8, 213u8, 116u8, 200u8, 232u8, 203u8, 190u8, 90u8, 93u8, - 6u8, 57u8, 227u8, 240u8, 92u8, 157u8, 129u8, 3u8, 148u8, 45u8, 143u8, + 134u8, 194u8, 80u8, 24u8, 155u8, 96u8, 12u8, 222u8, 115u8, 231u8, + 186u8, 72u8, 220u8, 156u8, 170u8, 207u8, 119u8, 33u8, 251u8, 129u8, + 187u8, 134u8, 241u8, 102u8, 149u8, 125u8, 201u8, 17u8, 236u8, 125u8, + 188u8, 72u8, ], ) } @@ -39270,28 +34851,247 @@ pub mod api { #[doc = " [`PastCodeHash`]."] pub fn code_by_hash( &self, - _0: types::code_by_hash::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::code_by_hash::Param0, - >, - types::code_by_hash::CodeByHash, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (code_by_hash::Param0,), + code_by_hash::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Paras", "CodeByHash", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 155u8, 102u8, 73u8, 180u8, 127u8, 211u8, 181u8, 44u8, 56u8, 235u8, - 49u8, 4u8, 25u8, 213u8, 116u8, 200u8, 232u8, 203u8, 190u8, 90u8, 93u8, - 6u8, 57u8, 227u8, 240u8, 92u8, 157u8, 129u8, 3u8, 148u8, 45u8, 143u8, + 19u8, 234u8, 198u8, 181u8, 75u8, 98u8, 136u8, 105u8, 191u8, 148u8, + 148u8, 230u8, 143u8, 6u8, 37u8, 107u8, 22u8, 73u8, 207u8, 9u8, 43u8, + 242u8, 96u8, 150u8, 203u8, 221u8, 177u8, 58u8, 107u8, 246u8, 187u8, + 109u8, ], ) } } + pub mod pvf_active_vote_map { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::PvfCheckActiveVoteState< + ::core::primitive::u32, + >; + } + } + pub mod pvf_active_vote_list { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash > ; + } + } + pub mod parachains { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; + } + } + pub mod para_lifecycles { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; + } + } + pub mod heads { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::HeadData; + } + } + pub mod most_recent_context { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod current_code_hash { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; + } + } + pub mod past_code_hash { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + ); + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; + } + } + pub mod past_code_meta { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< + ::core::primitive::u32, + >; + } + } + pub mod past_code_pruning { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; + } + } + pub mod future_code_upgrades { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod future_code_upgrades_at { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; + } + } + pub mod future_code_hash { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_parachain_primitives :: primitives :: ValidationCodeHash ; + } + } + pub mod authorized_code_hash { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_parachains :: paras :: AuthorizedCodeHashAndExpiry < :: core :: primitive :: u32 > ; + } + } + pub mod upgrade_go_ahead_signal { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_primitives::v9::UpgradeGoAhead; + } + } + pub mod upgrade_restriction_signal { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_primitives::v9::UpgradeRestriction; + } + } + pub mod upgrade_cooldowns { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; + } + } + pub mod upcoming_upgrades { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u32, + )>; + } + } + pub mod actions_queue { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; + } + } + pub mod upcoming_paras_genesis { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; + } + } + pub mod code_by_hash_refs { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod code_by_hash { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCodeHash; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode; + } + } } pub mod constants { use super::runtime_types; @@ -39378,18 +35178,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod has_initialized { - use super::runtime_types; - pub type HasInitialized = (); - } - pub mod buffered_session_changes { - use super::runtime_types; - pub type BufferedSessionChanges = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Whether the parachains modules have been initialized within this block."] @@ -39404,19 +35194,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::has_initialized::HasInitialized, + has_initialized::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Initializer", "HasInitialized", - (), [ - 156u8, 208u8, 212u8, 86u8, 105u8, 148u8, 252u8, 11u8, 140u8, 67u8, - 231u8, 86u8, 1u8, 147u8, 178u8, 79u8, 27u8, 249u8, 137u8, 103u8, 178u8, - 50u8, 114u8, 157u8, 239u8, 86u8, 89u8, 233u8, 86u8, 58u8, 37u8, 67u8, + 202u8, 94u8, 13u8, 198u8, 50u8, 152u8, 189u8, 151u8, 144u8, 78u8, + 249u8, 7u8, 65u8, 217u8, 11u8, 2u8, 147u8, 113u8, 82u8, 119u8, 31u8, + 13u8, 219u8, 105u8, 96u8, 40u8, 236u8, 130u8, 134u8, 246u8, 192u8, + 184u8, ], ) } @@ -39431,127 +35219,62 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::buffered_session_changes::BufferedSessionChanges, + buffered_session_changes::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Initializer", "BufferedSessionChanges", - (), [ - 52u8, 253u8, 99u8, 88u8, 47u8, 128u8, 246u8, 183u8, 252u8, 144u8, - 187u8, 140u8, 169u8, 21u8, 167u8, 72u8, 246u8, 217u8, 140u8, 234u8, - 222u8, 57u8, 254u8, 33u8, 237u8, 212u8, 136u8, 204u8, 79u8, 185u8, - 83u8, 36u8, + 250u8, 78u8, 252u8, 25u8, 190u8, 167u8, 226u8, 1u8, 51u8, 105u8, 57u8, + 217u8, 103u8, 66u8, 168u8, 138u8, 149u8, 83u8, 228u8, 230u8, 120u8, + 121u8, 60u8, 18u8, 89u8, 219u8, 43u8, 66u8, 149u8, 168u8, 42u8, 145u8, ], ) } } + pub mod has_initialized { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = (); + } + } + pub mod buffered_session_changes { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt :: ext :: subxt_core :: alloc :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; + } + } } } pub mod dmp { use super::root_mod; use super::runtime_types; pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod downward_message_queues { - use super::runtime_types; - pub type DownwardMessageQueues = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod downward_message_queue_heads { - use super::runtime_types; - pub type DownwardMessageQueueHeads = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod delivery_fee_factor { - use super::runtime_types; - pub type DeliveryFeeFactor = - runtime_types::sp_arithmetic::fixed_point::FixedU128; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The downward messages addressed for a certain para."] - pub fn downward_message_queues_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::downward_message_queues::DownwardMessageQueues, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Dmp", - "DownwardMessageQueues", - (), - [ - 38u8, 183u8, 133u8, 200u8, 199u8, 135u8, 68u8, 232u8, 189u8, 168u8, - 3u8, 219u8, 201u8, 180u8, 156u8, 79u8, 134u8, 164u8, 94u8, 114u8, - 102u8, 25u8, 108u8, 53u8, 219u8, 155u8, 102u8, 100u8, 58u8, 28u8, - 246u8, 20u8, - ], - ) - } #[doc = " The downward messages addressed for a certain para."] pub fn downward_message_queues( &self, - _0: types::downward_message_queues::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::downward_message_queues::Param0, - >, - types::downward_message_queues::DownwardMessageQueues, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (downward_message_queues::Param0,), + downward_message_queues::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Dmp", "DownwardMessageQueues", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 38u8, 183u8, 133u8, 200u8, 199u8, 135u8, 68u8, 232u8, 189u8, 168u8, - 3u8, 219u8, 201u8, 180u8, 156u8, 79u8, 134u8, 164u8, 94u8, 114u8, - 102u8, 25u8, 108u8, 53u8, 219u8, 155u8, 102u8, 100u8, 58u8, 28u8, - 246u8, 20u8, - ], - ) - } - #[doc = " A mapping that stores the downward message queue MQC head for each para."] - #[doc = ""] - #[doc = " Each link in this chain has a form:"] - #[doc = " `(prev_head, B, H(M))`, where"] - #[doc = " - `prev_head`: is the previous head hash or zero if none."] - #[doc = " - `B`: is the relay-chain block number in which a message was appended."] - #[doc = " - `H(M)`: is the hash of the message being appended."] - pub fn downward_message_queue_heads_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::downward_message_queue_heads::DownwardMessageQueueHeads, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Dmp", - "DownwardMessageQueueHeads", - (), [ - 135u8, 165u8, 240u8, 0u8, 25u8, 110u8, 9u8, 108u8, 251u8, 225u8, 109u8, - 184u8, 90u8, 132u8, 9u8, 151u8, 12u8, 118u8, 153u8, 212u8, 140u8, - 205u8, 94u8, 98u8, 110u8, 167u8, 155u8, 43u8, 61u8, 35u8, 52u8, 56u8, + 6u8, 23u8, 193u8, 150u8, 211u8, 237u8, 200u8, 96u8, 200u8, 220u8, 17u8, + 179u8, 172u8, 205u8, 195u8, 131u8, 126u8, 134u8, 109u8, 53u8, 53u8, + 174u8, 92u8, 223u8, 242u8, 234u8, 148u8, 139u8, 92u8, 157u8, 11u8, + 175u8, ], ) } @@ -39564,73 +35287,71 @@ pub mod api { #[doc = " - `H(M)`: is the hash of the message being appended."] pub fn downward_message_queue_heads( &self, - _0: types::downward_message_queue_heads::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::downward_message_queue_heads::Param0, - >, - types::downward_message_queue_heads::DownwardMessageQueueHeads, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (downward_message_queue_heads::Param0,), + downward_message_queue_heads::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Dmp", "DownwardMessageQueueHeads", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 135u8, 165u8, 240u8, 0u8, 25u8, 110u8, 9u8, 108u8, 251u8, 225u8, 109u8, - 184u8, 90u8, 132u8, 9u8, 151u8, 12u8, 118u8, 153u8, 212u8, 140u8, - 205u8, 94u8, 98u8, 110u8, 167u8, 155u8, 43u8, 61u8, 35u8, 52u8, 56u8, - ], - ) - } - #[doc = " The factor to multiply the base delivery fee by."] - pub fn delivery_fee_factor_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::delivery_fee_factor::DeliveryFeeFactor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Dmp", - "DeliveryFeeFactor", - (), [ - 43u8, 5u8, 63u8, 235u8, 115u8, 155u8, 130u8, 27u8, 75u8, 216u8, 177u8, - 135u8, 203u8, 147u8, 167u8, 95u8, 208u8, 188u8, 25u8, 14u8, 84u8, 63u8, - 116u8, 41u8, 148u8, 110u8, 115u8, 215u8, 196u8, 36u8, 75u8, 102u8, + 151u8, 81u8, 18u8, 66u8, 126u8, 191u8, 157u8, 215u8, 74u8, 90u8, 230u8, + 127u8, 141u8, 170u8, 109u8, 93u8, 134u8, 8u8, 100u8, 155u8, 185u8, 7u8, + 52u8, 58u8, 209u8, 236u8, 66u8, 111u8, 90u8, 209u8, 201u8, 232u8, ], ) } #[doc = " The factor to multiply the base delivery fee by."] pub fn delivery_fee_factor( &self, - _0: types::delivery_fee_factor::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::delivery_fee_factor::Param0, - >, - types::delivery_fee_factor::DeliveryFeeFactor, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (delivery_fee_factor::Param0,), + delivery_fee_factor::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Dmp", "DeliveryFeeFactor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 43u8, 5u8, 63u8, 235u8, 115u8, 155u8, 130u8, 27u8, 75u8, 216u8, 177u8, - 135u8, 203u8, 147u8, 167u8, 95u8, 208u8, 188u8, 25u8, 14u8, 84u8, 63u8, - 116u8, 41u8, 148u8, 110u8, 115u8, 215u8, 196u8, 36u8, 75u8, 102u8, + 170u8, 112u8, 11u8, 84u8, 65u8, 133u8, 51u8, 139u8, 235u8, 170u8, 91u8, + 57u8, 201u8, 77u8, 207u8, 5u8, 147u8, 200u8, 189u8, 137u8, 155u8, 15u8, + 33u8, 192u8, 55u8, 142u8, 151u8, 97u8, 243u8, 200u8, 48u8, 96u8, ], ) } } + pub mod downward_message_queues { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::InboundDownwardMessage< + ::core::primitive::u32, + >, + >; + } + } + pub mod downward_message_queue_heads { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } + pub mod delivery_fee_factor { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_arithmetic::fixed_point::FixedU128; + } + } } } pub mod hrmp { @@ -40468,122 +36189,10 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod hrmp_open_channel_requests { - use super::runtime_types; - pub type HrmpOpenChannelRequests = - runtime_types::polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - } - pub mod hrmp_open_channel_requests_list { - use super::runtime_types; - pub type HrmpOpenChannelRequestsList = - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, - >; - } - pub mod hrmp_open_channel_request_count { - use super::runtime_types; - pub type HrmpOpenChannelRequestCount = ::core::primitive::u32; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod hrmp_accepted_channel_request_count { - use super::runtime_types; - pub type HrmpAcceptedChannelRequestCount = ::core::primitive::u32; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod hrmp_close_channel_requests { - use super::runtime_types; - pub type HrmpCloseChannelRequests = (); - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - } - pub mod hrmp_close_channel_requests_list { - use super::runtime_types; - pub type HrmpCloseChannelRequestsList = - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, - >; - } - pub mod hrmp_watermarks { - use super::runtime_types; - pub type HrmpWatermarks = ::core::primitive::u32; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod hrmp_channels { - use super::runtime_types; - pub type HrmpChannels = - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - } - pub mod hrmp_ingress_channels_index { - use super::runtime_types; - pub type HrmpIngressChannelsIndex = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod hrmp_egress_channels_index { - use super::runtime_types; - pub type HrmpEgressChannelsIndex = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod hrmp_channel_contents { - use super::runtime_types; - pub type HrmpChannelContents = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, - >, - >; - pub type Param0 = - runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; - } - pub mod hrmp_channel_digests { - use super::runtime_types; - pub type HrmpChannelDigests = ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >, - )>; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The set of pending HRMP open channel requests."] - #[doc = ""] - #[doc = " The set is accompanied by a list for iteration."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub fn hrmp_open_channel_requests_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_open_channel_requests::HrmpOpenChannelRequests, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpOpenChannelRequests", - (), - [ - 164u8, 97u8, 52u8, 242u8, 255u8, 67u8, 248u8, 170u8, 204u8, 92u8, 81u8, - 144u8, 11u8, 63u8, 145u8, 167u8, 8u8, 174u8, 221u8, 147u8, 125u8, - 144u8, 243u8, 33u8, 235u8, 104u8, 240u8, 99u8, 96u8, 211u8, 163u8, - 121u8, - ], - ) - } #[doc = " The set of pending HRMP open channel requests."] #[doc = ""] #[doc = " The set is accompanied by a list for iteration."] @@ -40592,25 +36201,18 @@ pub mod api { #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_open_channel_requests( &self, - _0: types::hrmp_open_channel_requests::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_open_channel_requests::Param0, - >, - types::hrmp_open_channel_requests::HrmpOpenChannelRequests, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (hrmp_open_channel_requests::Param0,), + hrmp_open_channel_requests::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpOpenChannelRequests", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 164u8, 97u8, 52u8, 242u8, 255u8, 67u8, 248u8, 170u8, 204u8, 92u8, 81u8, - 144u8, 11u8, 63u8, 145u8, 167u8, 8u8, 174u8, 221u8, 147u8, 125u8, - 144u8, 243u8, 33u8, 235u8, 104u8, 240u8, 99u8, 96u8, 211u8, 163u8, - 121u8, + 85u8, 186u8, 207u8, 125u8, 241u8, 65u8, 224u8, 88u8, 16u8, 174u8, 93u8, + 12u8, 135u8, 140u8, 241u8, 55u8, 31u8, 103u8, 79u8, 63u8, 239u8, 49u8, + 143u8, 210u8, 20u8, 65u8, 8u8, 178u8, 13u8, 108u8, 128u8, 52u8, ], ) } @@ -40618,44 +36220,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::hrmp_open_channel_requests_list::HrmpOpenChannelRequestsList, - ::subxt::ext::subxt_core::utils::Yes, + hrmp_open_channel_requests_list::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpOpenChannelRequestsList", - (), - [ - 45u8, 190u8, 124u8, 26u8, 37u8, 249u8, 140u8, 254u8, 101u8, 249u8, - 27u8, 117u8, 218u8, 3u8, 126u8, 114u8, 143u8, 65u8, 122u8, 246u8, - 237u8, 173u8, 145u8, 175u8, 133u8, 119u8, 127u8, 81u8, 59u8, 206u8, - 159u8, 39u8, - ], - ) - } - #[doc = " This mapping tracks how many open channel requests are initiated by a given sender para."] - #[doc = " Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has"] - #[doc = " `(X, _)` as the number of `HrmpOpenChannelRequestCount` for `X`."] - pub fn hrmp_open_channel_request_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_open_channel_request_count::HrmpOpenChannelRequestCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpOpenChannelRequestCount", - (), [ - 136u8, 72u8, 56u8, 31u8, 229u8, 99u8, 241u8, 14u8, 159u8, 243u8, 179u8, - 222u8, 252u8, 56u8, 63u8, 24u8, 204u8, 130u8, 47u8, 161u8, 133u8, - 227u8, 237u8, 146u8, 239u8, 46u8, 127u8, 113u8, 190u8, 230u8, 61u8, - 182u8, + 238u8, 142u8, 190u8, 87u8, 50u8, 251u8, 79u8, 215u8, 177u8, 156u8, 2u8, + 56u8, 250u8, 41u8, 228u8, 32u8, 10u8, 164u8, 137u8, 190u8, 30u8, 30u8, + 195u8, 130u8, 60u8, 90u8, 104u8, 97u8, 218u8, 35u8, 161u8, 57u8, ], ) } @@ -40664,49 +36238,19 @@ pub mod api { #[doc = " `(X, _)` as the number of `HrmpOpenChannelRequestCount` for `X`."] pub fn hrmp_open_channel_request_count( &self, - _0: types::hrmp_open_channel_request_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_open_channel_request_count::Param0, - >, - types::hrmp_open_channel_request_count::HrmpOpenChannelRequestCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (hrmp_open_channel_request_count::Param0,), + hrmp_open_channel_request_count::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpOpenChannelRequestCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 136u8, 72u8, 56u8, 31u8, 229u8, 99u8, 241u8, 14u8, 159u8, 243u8, 179u8, - 222u8, 252u8, 56u8, 63u8, 24u8, 204u8, 130u8, 47u8, 161u8, 133u8, - 227u8, 237u8, 146u8, 239u8, 46u8, 127u8, 113u8, 190u8, 230u8, 61u8, - 182u8, - ], - ) - } - #[doc = " This mapping tracks how many open channel requests were accepted by a given recipient para."] - #[doc = " Invariant: `HrmpOpenChannelRequests` should contain the same number of items `(_, X)` with"] - #[doc = " `confirmed` set to true, as the number of `HrmpAcceptedChannelRequestCount` for `X`."] - pub fn hrmp_accepted_channel_request_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_accepted_channel_request_count::HrmpAcceptedChannelRequestCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpAcceptedChannelRequestCount", - (), [ - 29u8, 100u8, 52u8, 28u8, 180u8, 84u8, 132u8, 120u8, 117u8, 172u8, - 169u8, 40u8, 237u8, 92u8, 89u8, 87u8, 230u8, 148u8, 140u8, 226u8, 60u8, - 169u8, 100u8, 162u8, 139u8, 205u8, 180u8, 92u8, 0u8, 110u8, 55u8, - 158u8, + 137u8, 100u8, 123u8, 103u8, 180u8, 7u8, 138u8, 110u8, 21u8, 197u8, + 106u8, 226u8, 133u8, 225u8, 49u8, 174u8, 120u8, 74u8, 187u8, 37u8, + 32u8, 190u8, 28u8, 135u8, 193u8, 211u8, 104u8, 28u8, 231u8, 4u8, 156u8, + 189u8, ], ) } @@ -40715,53 +36259,19 @@ pub mod api { #[doc = " `confirmed` set to true, as the number of `HrmpAcceptedChannelRequestCount` for `X`."] pub fn hrmp_accepted_channel_request_count( &self, - _0: types::hrmp_accepted_channel_request_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_accepted_channel_request_count::Param0, - >, - types::hrmp_accepted_channel_request_count::HrmpAcceptedChannelRequestCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (hrmp_accepted_channel_request_count::Param0,), + hrmp_accepted_channel_request_count::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpAcceptedChannelRequestCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 29u8, 100u8, 52u8, 28u8, 180u8, 84u8, 132u8, 120u8, 117u8, 172u8, - 169u8, 40u8, 237u8, 92u8, 89u8, 87u8, 230u8, 148u8, 140u8, 226u8, 60u8, - 169u8, 100u8, 162u8, 139u8, 205u8, 180u8, 92u8, 0u8, 110u8, 55u8, - 158u8, - ], - ) - } - #[doc = " A set of pending HRMP close channel requests that are going to be closed during the session"] - #[doc = " change. Used for checking if a given channel is registered for closure."] - #[doc = ""] - #[doc = " The set is accompanied by a list for iteration."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - There are no channels that exists in list but not in the set and vice versa."] - pub fn hrmp_close_channel_requests_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_close_channel_requests::HrmpCloseChannelRequests, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpCloseChannelRequests", - (), - [ - 155u8, 13u8, 73u8, 166u8, 58u8, 67u8, 138u8, 58u8, 215u8, 172u8, 241u8, - 168u8, 57u8, 4u8, 230u8, 248u8, 31u8, 183u8, 227u8, 224u8, 139u8, - 172u8, 229u8, 228u8, 16u8, 120u8, 124u8, 81u8, 213u8, 253u8, 102u8, - 226u8, + 254u8, 18u8, 35u8, 40u8, 196u8, 94u8, 7u8, 191u8, 195u8, 150u8, 145u8, + 243u8, 106u8, 234u8, 158u8, 209u8, 31u8, 69u8, 28u8, 101u8, 218u8, + 48u8, 91u8, 128u8, 132u8, 144u8, 113u8, 172u8, 183u8, 187u8, 99u8, + 249u8, ], ) } @@ -40774,25 +36284,18 @@ pub mod api { #[doc = " - There are no channels that exists in list but not in the set and vice versa."] pub fn hrmp_close_channel_requests( &self, - _0: types::hrmp_close_channel_requests::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_close_channel_requests::Param0, - >, - types::hrmp_close_channel_requests::HrmpCloseChannelRequests, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (hrmp_close_channel_requests::Param0,), + hrmp_close_channel_requests::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpCloseChannelRequests", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 155u8, 13u8, 73u8, 166u8, 58u8, 67u8, 138u8, 58u8, 215u8, 172u8, 241u8, - 168u8, 57u8, 4u8, 230u8, 248u8, 31u8, 183u8, 227u8, 224u8, 139u8, - 172u8, 229u8, 228u8, 16u8, 120u8, 124u8, 81u8, 213u8, 253u8, 102u8, - 226u8, + 6u8, 51u8, 108u8, 250u8, 215u8, 71u8, 28u8, 81u8, 95u8, 90u8, 60u8, + 65u8, 53u8, 226u8, 151u8, 161u8, 24u8, 181u8, 153u8, 49u8, 238u8, + 138u8, 6u8, 20u8, 108u8, 17u8, 36u8, 248u8, 76u8, 139u8, 20u8, 107u8, ], ) } @@ -40800,43 +36303,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::hrmp_close_channel_requests_list::HrmpCloseChannelRequestsList, - ::subxt::ext::subxt_core::utils::Yes, + hrmp_close_channel_requests_list::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpCloseChannelRequestsList", - (), [ - 78u8, 194u8, 214u8, 232u8, 91u8, 72u8, 109u8, 113u8, 88u8, 86u8, 136u8, - 26u8, 226u8, 30u8, 11u8, 188u8, 57u8, 77u8, 169u8, 64u8, 14u8, 187u8, - 27u8, 127u8, 76u8, 99u8, 114u8, 73u8, 221u8, 23u8, 208u8, 69u8, - ], - ) - } - #[doc = " The HRMP watermark associated with each para."] - #[doc = " Invariant:"] - #[doc = " - each para `P` used here as a key should satisfy `Paras::is_valid_para(P)` within a"] - #[doc = " session."] - pub fn hrmp_watermarks_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_watermarks::HrmpWatermarks, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpWatermarks", - (), - [ - 245u8, 104u8, 137u8, 120u8, 131u8, 7u8, 178u8, 85u8, 96u8, 124u8, - 241u8, 2u8, 86u8, 63u8, 116u8, 77u8, 217u8, 235u8, 162u8, 38u8, 104u8, - 248u8, 121u8, 1u8, 111u8, 191u8, 191u8, 115u8, 65u8, 67u8, 2u8, 238u8, + 87u8, 45u8, 181u8, 136u8, 53u8, 219u8, 121u8, 252u8, 182u8, 214u8, + 84u8, 72u8, 164u8, 211u8, 175u8, 83u8, 244u8, 65u8, 128u8, 154u8, + 146u8, 32u8, 0u8, 57u8, 21u8, 194u8, 226u8, 195u8, 89u8, 36u8, 230u8, + 27u8, ], ) } @@ -40846,48 +36323,18 @@ pub mod api { #[doc = " session."] pub fn hrmp_watermarks( &self, - _0: types::hrmp_watermarks::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_watermarks::Param0, - >, - types::hrmp_watermarks::HrmpWatermarks, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (hrmp_watermarks::Param0,), + hrmp_watermarks::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpWatermarks", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 245u8, 104u8, 137u8, 120u8, 131u8, 7u8, 178u8, 85u8, 96u8, 124u8, - 241u8, 2u8, 86u8, 63u8, 116u8, 77u8, 217u8, 235u8, 162u8, 38u8, 104u8, - 248u8, 121u8, 1u8, 111u8, 191u8, 191u8, 115u8, 65u8, 67u8, 2u8, 238u8, - ], - ) - } - #[doc = " HRMP channel data associated with each para."] - #[doc = " Invariant:"] - #[doc = " - each participant in the channel should satisfy `Paras::is_valid_para(P)` within a session."] - pub fn hrmp_channels_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_channels::HrmpChannels, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpChannels", - (), [ - 174u8, 90u8, 72u8, 93u8, 43u8, 140u8, 181u8, 170u8, 138u8, 171u8, - 179u8, 156u8, 33u8, 87u8, 63u8, 1u8, 131u8, 59u8, 230u8, 14u8, 40u8, - 240u8, 186u8, 66u8, 191u8, 130u8, 48u8, 218u8, 225u8, 22u8, 33u8, - 122u8, + 129u8, 219u8, 127u8, 30u8, 33u8, 1u8, 229u8, 60u8, 220u8, 151u8, 89u8, + 135u8, 195u8, 194u8, 91u8, 68u8, 248u8, 229u8, 11u8, 59u8, 102u8, 73u8, + 196u8, 5u8, 14u8, 246u8, 107u8, 254u8, 143u8, 147u8, 233u8, 128u8, ], ) } @@ -40896,59 +36343,18 @@ pub mod api { #[doc = " - each participant in the channel should satisfy `Paras::is_valid_para(P)` within a session."] pub fn hrmp_channels( &self, - _0: types::hrmp_channels::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_channels::Param0, - >, - types::hrmp_channels::HrmpChannels, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (hrmp_channels::Param0,), + hrmp_channels::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpChannels", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 174u8, 90u8, 72u8, 93u8, 43u8, 140u8, 181u8, 170u8, 138u8, 171u8, - 179u8, 156u8, 33u8, 87u8, 63u8, 1u8, 131u8, 59u8, 230u8, 14u8, 40u8, - 240u8, 186u8, 66u8, 191u8, 130u8, 48u8, 218u8, 225u8, 22u8, 33u8, - 122u8, - ], - ) - } - #[doc = " Ingress/egress indexes allow to find all the senders and receivers given the opposite side."] - #[doc = " I.e."] - #[doc = ""] - #[doc = " (a) ingress index allows to find all the senders for a given recipient."] - #[doc = " (b) egress index allows to find all the recipients for a given sender."] - #[doc = ""] - #[doc = " Invariants:"] - #[doc = " - for each ingress index entry for `P` each item `I` in the index should present in"] - #[doc = " `HrmpChannels` as `(I, P)`."] - #[doc = " - for each egress index entry for `P` each item `E` in the index should present in"] - #[doc = " `HrmpChannels` as `(P, E)`."] - #[doc = " - there should be no other dangling channels in `HrmpChannels`."] - #[doc = " - the vectors are sorted."] - pub fn hrmp_ingress_channels_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_ingress_channels_index::HrmpIngressChannelsIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpIngressChannelsIndex", - (), - [ - 125u8, 229u8, 102u8, 230u8, 74u8, 109u8, 173u8, 67u8, 176u8, 169u8, - 57u8, 24u8, 75u8, 129u8, 246u8, 198u8, 63u8, 49u8, 56u8, 102u8, 149u8, - 139u8, 138u8, 207u8, 150u8, 220u8, 29u8, 208u8, 203u8, 0u8, 93u8, - 105u8, + 146u8, 55u8, 47u8, 76u8, 62u8, 17u8, 250u8, 215u8, 162u8, 249u8, 26u8, + 53u8, 108u8, 32u8, 235u8, 44u8, 14u8, 146u8, 136u8, 58u8, 75u8, 99u8, + 161u8, 48u8, 102u8, 119u8, 62u8, 130u8, 186u8, 56u8, 2u8, 64u8, ], ) } @@ -40967,91 +36373,37 @@ pub mod api { #[doc = " - the vectors are sorted."] pub fn hrmp_ingress_channels_index( &self, - _0: types::hrmp_ingress_channels_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_ingress_channels_index::Param0, - >, - types::hrmp_ingress_channels_index::HrmpIngressChannelsIndex, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (hrmp_ingress_channels_index::Param0,), + hrmp_ingress_channels_index::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpIngressChannelsIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 125u8, 229u8, 102u8, 230u8, 74u8, 109u8, 173u8, 67u8, 176u8, 169u8, - 57u8, 24u8, 75u8, 129u8, 246u8, 198u8, 63u8, 49u8, 56u8, 102u8, 149u8, - 139u8, 138u8, 207u8, 150u8, 220u8, 29u8, 208u8, 203u8, 0u8, 93u8, - 105u8, - ], - ) - } - pub fn hrmp_egress_channels_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_egress_channels_index::HrmpEgressChannelsIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpEgressChannelsIndex", - (), [ - 237u8, 183u8, 188u8, 57u8, 20u8, 238u8, 166u8, 7u8, 94u8, 155u8, 22u8, - 9u8, 173u8, 209u8, 210u8, 17u8, 160u8, 79u8, 243u8, 4u8, 245u8, 240u8, - 65u8, 195u8, 116u8, 98u8, 206u8, 104u8, 53u8, 64u8, 241u8, 41u8, + 58u8, 5u8, 190u8, 140u8, 230u8, 166u8, 196u8, 22u8, 151u8, 190u8, + 175u8, 121u8, 170u8, 107u8, 95u8, 180u8, 43u8, 57u8, 249u8, 68u8, 6u8, + 161u8, 18u8, 202u8, 54u8, 124u8, 205u8, 227u8, 212u8, 79u8, 145u8, + 40u8, ], ) } pub fn hrmp_egress_channels_index( &self, - _0: types::hrmp_egress_channels_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_egress_channels_index::Param0, - >, - types::hrmp_egress_channels_index::HrmpEgressChannelsIndex, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (hrmp_egress_channels_index::Param0,), + hrmp_egress_channels_index::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpEgressChannelsIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 237u8, 183u8, 188u8, 57u8, 20u8, 238u8, 166u8, 7u8, 94u8, 155u8, 22u8, - 9u8, 173u8, 209u8, 210u8, 17u8, 160u8, 79u8, 243u8, 4u8, 245u8, 240u8, - 65u8, 195u8, 116u8, 98u8, 206u8, 104u8, 53u8, 64u8, 241u8, 41u8, - ], - ) - } - #[doc = " Storage for the messages for each channel."] - #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] - pub fn hrmp_channel_contents_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_channel_contents::HrmpChannelContents, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpChannelContents", - (), - [ - 55u8, 16u8, 135u8, 69u8, 54u8, 180u8, 246u8, 124u8, 104u8, 92u8, 45u8, - 18u8, 223u8, 145u8, 43u8, 190u8, 121u8, 59u8, 35u8, 195u8, 234u8, - 219u8, 30u8, 246u8, 168u8, 187u8, 45u8, 171u8, 254u8, 204u8, 60u8, - 121u8, + 192u8, 165u8, 104u8, 245u8, 224u8, 163u8, 93u8, 179u8, 34u8, 96u8, + 80u8, 105u8, 44u8, 127u8, 208u8, 62u8, 190u8, 47u8, 240u8, 163u8, 90u8, + 49u8, 247u8, 201u8, 105u8, 168u8, 235u8, 45u8, 194u8, 228u8, 222u8, + 85u8, ], ) } @@ -41059,51 +36411,18 @@ pub mod api { #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] pub fn hrmp_channel_contents( &self, - _0: types::hrmp_channel_contents::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_channel_contents::Param0, - >, - types::hrmp_channel_contents::HrmpChannelContents, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (hrmp_channel_contents::Param0,), + hrmp_channel_contents::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpChannelContents", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 55u8, 16u8, 135u8, 69u8, 54u8, 180u8, 246u8, 124u8, 104u8, 92u8, 45u8, - 18u8, 223u8, 145u8, 43u8, 190u8, 121u8, 59u8, 35u8, 195u8, 234u8, - 219u8, 30u8, 246u8, 168u8, 187u8, 45u8, 171u8, 254u8, 204u8, 60u8, - 121u8, - ], - ) - } - #[doc = " Maintains a mapping that can be used to answer the question: What paras sent a message at"] - #[doc = " the given block number for a given receiver. Invariants:"] - #[doc = " - The inner `Vec` is never empty."] - #[doc = " - The inner `Vec` cannot store two same `ParaId`."] - #[doc = " - The outer vector is sorted ascending by block number and cannot store two items with the"] - #[doc = " same block number."] - pub fn hrmp_channel_digests_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::hrmp_channel_digests::HrmpChannelDigests, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Hrmp", - "HrmpChannelDigests", - (), [ - 90u8, 90u8, 139u8, 78u8, 47u8, 2u8, 104u8, 211u8, 42u8, 246u8, 193u8, - 210u8, 142u8, 223u8, 17u8, 136u8, 3u8, 182u8, 25u8, 56u8, 72u8, 72u8, - 162u8, 131u8, 36u8, 34u8, 162u8, 176u8, 159u8, 113u8, 7u8, 207u8, + 59u8, 25u8, 149u8, 52u8, 37u8, 244u8, 221u8, 56u8, 118u8, 195u8, 38u8, + 41u8, 132u8, 164u8, 102u8, 215u8, 83u8, 120u8, 186u8, 198u8, 147u8, + 90u8, 70u8, 244u8, 88u8, 49u8, 41u8, 110u8, 87u8, 175u8, 13u8, 46u8, ], ) } @@ -41115,66 +36434,158 @@ pub mod api { #[doc = " same block number."] pub fn hrmp_channel_digests( &self, - _0: types::hrmp_channel_digests::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::hrmp_channel_digests::Param0, - >, - types::hrmp_channel_digests::HrmpChannelDigests, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (hrmp_channel_digests::Param0,), + hrmp_channel_digests::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Hrmp", "HrmpChannelDigests", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 90u8, 90u8, 139u8, 78u8, 47u8, 2u8, 104u8, 211u8, 42u8, 246u8, 193u8, - 210u8, 142u8, 223u8, 17u8, 136u8, 3u8, 182u8, 25u8, 56u8, 72u8, 72u8, - 162u8, 131u8, 36u8, 34u8, 162u8, 176u8, 159u8, 113u8, 7u8, 207u8, + 54u8, 119u8, 217u8, 144u8, 1u8, 201u8, 29u8, 27u8, 7u8, 238u8, 206u8, + 25u8, 209u8, 197u8, 42u8, 215u8, 103u8, 252u8, 172u8, 195u8, 52u8, + 255u8, 25u8, 115u8, 116u8, 7u8, 87u8, 143u8, 217u8, 71u8, 192u8, 210u8, ], ) } } - } - } - pub mod para_session_info { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub mod types { + pub mod hrmp_open_channel_requests { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest; + } + } + pub mod hrmp_open_channel_requests_list { + use super::root_mod; use super::runtime_types; - pub mod assignment_keys_unsafe { + pub mod output { use super::runtime_types; - pub type AssignmentKeysUnsafe = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::assignment_app::Public, + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, >; } - pub mod earliest_stored_session { + } + pub mod hrmp_open_channel_request_count { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod hrmp_accepted_channel_request_count { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { use super::runtime_types; - pub type EarliestStoredSession = ::core::primitive::u32; + pub type Output = ::core::primitive::u32; } - pub mod sessions { + } + pub mod hrmp_close_channel_requests { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; + pub mod output { use super::runtime_types; - pub type Sessions = runtime_types::polkadot_primitives::v9::SessionInfo; - pub type Param0 = ::core::primitive::u32; + pub type Output = (); } - pub mod account_keys { + } + pub mod hrmp_close_channel_requests_list { + use super::root_mod; + use super::runtime_types; + pub mod output { use super::runtime_types; - pub type AccountKeys = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId, >; - pub type Param0 = ::core::primitive::u32; } - pub mod session_executor_params { + } + pub mod hrmp_watermarks { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { use super::runtime_types; - pub type SessionExecutorParams = - runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams; - pub type Param0 = ::core::primitive::u32; + pub type Output = ::core::primitive::u32; + } + } + pub mod hrmp_channels { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; } } + pub mod hrmp_ingress_channels_index { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; + } + } + pub mod hrmp_egress_channels_index { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; + } + } + pub mod hrmp_channel_contents { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_parachain_primitives::primitives::HrmpChannelId; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::primitive::u32, + >, + >; + } + } + pub mod hrmp_channel_digests { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >, + )>; + } + } + } + } + pub mod para_session_info { + use super::root_mod; + use super::runtime_types; + pub mod storage { + use super::root_mod; + use super::runtime_types; pub struct StorageApi; impl StorageApi { #[doc = " Assignment keys for the current session."] @@ -41184,20 +36595,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::assignment_keys_unsafe::AssignmentKeysUnsafe, + assignment_keys_unsafe::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaSessionInfo", "AssignmentKeysUnsafe", - (), [ - 180u8, 187u8, 151u8, 97u8, 28u8, 143u8, 44u8, 107u8, 127u8, 16u8, 82u8, - 208u8, 210u8, 99u8, 211u8, 54u8, 252u8, 164u8, 138u8, 142u8, 124u8, - 117u8, 217u8, 184u8, 223u8, 65u8, 45u8, 143u8, 220u8, 212u8, 254u8, - 173u8, + 183u8, 68u8, 222u8, 175u8, 231u8, 140u8, 99u8, 32u8, 208u8, 87u8, + 181u8, 83u8, 217u8, 109u8, 51u8, 0u8, 44u8, 43u8, 85u8, 187u8, 208u8, + 173u8, 155u8, 118u8, 24u8, 186u8, 121u8, 233u8, 62u8, 130u8, 243u8, + 189u8, ], ) } @@ -41206,43 +36614,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::earliest_stored_session::EarliestStoredSession, + earliest_stored_session::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaSessionInfo", "EarliestStoredSession", - (), - [ - 139u8, 176u8, 46u8, 139u8, 217u8, 35u8, 62u8, 91u8, 183u8, 7u8, 114u8, - 226u8, 60u8, 237u8, 105u8, 73u8, 20u8, 216u8, 194u8, 205u8, 178u8, - 237u8, 84u8, 66u8, 181u8, 29u8, 31u8, 218u8, 48u8, 60u8, 198u8, 86u8, - ], - ) - } - #[doc = " Session information in a rolling window."] - #[doc = " Should have an entry in range `EarliestStoredSession..=CurrentSessionIndex`."] - #[doc = " Does not have any entries before the session index in the first session change notification."] - pub fn sessions_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::sessions::Sessions, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParaSessionInfo", - "Sessions", - (), [ - 234u8, 87u8, 239u8, 243u8, 224u8, 177u8, 208u8, 208u8, 80u8, 111u8, - 190u8, 108u8, 189u8, 81u8, 68u8, 30u8, 108u8, 83u8, 43u8, 150u8, 87u8, - 156u8, 68u8, 231u8, 151u8, 67u8, 26u8, 223u8, 218u8, 137u8, 229u8, - 228u8, + 68u8, 49u8, 202u8, 54u8, 128u8, 237u8, 115u8, 171u8, 186u8, 228u8, + 181u8, 114u8, 147u8, 181u8, 35u8, 200u8, 255u8, 161u8, 232u8, 22u8, + 199u8, 36u8, 105u8, 5u8, 227u8, 74u8, 150u8, 111u8, 140u8, 147u8, + 186u8, 243u8, ], ) } @@ -41251,121 +36633,109 @@ pub mod api { #[doc = " Does not have any entries before the session index in the first session change notification."] pub fn sessions( &self, - _0: types::sessions::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::sessions::Param0, - >, - types::sessions::Sessions, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (sessions::Param0,), + sessions::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaSessionInfo", "Sessions", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 234u8, 87u8, 239u8, 243u8, 224u8, 177u8, 208u8, 208u8, 80u8, 111u8, - 190u8, 108u8, 189u8, 81u8, 68u8, 30u8, 108u8, 83u8, 43u8, 150u8, 87u8, - 156u8, 68u8, 231u8, 151u8, 67u8, 26u8, 223u8, 218u8, 137u8, 229u8, - 228u8, - ], - ) - } - #[doc = " The validator account keys of the validators actively participating in parachain consensus."] - pub fn account_keys_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::account_keys::AccountKeys, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParaSessionInfo", - "AccountKeys", - (), [ - 30u8, 98u8, 58u8, 140u8, 96u8, 231u8, 205u8, 111u8, 194u8, 100u8, - 185u8, 242u8, 210u8, 143u8, 110u8, 144u8, 170u8, 187u8, 62u8, 196u8, - 73u8, 88u8, 118u8, 168u8, 117u8, 116u8, 153u8, 229u8, 108u8, 46u8, - 154u8, 220u8, + 19u8, 118u8, 220u8, 195u8, 72u8, 28u8, 195u8, 58u8, 238u8, 161u8, + 156u8, 213u8, 236u8, 89u8, 97u8, 136u8, 135u8, 192u8, 154u8, 182u8, + 106u8, 71u8, 106u8, 58u8, 150u8, 31u8, 166u8, 171u8, 63u8, 21u8, 119u8, + 56u8, ], ) } #[doc = " The validator account keys of the validators actively participating in parachain consensus."] pub fn account_keys( &self, - _0: types::account_keys::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account_keys::Param0, - >, - types::account_keys::AccountKeys, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (account_keys::Param0,), + account_keys::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaSessionInfo", "AccountKeys", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 30u8, 98u8, 58u8, 140u8, 96u8, 231u8, 205u8, 111u8, 194u8, 100u8, - 185u8, 242u8, 210u8, 143u8, 110u8, 144u8, 170u8, 187u8, 62u8, 196u8, - 73u8, 88u8, 118u8, 168u8, 117u8, 116u8, 153u8, 229u8, 108u8, 46u8, - 154u8, 220u8, - ], - ) - } - #[doc = " Executor parameter set for a given session index"] - pub fn session_executor_params_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::session_executor_params::SessionExecutorParams, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParaSessionInfo", - "SessionExecutorParams", - (), [ - 38u8, 80u8, 118u8, 112u8, 189u8, 55u8, 95u8, 184u8, 19u8, 8u8, 114u8, - 6u8, 173u8, 80u8, 254u8, 98u8, 107u8, 202u8, 215u8, 107u8, 149u8, - 157u8, 145u8, 8u8, 249u8, 255u8, 83u8, 199u8, 47u8, 179u8, 208u8, 83u8, + 119u8, 207u8, 150u8, 210u8, 65u8, 74u8, 154u8, 69u8, 93u8, 222u8, + 176u8, 114u8, 33u8, 63u8, 191u8, 47u8, 193u8, 185u8, 106u8, 104u8, + 90u8, 69u8, 7u8, 85u8, 62u8, 125u8, 247u8, 70u8, 255u8, 21u8, 73u8, + 244u8, ], ) } #[doc = " Executor parameter set for a given session index"] pub fn session_executor_params( &self, - _0: types::session_executor_params::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::session_executor_params::Param0, - >, - types::session_executor_params::SessionExecutorParams, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (session_executor_params::Param0,), + session_executor_params::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParaSessionInfo", "SessionExecutorParams", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 38u8, 80u8, 118u8, 112u8, 189u8, 55u8, 95u8, 184u8, 19u8, 8u8, 114u8, - 6u8, 173u8, 80u8, 254u8, 98u8, 107u8, 202u8, 215u8, 107u8, 149u8, - 157u8, 145u8, 8u8, 249u8, 255u8, 83u8, 199u8, 47u8, 179u8, 208u8, 83u8, + 170u8, 249u8, 250u8, 193u8, 5u8, 220u8, 23u8, 156u8, 110u8, 147u8, + 175u8, 241u8, 162u8, 35u8, 220u8, 215u8, 68u8, 157u8, 236u8, 59u8, + 150u8, 64u8, 221u8, 247u8, 64u8, 121u8, 72u8, 205u8, 32u8, 46u8, 248u8, + 204u8, ], ) } } + pub mod assignment_keys_unsafe { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::assignment_app::Public, + >; + } + } + pub mod earliest_stored_session { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod sessions { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_primitives::v9::SessionInfo; + } + } + pub mod account_keys { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + } + } + pub mod session_executor_params { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_primitives::v9::executor_params::ExecutorParams; + } + } } } pub mod paras_disputes { @@ -41488,40 +36858,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod last_pruned_session { - use super::runtime_types; - pub type LastPrunedSession = ::core::primitive::u32; - } - pub mod disputes { - use super::runtime_types; - pub type Disputes = runtime_types::polkadot_primitives::v9::DisputeState< - ::core::primitive::u32, - >; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - } - pub mod backers_on_disputes { - use super::runtime_types; - pub type BackersOnDisputes = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_primitives::v9::ValidatorIndex, - >; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - } - pub mod included { - use super::runtime_types; - pub type Included = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - } - pub mod frozen { - use super::runtime_types; - pub type Frozen = ::core::option::Option<::core::primitive::u32>; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The last pruned session, if any. All data stored by this module"] @@ -41530,150 +36868,35 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::last_pruned_session::LastPrunedSession, + last_pruned_session::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasDisputes", "LastPrunedSession", - (), - [ - 98u8, 107u8, 200u8, 158u8, 182u8, 120u8, 24u8, 242u8, 24u8, 163u8, - 237u8, 72u8, 153u8, 19u8, 38u8, 85u8, 239u8, 208u8, 194u8, 22u8, 173u8, - 100u8, 219u8, 10u8, 194u8, 42u8, 120u8, 146u8, 225u8, 62u8, 80u8, - 229u8, - ], - ) - } - #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub fn disputes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::disputes::Disputes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasDisputes", - "Disputes", - (), - [ - 38u8, 237u8, 141u8, 222u8, 135u8, 82u8, 210u8, 166u8, 192u8, 122u8, - 175u8, 96u8, 91u8, 1u8, 225u8, 182u8, 128u8, 4u8, 159u8, 56u8, 180u8, - 176u8, 157u8, 20u8, 105u8, 202u8, 192u8, 213u8, 164u8, 24u8, 227u8, - 15u8, - ], - ) - } - #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub fn disputes_iter1( - &self, - _0: types::disputes::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::disputes::Param0, - >, - types::disputes::Disputes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasDisputes", - "Disputes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 38u8, 237u8, 141u8, 222u8, 135u8, 82u8, 210u8, 166u8, 192u8, 122u8, - 175u8, 96u8, 91u8, 1u8, 225u8, 182u8, 128u8, 4u8, 159u8, 56u8, 180u8, - 176u8, 157u8, 20u8, 105u8, 202u8, 192u8, 213u8, 164u8, 24u8, 227u8, - 15u8, + 85u8, 142u8, 58u8, 220u8, 217u8, 161u8, 252u8, 141u8, 77u8, 122u8, + 73u8, 250u8, 94u8, 191u8, 217u8, 153u8, 99u8, 63u8, 210u8, 35u8, 110u8, + 222u8, 34u8, 239u8, 253u8, 58u8, 245u8, 167u8, 110u8, 42u8, 129u8, 8u8, ], ) } #[doc = " All ongoing or concluded disputes for the last several sessions."] pub fn disputes( &self, - _0: types::disputes::Param0, - _1: types::disputes::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::disputes::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::disputes::Param1, - >, - ), - types::disputes::Disputes, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (disputes::Param0, disputes::Param1), + disputes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasDisputes", "Disputes", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 38u8, 237u8, 141u8, 222u8, 135u8, 82u8, 210u8, 166u8, 192u8, 122u8, - 175u8, 96u8, 91u8, 1u8, 225u8, 182u8, 128u8, 4u8, 159u8, 56u8, 180u8, - 176u8, 157u8, 20u8, 105u8, 202u8, 192u8, 213u8, 164u8, 24u8, 227u8, - 15u8, - ], - ) - } - #[doc = " Backing votes stored for each dispute."] - #[doc = " This storage is used for slashing."] - pub fn backers_on_disputes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::backers_on_disputes::BackersOnDisputes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasDisputes", - "BackersOnDisputes", - (), - [ - 136u8, 171u8, 20u8, 204u8, 135u8, 153u8, 144u8, 241u8, 46u8, 193u8, - 65u8, 22u8, 116u8, 161u8, 144u8, 186u8, 31u8, 194u8, 202u8, 225u8, - 14u8, 137u8, 240u8, 243u8, 119u8, 144u8, 102u8, 245u8, 133u8, 126u8, - 103u8, 32u8, - ], - ) - } - #[doc = " Backing votes stored for each dispute."] - #[doc = " This storage is used for slashing."] - pub fn backers_on_disputes_iter1( - &self, - _0: types::backers_on_disputes::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::backers_on_disputes::Param0, - >, - types::backers_on_disputes::BackersOnDisputes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasDisputes", - "BackersOnDisputes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 136u8, 171u8, 20u8, 204u8, 135u8, 153u8, 144u8, 241u8, 46u8, 193u8, - 65u8, 22u8, 116u8, 161u8, 144u8, 186u8, 31u8, 194u8, 202u8, 225u8, - 14u8, 137u8, 240u8, 243u8, 119u8, 144u8, 102u8, 245u8, 133u8, 126u8, - 103u8, 32u8, + 184u8, 232u8, 192u8, 206u8, 214u8, 186u8, 160u8, 178u8, 108u8, 120u8, + 166u8, 115u8, 101u8, 143u8, 108u8, 88u8, 122u8, 203u8, 132u8, 188u8, + 157u8, 162u8, 90u8, 65u8, 23u8, 117u8, 247u8, 187u8, 200u8, 183u8, + 163u8, 251u8, ], ) } @@ -41681,83 +36904,19 @@ pub mod api { #[doc = " This storage is used for slashing."] pub fn backers_on_disputes( &self, - _0: types::backers_on_disputes::Param0, - _1: types::backers_on_disputes::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::backers_on_disputes::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::backers_on_disputes::Param1, - >, - ), - types::backers_on_disputes::BackersOnDisputes, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (backers_on_disputes::Param0, backers_on_disputes::Param1), + backers_on_disputes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasDisputes", "BackersOnDisputes", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 136u8, 171u8, 20u8, 204u8, 135u8, 153u8, 144u8, 241u8, 46u8, 193u8, - 65u8, 22u8, 116u8, 161u8, 144u8, 186u8, 31u8, 194u8, 202u8, 225u8, - 14u8, 137u8, 240u8, 243u8, 119u8, 144u8, 102u8, 245u8, 133u8, 126u8, - 103u8, 32u8, - ], - ) - } - #[doc = " All included blocks on the chain, as well as the block number in this chain that"] - #[doc = " should be reverted back to if the candidate is disputed and determined to be invalid."] - pub fn included_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::included::Included, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasDisputes", - "Included", - (), - [ - 47u8, 105u8, 189u8, 233u8, 206u8, 153u8, 162u8, 217u8, 141u8, 118u8, - 31u8, 85u8, 87u8, 53u8, 100u8, 187u8, 31u8, 245u8, 50u8, 171u8, 4u8, - 203u8, 163u8, 109u8, 212u8, 162u8, 86u8, 124u8, 172u8, 157u8, 165u8, - 21u8, - ], - ) - } - #[doc = " All included blocks on the chain, as well as the block number in this chain that"] - #[doc = " should be reverted back to if the candidate is disputed and determined to be invalid."] - pub fn included_iter1( - &self, - _0: types::included::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::included::Param0, - >, - types::included::Included, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasDisputes", - "Included", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 47u8, 105u8, 189u8, 233u8, 206u8, 153u8, 162u8, 217u8, 141u8, 118u8, - 31u8, 85u8, 87u8, 53u8, 100u8, 187u8, 31u8, 245u8, 50u8, 171u8, 4u8, - 203u8, 163u8, 109u8, 212u8, 162u8, 86u8, 124u8, 172u8, 157u8, 165u8, - 21u8, + 121u8, 98u8, 15u8, 254u8, 95u8, 79u8, 203u8, 192u8, 180u8, 103u8, + 153u8, 117u8, 223u8, 87u8, 117u8, 159u8, 41u8, 250u8, 109u8, 161u8, + 140u8, 93u8, 17u8, 64u8, 45u8, 104u8, 202u8, 227u8, 102u8, 29u8, 48u8, + 220u8, ], ) } @@ -41765,34 +36924,19 @@ pub mod api { #[doc = " should be reverted back to if the candidate is disputed and determined to be invalid."] pub fn included( &self, - _0: types::included::Param0, - _1: types::included::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::included::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::included::Param1, - >, - ), - types::included::Included, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (included::Param0, included::Param1), + included::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasDisputes", "Included", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), [ - 47u8, 105u8, 189u8, 233u8, 206u8, 153u8, 162u8, 217u8, 141u8, 118u8, - 31u8, 85u8, 87u8, 53u8, 100u8, 187u8, 31u8, 245u8, 50u8, 171u8, 4u8, - 203u8, 163u8, 109u8, 212u8, 162u8, 86u8, 124u8, 172u8, 157u8, 165u8, - 21u8, + 186u8, 234u8, 210u8, 235u8, 205u8, 31u8, 187u8, 147u8, 108u8, 206u8, + 13u8, 14u8, 119u8, 114u8, 206u8, 43u8, 139u8, 36u8, 253u8, 100u8, + 196u8, 37u8, 186u8, 68u8, 128u8, 240u8, 124u8, 157u8, 232u8, 183u8, + 73u8, 123u8, ], ) } @@ -41804,23 +36948,71 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::frozen::Frozen, - ::subxt::ext::subxt_core::utils::Yes, + frozen::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasDisputes", "Frozen", - (), [ - 245u8, 136u8, 43u8, 156u8, 7u8, 74u8, 31u8, 190u8, 184u8, 119u8, 182u8, - 66u8, 18u8, 136u8, 30u8, 248u8, 24u8, 121u8, 26u8, 177u8, 169u8, 208u8, - 218u8, 208u8, 80u8, 116u8, 31u8, 144u8, 49u8, 201u8, 198u8, 197u8, + 197u8, 51u8, 162u8, 124u8, 248u8, 25u8, 18u8, 95u8, 112u8, 132u8, + 185u8, 33u8, 131u8, 134u8, 141u8, 204u8, 245u8, 145u8, 60u8, 138u8, + 193u8, 156u8, 7u8, 205u8, 101u8, 20u8, 244u8, 153u8, 23u8, 134u8, + 145u8, 209u8, ], ) } } + pub mod last_pruned_session { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod disputes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_primitives::v9::DisputeState< + ::core::primitive::u32, + >; + } + } + pub mod backers_on_disputes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_primitives::v9::ValidatorIndex, + >; + } + } + pub mod included { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod frozen { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option<::core::primitive::u32>; + } + } } } pub mod paras_slashing { @@ -41894,151 +37086,67 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod unapplied_slashes { - use super::runtime_types; - pub type UnappliedSlashes = - runtime_types::polkadot_primitives::v9::slashing::PendingSlashes; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; - } - pub mod validator_set_counts { - use super::runtime_types; - pub type ValidatorSetCounts = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Validators pending dispute slashes."] - pub fn unapplied_slashes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::unapplied_slashes::UnappliedSlashes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasSlashing", - "UnappliedSlashes", - (), - [ - 33u8, 56u8, 255u8, 142u8, 106u8, 140u8, 122u8, 102u8, 103u8, 68u8, - 118u8, 101u8, 50u8, 11u8, 42u8, 230u8, 186u8, 94u8, 118u8, 217u8, - 121u8, 217u8, 43u8, 149u8, 143u8, 42u8, 108u8, 81u8, 56u8, 24u8, 235u8, - 18u8, - ], - ) - } - #[doc = " Validators pending dispute slashes."] - pub fn unapplied_slashes_iter1( - &self, - _0: types::unapplied_slashes::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::unapplied_slashes::Param0, - >, - types::unapplied_slashes::UnappliedSlashes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasSlashing", - "UnappliedSlashes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 33u8, 56u8, 255u8, 142u8, 106u8, 140u8, 122u8, 102u8, 103u8, 68u8, - 118u8, 101u8, 50u8, 11u8, 42u8, 230u8, 186u8, 94u8, 118u8, 217u8, - 121u8, 217u8, 43u8, 149u8, 143u8, 42u8, 108u8, 81u8, 56u8, 24u8, 235u8, - 18u8, - ], - ) - } #[doc = " Validators pending dispute slashes."] pub fn unapplied_slashes( &self, - _0: types::unapplied_slashes::Param0, - _1: types::unapplied_slashes::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::unapplied_slashes::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::unapplied_slashes::Param1, - >, - ), - types::unapplied_slashes::UnappliedSlashes, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (unapplied_slashes::Param0, unapplied_slashes::Param1), + unapplied_slashes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasSlashing", "UnappliedSlashes", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 33u8, 56u8, 255u8, 142u8, 106u8, 140u8, 122u8, 102u8, 103u8, 68u8, - 118u8, 101u8, 50u8, 11u8, 42u8, 230u8, 186u8, 94u8, 118u8, 217u8, - 121u8, 217u8, 43u8, 149u8, 143u8, 42u8, 108u8, 81u8, 56u8, 24u8, 235u8, - 18u8, - ], - ) - } - #[doc = " `ValidatorSetCount` per session."] - pub fn validator_set_counts_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::validator_set_counts::ValidatorSetCounts, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ParasSlashing", - "ValidatorSetCounts", - (), [ - 195u8, 220u8, 79u8, 140u8, 114u8, 80u8, 241u8, 103u8, 4u8, 7u8, 53u8, - 100u8, 16u8, 78u8, 104u8, 171u8, 134u8, 110u8, 158u8, 191u8, 37u8, - 94u8, 211u8, 26u8, 17u8, 70u8, 50u8, 34u8, 70u8, 234u8, 186u8, 69u8, + 172u8, 197u8, 236u8, 63u8, 61u8, 114u8, 71u8, 110u8, 136u8, 78u8, + 191u8, 61u8, 99u8, 202u8, 14u8, 121u8, 51u8, 90u8, 89u8, 23u8, 166u8, + 50u8, 67u8, 28u8, 37u8, 95u8, 1u8, 162u8, 182u8, 207u8, 87u8, 167u8, ], ) } #[doc = " `ValidatorSetCount` per session."] pub fn validator_set_counts( &self, - _0: types::validator_set_counts::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::validator_set_counts::Param0, - >, - types::validator_set_counts::ValidatorSetCounts, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (validator_set_counts::Param0,), + validator_set_counts::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ParasSlashing", "ValidatorSetCounts", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 195u8, 220u8, 79u8, 140u8, 114u8, 80u8, 241u8, 103u8, 4u8, 7u8, 53u8, - 100u8, 16u8, 78u8, 104u8, 171u8, 134u8, 110u8, 158u8, 191u8, 37u8, - 94u8, 211u8, 26u8, 17u8, 70u8, 50u8, 34u8, 70u8, 234u8, 186u8, 69u8, + 12u8, 132u8, 85u8, 53u8, 169u8, 170u8, 60u8, 39u8, 204u8, 23u8, 71u8, + 8u8, 57u8, 67u8, 170u8, 123u8, 43u8, 18u8, 111u8, 62u8, 197u8, 89u8, + 71u8, 110u8, 174u8, 141u8, 7u8, 133u8, 248u8, 35u8, 238u8, 19u8, ], ) } } + pub mod unapplied_slashes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::polkadot_core_primitives::CandidateHash; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_primitives::v9::slashing::PendingSlashes; + } + } + pub mod validator_set_counts { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } } } pub mod message_queue { @@ -42289,72 +37397,25 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod book_state_for { - use super::runtime_types; - pub type BookStateFor = runtime_types :: pallet_message_queue :: BookState < runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin > ; - pub type Param0 = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; - } - pub mod service_head { - use super::runtime_types; - pub type ServiceHead = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; - } - pub mod pages { - use super::runtime_types; - pub type Pages = - runtime_types::pallet_message_queue::Page<::core::primitive::u32>; - pub type Param0 = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; - pub type Param1 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " The index of the first and last (non-empty) pages."] - pub fn book_state_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::book_state_for::BookStateFor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MessageQueue", - "BookStateFor", - (), - [ - 32u8, 61u8, 161u8, 81u8, 134u8, 136u8, 252u8, 113u8, 204u8, 115u8, - 206u8, 180u8, 33u8, 185u8, 137u8, 155u8, 178u8, 189u8, 234u8, 201u8, - 31u8, 230u8, 156u8, 72u8, 37u8, 56u8, 152u8, 91u8, 50u8, 82u8, 191u8, - 2u8, - ], - ) - } #[doc = " The index of the first and last (non-empty) pages."] pub fn book_state_for( &self, - _0: types::book_state_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::book_state_for::Param0, - >, - types::book_state_for::BookStateFor, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (book_state_for::Param0,), + book_state_for::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "MessageQueue", "BookStateFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 32u8, 61u8, 161u8, 81u8, 134u8, 136u8, 252u8, 113u8, 204u8, 115u8, - 206u8, 180u8, 33u8, 185u8, 137u8, 155u8, 178u8, 189u8, 234u8, 201u8, - 31u8, 230u8, 156u8, 72u8, 37u8, 56u8, 152u8, 91u8, 50u8, 82u8, 191u8, - 2u8, + 117u8, 72u8, 122u8, 32u8, 255u8, 248u8, 4u8, 125u8, 112u8, 142u8, 81u8, + 171u8, 223u8, 167u8, 67u8, 156u8, 223u8, 80u8, 93u8, 4u8, 219u8, 193u8, + 85u8, 34u8, 44u8, 29u8, 114u8, 7u8, 48u8, 150u8, 72u8, 235u8, ], ) } @@ -42363,103 +37424,67 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::service_head::ServiceHead, + service_head::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "MessageQueue", "ServiceHead", - (), [ - 17u8, 130u8, 229u8, 193u8, 127u8, 237u8, 60u8, 232u8, 99u8, 109u8, - 102u8, 228u8, 124u8, 103u8, 24u8, 188u8, 151u8, 121u8, 55u8, 97u8, - 85u8, 63u8, 131u8, 60u8, 99u8, 12u8, 88u8, 230u8, 86u8, 50u8, 12u8, - 75u8, + 76u8, 8u8, 2u8, 85u8, 111u8, 162u8, 113u8, 55u8, 119u8, 145u8, 199u8, + 108u8, 11u8, 186u8, 54u8, 19u8, 186u8, 83u8, 122u8, 249u8, 21u8, 121u8, + 246u8, 158u8, 66u8, 43u8, 238u8, 105u8, 4u8, 57u8, 224u8, 192u8, ], ) } #[doc = " The map of page indices to pages."] - pub fn pages_iter( + pub fn pages( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pages::Pages, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + (pages::Param0, pages::Param1), + pages::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "MessageQueue", "Pages", - (), [ - 56u8, 181u8, 157u8, 16u8, 157u8, 123u8, 106u8, 93u8, 199u8, 208u8, - 153u8, 53u8, 168u8, 188u8, 124u8, 77u8, 140u8, 163u8, 113u8, 16u8, - 232u8, 47u8, 10u8, 185u8, 113u8, 230u8, 47u8, 91u8, 253u8, 196u8, 95u8, - 102u8, + 234u8, 232u8, 201u8, 70u8, 20u8, 127u8, 203u8, 253u8, 85u8, 92u8, + 252u8, 192u8, 215u8, 131u8, 68u8, 121u8, 129u8, 230u8, 254u8, 132u8, + 70u8, 182u8, 4u8, 159u8, 118u8, 88u8, 18u8, 124u8, 87u8, 124u8, 162u8, + 247u8, ], ) } - #[doc = " The map of page indices to pages."] - pub fn pages_iter1( - &self, - _0: types::pages::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pages::Param0, - >, - types::pages::Pages, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MessageQueue", - "Pages", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 56u8, 181u8, 157u8, 16u8, 157u8, 123u8, 106u8, 93u8, 199u8, 208u8, - 153u8, 53u8, 168u8, 188u8, 124u8, 77u8, 140u8, 163u8, 113u8, 16u8, - 232u8, 47u8, 10u8, 185u8, 113u8, 230u8, 47u8, 91u8, 253u8, 196u8, 95u8, - 102u8, - ], - ) + } + pub mod book_state_for { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: pallet_message_queue :: BookState < runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin > ; } - #[doc = " The map of page indices to pages."] - pub fn pages( - &self, - _0: types::pages::Param0, - _1: types::pages::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pages::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pages::Param1, - >, - ), - types::pages::Pages, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MessageQueue", - "Pages", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 56u8, 181u8, 157u8, 16u8, 157u8, 123u8, 106u8, 93u8, 199u8, 208u8, - 153u8, 53u8, 168u8, 188u8, 124u8, 77u8, 140u8, 163u8, 113u8, 16u8, - 232u8, 47u8, 10u8, 185u8, 113u8, 230u8, 47u8, 91u8, 253u8, 196u8, 95u8, - 102u8, - ], - ) + } + pub mod service_head { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_parachains :: inclusion :: AggregateMessageOrigin ; + } + } + pub mod pages { + use super::root_mod; + use super::runtime_types; + pub type Param0 = + runtime_types::polkadot_runtime_parachains::inclusion::AggregateMessageOrigin; + pub type Param1 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_message_queue::Page<::core::primitive::u32>; } } } @@ -42867,93 +37892,28 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod para_id_affinity { - use super::runtime_types; - pub type ParaIdAffinity = runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: CoreAffinityCount ; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod queue_status { - use super::runtime_types; - pub type QueueStatus = runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueStatusType ; - } - pub mod free_entries { - use super::runtime_types; - pub type FreeEntries = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, - >; - } - pub mod affinity_entries { - use super::runtime_types; - pub type AffinityEntries = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, - >; - pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; - } - pub mod revenue { - use super::runtime_types; - pub type Revenue = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u128, - >; - } - pub mod credits { - use super::runtime_types; - pub type Credits = ::core::primitive::u128; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Maps a `ParaId` to `CoreIndex` and keeps track of how many assignments the scheduler has in"] - #[doc = " it's lookahead. Keeping track of this affinity prevents parallel execution of the same"] - #[doc = " `ParaId` on two or more `CoreIndex`es."] - pub fn para_id_affinity_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::para_id_affinity::ParaIdAffinity, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "OnDemandAssignmentProvider", - "ParaIdAffinity", - (), - [ - 84u8, 171u8, 103u8, 180u8, 176u8, 210u8, 232u8, 184u8, 221u8, 129u8, - 174u8, 253u8, 250u8, 168u8, 2u8, 250u8, 105u8, 143u8, 120u8, 204u8, - 30u8, 242u8, 151u8, 44u8, 48u8, 150u8, 81u8, 194u8, 191u8, 91u8, 29u8, - 46u8, - ], - ) - } #[doc = " Maps a `ParaId` to `CoreIndex` and keeps track of how many assignments the scheduler has in"] #[doc = " it's lookahead. Keeping track of this affinity prevents parallel execution of the same"] #[doc = " `ParaId` on two or more `CoreIndex`es."] pub fn para_id_affinity( &self, - _0: types::para_id_affinity::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::para_id_affinity::Param0, - >, - types::para_id_affinity::ParaIdAffinity, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (para_id_affinity::Param0,), + para_id_affinity::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "OnDemandAssignmentProvider", "ParaIdAffinity", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 84u8, 171u8, 103u8, 180u8, 176u8, 210u8, 232u8, 184u8, 221u8, 129u8, - 174u8, 253u8, 250u8, 168u8, 2u8, 250u8, 105u8, 143u8, 120u8, 204u8, - 30u8, 242u8, 151u8, 44u8, 48u8, 150u8, 81u8, 194u8, 191u8, 91u8, 29u8, - 46u8, + 218u8, 34u8, 197u8, 111u8, 214u8, 117u8, 183u8, 3u8, 117u8, 184u8, + 199u8, 103u8, 178u8, 205u8, 117u8, 173u8, 171u8, 8u8, 193u8, 255u8, + 60u8, 8u8, 120u8, 83u8, 129u8, 59u8, 49u8, 86u8, 14u8, 181u8, 89u8, + 223u8, ], ) } @@ -42962,19 +37922,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::queue_status::QueueStatus, + queue_status::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "OnDemandAssignmentProvider", "QueueStatus", - (), [ - 44u8, 67u8, 88u8, 179u8, 0u8, 178u8, 233u8, 101u8, 156u8, 215u8, 99u8, - 242u8, 236u8, 2u8, 153u8, 32u8, 214u8, 247u8, 193u8, 234u8, 194u8, - 30u8, 182u8, 151u8, 18u8, 121u8, 208u8, 146u8, 231u8, 6u8, 162u8, 20u8, + 132u8, 122u8, 194u8, 209u8, 37u8, 171u8, 243u8, 239u8, 190u8, 254u8, + 189u8, 228u8, 211u8, 153u8, 91u8, 104u8, 161u8, 20u8, 118u8, 148u8, + 98u8, 61u8, 102u8, 14u8, 66u8, 127u8, 56u8, 37u8, 240u8, 204u8, 66u8, + 224u8, ], ) } @@ -42983,67 +37941,34 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::free_entries::FreeEntries, - ::subxt::ext::subxt_core::utils::Yes, + free_entries::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "OnDemandAssignmentProvider", "FreeEntries", - (), [ - 229u8, 190u8, 235u8, 140u8, 35u8, 221u8, 62u8, 119u8, 131u8, 211u8, - 177u8, 218u8, 84u8, 132u8, 135u8, 118u8, 138u8, 227u8, 186u8, 52u8, - 102u8, 190u8, 155u8, 123u8, 232u8, 136u8, 97u8, 203u8, 55u8, 113u8, - 194u8, 7u8, - ], - ) - } - #[doc = " Queue entries that are currently bound to a particular core due to core affinity."] - pub fn affinity_entries_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::affinity_entries::AffinityEntries, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "OnDemandAssignmentProvider", - "AffinityEntries", - (), - [ - 130u8, 236u8, 62u8, 133u8, 71u8, 121u8, 51u8, 37u8, 27u8, 240u8, 134u8, - 28u8, 221u8, 211u8, 28u8, 182u8, 222u8, 220u8, 249u8, 227u8, 2u8, - 124u8, 71u8, 252u8, 208u8, 36u8, 219u8, 147u8, 235u8, 254u8, 36u8, - 90u8, + 44u8, 103u8, 2u8, 83u8, 66u8, 184u8, 34u8, 29u8, 255u8, 181u8, 227u8, + 46u8, 181u8, 124u8, 63u8, 222u8, 117u8, 234u8, 42u8, 186u8, 132u8, + 224u8, 79u8, 202u8, 167u8, 180u8, 175u8, 59u8, 245u8, 6u8, 99u8, 56u8, ], ) } #[doc = " Queue entries that are currently bound to a particular core due to core affinity."] pub fn affinity_entries( &self, - _0: types::affinity_entries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::affinity_entries::Param0, - >, - types::affinity_entries::AffinityEntries, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (affinity_entries::Param0,), + affinity_entries::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "OnDemandAssignmentProvider", "AffinityEntries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 130u8, 236u8, 62u8, 133u8, 71u8, 121u8, 51u8, 37u8, 27u8, 240u8, 134u8, - 28u8, 221u8, 211u8, 28u8, 182u8, 222u8, 220u8, 249u8, 227u8, 2u8, - 124u8, 71u8, 252u8, 208u8, 36u8, 219u8, 147u8, 235u8, 254u8, 36u8, - 90u8, + 199u8, 2u8, 26u8, 53u8, 29u8, 95u8, 222u8, 132u8, 125u8, 135u8, 51u8, + 126u8, 105u8, 63u8, 236u8, 104u8, 225u8, 136u8, 159u8, 136u8, 119u8, + 108u8, 118u8, 170u8, 142u8, 27u8, 53u8, 80u8, 5u8, 240u8, 94u8, 7u8, ], ) } @@ -43052,68 +37977,95 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::revenue::Revenue, - ::subxt::ext::subxt_core::utils::Yes, + revenue::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "OnDemandAssignmentProvider", "Revenue", - (), - [ - 42u8, 127u8, 42u8, 59u8, 80u8, 19u8, 151u8, 234u8, 157u8, 17u8, 183u8, - 129u8, 121u8, 39u8, 74u8, 43u8, 121u8, 14u8, 82u8, 11u8, 14u8, 182u8, - 125u8, 52u8, 37u8, 132u8, 159u8, 93u8, 106u8, 130u8, 225u8, 64u8, - ], - ) - } - #[doc = " Keeps track of credits owned by each account."] - pub fn credits_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::credits::Credits, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "OnDemandAssignmentProvider", - "Credits", - (), [ - 59u8, 62u8, 141u8, 61u8, 25u8, 95u8, 77u8, 151u8, 218u8, 104u8, 152u8, - 237u8, 135u8, 135u8, 41u8, 130u8, 220u8, 168u8, 94u8, 180u8, 251u8, - 76u8, 121u8, 253u8, 203u8, 64u8, 11u8, 33u8, 81u8, 122u8, 201u8, 145u8, + 169u8, 166u8, 97u8, 59u8, 163u8, 228u8, 227u8, 20u8, 150u8, 66u8, + 155u8, 70u8, 59u8, 196u8, 44u8, 35u8, 143u8, 65u8, 202u8, 11u8, 108u8, + 84u8, 0u8, 223u8, 227u8, 77u8, 97u8, 211u8, 80u8, 113u8, 216u8, 37u8, ], ) } #[doc = " Keeps track of credits owned by each account."] pub fn credits( &self, - _0: types::credits::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::credits::Param0, - >, - types::credits::Credits, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (credits::Param0,), + credits::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "OnDemandAssignmentProvider", "Credits", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 59u8, 62u8, 141u8, 61u8, 25u8, 95u8, 77u8, 151u8, 218u8, 104u8, 152u8, - 237u8, 135u8, 135u8, 41u8, 130u8, 220u8, 168u8, 94u8, 180u8, 251u8, - 76u8, 121u8, 253u8, 203u8, 64u8, 11u8, 33u8, 81u8, 122u8, 201u8, 145u8, + 214u8, 94u8, 139u8, 213u8, 134u8, 208u8, 91u8, 110u8, 250u8, 243u8, + 167u8, 17u8, 38u8, 55u8, 51u8, 37u8, 97u8, 242u8, 108u8, 9u8, 42u8, + 120u8, 109u8, 0u8, 92u8, 149u8, 28u8, 190u8, 206u8, 165u8, 224u8, 46u8, ], ) } } + pub mod para_id_affinity { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: CoreAffinityCount ; + } + } + pub mod queue_status { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_parachains :: on_demand :: types :: QueueStatusType ; + } + } + pub mod free_entries { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, + >; + } + } + pub mod affinity_entries { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_runtime_parachains::on_demand::types::EnqueuedOrder, + >; + } + } + pub mod revenue { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u128, + >; + } + } + pub mod credits { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } } pub mod constants { use super::runtime_types; @@ -43180,98 +38132,28 @@ pub mod api { pub type Error = runtime_types::polkadot_runtime_parachains::assigner_coretime::pallet::Error; pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod core_schedules { - use super::runtime_types; - pub type CoreSchedules = - runtime_types::polkadot_runtime_parachains::assigner_coretime::Schedule< - ::core::primitive::u32, - >; - pub type Param0 = ( - ::core::primitive::u32, - runtime_types::polkadot_primitives::v9::CoreIndex, - ); - } - pub mod core_descriptors { - use super::runtime_types; - pub type CoreDescriptors = runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: CoreDescriptor < :: core :: primitive :: u32 > ; - pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Scheduled assignment sets."] - #[doc = ""] - #[doc = " Assignments as of the given block number. They will go into state once the block number is"] - #[doc = " reached (and replace whatever was in there before)."] - pub fn core_schedules_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::core_schedules::CoreSchedules, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "CoretimeAssignmentProvider", - "CoreSchedules", - (), - [ - 34u8, 85u8, 91u8, 158u8, 28u8, 200u8, 76u8, 188u8, 253u8, 91u8, 153u8, - 42u8, 42u8, 227u8, 119u8, 181u8, 247u8, 44u8, 29u8, 24u8, 128u8, 49u8, - 57u8, 248u8, 24u8, 145u8, 34u8, 74u8, 21u8, 225u8, 159u8, 232u8, - ], - ) - } #[doc = " Scheduled assignment sets."] #[doc = ""] #[doc = " Assignments as of the given block number. They will go into state once the block number is"] #[doc = " reached (and replace whatever was in there before)."] pub fn core_schedules( &self, - _0: types::core_schedules::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::core_schedules::CoreSchedules, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (core_schedules::Param0,), + core_schedules::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "CoretimeAssignmentProvider", "CoreSchedules", - (), [ - 34u8, 85u8, 91u8, 158u8, 28u8, 200u8, 76u8, 188u8, 253u8, 91u8, 153u8, - 42u8, 42u8, 227u8, 119u8, 181u8, 247u8, 44u8, 29u8, 24u8, 128u8, 49u8, - 57u8, 248u8, 24u8, 145u8, 34u8, 74u8, 21u8, 225u8, 159u8, 232u8, - ], - ) - } - #[doc = " Assignments which are currently active."] - #[doc = ""] - #[doc = " They will be picked from `PendingAssignments` once we reach the scheduled block number in"] - #[doc = " `PendingAssignments`."] - pub fn core_descriptors_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::core_descriptors::CoreDescriptors, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "CoretimeAssignmentProvider", - "CoreDescriptors", - (), - [ - 1u8, 90u8, 208u8, 119u8, 150u8, 241u8, 133u8, 74u8, 22u8, 166u8, 13u8, - 7u8, 73u8, 136u8, 105u8, 61u8, 251u8, 245u8, 164u8, 7u8, 45u8, 68u8, - 190u8, 224u8, 34u8, 22u8, 30u8, 250u8, 171u8, 152u8, 238u8, 120u8, + 19u8, 0u8, 96u8, 29u8, 157u8, 30u8, 60u8, 179u8, 243u8, 28u8, 135u8, + 240u8, 245u8, 161u8, 250u8, 229u8, 75u8, 72u8, 0u8, 118u8, 225u8, 12u8, + 198u8, 223u8, 15u8, 30u8, 113u8, 56u8, 241u8, 245u8, 64u8, 128u8, ], ) } @@ -43281,26 +38163,47 @@ pub mod api { #[doc = " `PendingAssignments`."] pub fn core_descriptors( &self, - _0: types::core_descriptors::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::core_descriptors::CoreDescriptors, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (core_descriptors::Param0,), + core_descriptors::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "CoretimeAssignmentProvider", "CoreDescriptors", - (), [ - 1u8, 90u8, 208u8, 119u8, 150u8, 241u8, 133u8, 74u8, 22u8, 166u8, 13u8, - 7u8, 73u8, 136u8, 105u8, 61u8, 251u8, 245u8, 164u8, 7u8, 45u8, 68u8, - 190u8, 224u8, 34u8, 22u8, 30u8, 250u8, 171u8, 152u8, 238u8, 120u8, + 74u8, 53u8, 1u8, 122u8, 94u8, 93u8, 188u8, 54u8, 82u8, 70u8, 97u8, + 213u8, 230u8, 74u8, 224u8, 37u8, 52u8, 240u8, 117u8, 203u8, 220u8, + 103u8, 155u8, 168u8, 169u8, 184u8, 154u8, 19u8, 67u8, 242u8, 67u8, + 65u8, ], ) } } + pub mod core_schedules { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ( + ::core::primitive::u32, + runtime_types::polkadot_primitives::v9::CoreIndex, + ); + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_parachains::assigner_coretime::Schedule< + ::core::primitive::u32, + >; + } + } + pub mod core_descriptors { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_primitives::v9::CoreIndex; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_parachains :: assigner_coretime :: CoreDescriptor < :: core :: primitive :: u32 > ; + } + } } } pub mod registrar { @@ -43953,100 +38856,26 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod pending_swap { - use super::runtime_types; - pub type PendingSwap = - runtime_types::polkadot_parachain_primitives::primitives::Id; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod paras { - use super::runtime_types; - pub type Paras = - runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod next_free_para_id { - use super::runtime_types; - pub type NextFreeParaId = - runtime_types::polkadot_parachain_primitives::primitives::Id; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Pending swap operations."] - pub fn pending_swap_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_swap::PendingSwap, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Registrar", - "PendingSwap", - (), - [ - 75u8, 6u8, 68u8, 43u8, 108u8, 147u8, 220u8, 90u8, 190u8, 86u8, 209u8, - 141u8, 9u8, 254u8, 103u8, 10u8, 94u8, 187u8, 155u8, 249u8, 140u8, - 167u8, 248u8, 196u8, 67u8, 169u8, 186u8, 192u8, 139u8, 188u8, 48u8, - 221u8, - ], - ) - } #[doc = " Pending swap operations."] pub fn pending_swap( &self, - _0: types::pending_swap::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_swap::Param0, - >, - types::pending_swap::PendingSwap, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (pending_swap::Param0,), + pending_swap::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Registrar", "PendingSwap", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 75u8, 6u8, 68u8, 43u8, 108u8, 147u8, 220u8, 90u8, 190u8, 86u8, 209u8, - 141u8, 9u8, 254u8, 103u8, 10u8, 94u8, 187u8, 155u8, 249u8, 140u8, - 167u8, 248u8, 196u8, 67u8, 169u8, 186u8, 192u8, 139u8, 188u8, 48u8, - 221u8, - ], - ) - } - #[doc = " Amount held on deposit for each para and the original depositor."] - #[doc = ""] - #[doc = " The given account ID is responsible for registering the code and initial head data, but may"] - #[doc = " only do so if it isn't yet registered. (After that, it's up to governance to do so.)"] - pub fn paras_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::paras::Paras, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Registrar", - "Paras", - (), [ - 125u8, 62u8, 50u8, 209u8, 40u8, 170u8, 61u8, 62u8, 61u8, 246u8, 103u8, - 229u8, 213u8, 94u8, 249u8, 49u8, 18u8, 90u8, 138u8, 14u8, 101u8, 133u8, - 28u8, 167u8, 5u8, 77u8, 113u8, 207u8, 57u8, 142u8, 77u8, 117u8, + 69u8, 16u8, 237u8, 162u8, 173u8, 196u8, 220u8, 22u8, 155u8, 240u8, + 53u8, 210u8, 239u8, 145u8, 162u8, 175u8, 107u8, 178u8, 58u8, 94u8, + 220u8, 247u8, 21u8, 195u8, 83u8, 102u8, 107u8, 242u8, 82u8, 242u8, + 89u8, 153u8, ], ) } @@ -44056,24 +38885,19 @@ pub mod api { #[doc = " only do so if it isn't yet registered. (After that, it's up to governance to do so.)"] pub fn paras( &self, - _0: types::paras::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::paras::Param0, - >, - types::paras::Paras, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (paras::Param0,), + paras::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Registrar", "Paras", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 125u8, 62u8, 50u8, 209u8, 40u8, 170u8, 61u8, 62u8, 61u8, 246u8, 103u8, - 229u8, 213u8, 94u8, 249u8, 49u8, 18u8, 90u8, 138u8, 14u8, 101u8, 133u8, - 28u8, 167u8, 5u8, 77u8, 113u8, 207u8, 57u8, 142u8, 77u8, 117u8, + 16u8, 207u8, 133u8, 85u8, 94u8, 235u8, 79u8, 69u8, 163u8, 22u8, 107u8, + 229u8, 123u8, 186u8, 21u8, 173u8, 207u8, 76u8, 148u8, 38u8, 106u8, + 34u8, 199u8, 161u8, 181u8, 239u8, 125u8, 151u8, 146u8, 138u8, 228u8, + 103u8, ], ) } @@ -44082,24 +38906,50 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_free_para_id::NextFreeParaId, - ::subxt::ext::subxt_core::utils::Yes, + next_free_para_id::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Registrar", "NextFreeParaId", - (), [ - 52u8, 14u8, 56u8, 196u8, 79u8, 221u8, 32u8, 14u8, 154u8, 247u8, 94u8, - 219u8, 11u8, 11u8, 104u8, 137u8, 167u8, 195u8, 180u8, 101u8, 35u8, - 235u8, 67u8, 144u8, 128u8, 209u8, 189u8, 227u8, 177u8, 74u8, 42u8, - 15u8, + 134u8, 231u8, 208u8, 83u8, 47u8, 33u8, 226u8, 59u8, 92u8, 78u8, 43u8, + 142u8, 223u8, 212u8, 157u8, 252u8, 119u8, 166u8, 3u8, 141u8, 35u8, + 26u8, 184u8, 127u8, 81u8, 201u8, 11u8, 66u8, 204u8, 62u8, 155u8, 165u8, ], ) } } + pub mod pending_swap { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + } + pub mod paras { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + } + } + pub mod next_free_para_id { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + } } pub mod constants { use super::runtime_types; @@ -44376,59 +39226,10 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod leases { - use super::runtime_types; - pub type Leases = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::core::option::Option<( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - )>, - >; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] - #[doc = ""] - #[doc = " The actual amount locked on its behalf by any account at any time is the maximum of the"] - #[doc = " second values of the items in this list whose first value is the account."] - #[doc = ""] - #[doc = " The first item in the list is the amount locked for the current Lease Period. Following"] - #[doc = " items are for the subsequent lease periods."] - #[doc = ""] - #[doc = " The default value (an empty list) implies that the parachain no longer exists (or never"] - #[doc = " existed) as far as this pallet is concerned."] - #[doc = ""] - #[doc = " If a parachain doesn't exist *yet* but is scheduled to exist in the future, then it"] - #[doc = " will be left-padded with one or more `None`s to denote the fact that nothing is held on"] - #[doc = " deposit for the non-existent chain currently, but is held at some point in the future."] - #[doc = ""] - #[doc = " It is illegal for a `None` value to trail in the list."] - pub fn leases_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::leases::Leases, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Slots", - "Leases", - (), - [ - 233u8, 226u8, 181u8, 160u8, 216u8, 86u8, 238u8, 229u8, 31u8, 67u8, - 200u8, 188u8, 134u8, 22u8, 88u8, 147u8, 204u8, 11u8, 34u8, 244u8, - 234u8, 77u8, 184u8, 171u8, 147u8, 228u8, 254u8, 11u8, 40u8, 162u8, - 177u8, 196u8, - ], - ) - } #[doc = " Amounts held on deposit for each (possibly future) leased parachain."] #[doc = ""] #[doc = " The actual amount locked on its behalf by any account at any time is the maximum of the"] @@ -44447,29 +39248,37 @@ pub mod api { #[doc = " It is illegal for a `None` value to trail in the list."] pub fn leases( &self, - _0: types::leases::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::leases::Param0, - >, - types::leases::Leases, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (leases::Param0,), + leases::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Slots", "Leases", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 233u8, 226u8, 181u8, 160u8, 216u8, 86u8, 238u8, 229u8, 31u8, 67u8, - 200u8, 188u8, 134u8, 22u8, 88u8, 147u8, 204u8, 11u8, 34u8, 244u8, - 234u8, 77u8, 184u8, 171u8, 147u8, 228u8, 254u8, 11u8, 40u8, 162u8, - 177u8, 196u8, + 50u8, 170u8, 122u8, 19u8, 217u8, 127u8, 190u8, 88u8, 100u8, 207u8, + 49u8, 83u8, 105u8, 189u8, 245u8, 169u8, 12u8, 139u8, 71u8, 151u8, 85u8, + 246u8, 155u8, 15u8, 178u8, 140u8, 155u8, 155u8, 162u8, 53u8, 154u8, + 251u8, ], ) } } + pub mod leases { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::core::option::Option<( + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + )>, + >; + } + } } pub mod constants { use super::runtime_types; @@ -44884,35 +39693,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod auction_counter { - use super::runtime_types; - pub type AuctionCounter = ::core::primitive::u32; - } - pub mod auction_info { - use super::runtime_types; - pub type AuctionInfo = (::core::primitive::u32, ::core::primitive::u32); - } - pub mod reserved_amounts { - use super::runtime_types; - pub type ReservedAmounts = ::core::primitive::u128; - pub type Param0 = ( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::polkadot_parachain_primitives::primitives::Id, - ); - } - pub mod winning { - use super::runtime_types; - pub type Winning = [::core::option::Option<( - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::polkadot_parachain_primitives::primitives::Id, - ::core::primitive::u128, - )>; 36usize]; - pub type Param0 = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Number of auctions started so far."] @@ -44920,19 +39702,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::auction_counter::AuctionCounter, + auction_counter::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Auctions", "AuctionCounter", - (), [ - 110u8, 243u8, 85u8, 4u8, 127u8, 111u8, 101u8, 167u8, 72u8, 129u8, - 201u8, 250u8, 88u8, 9u8, 79u8, 14u8, 152u8, 132u8, 0u8, 204u8, 112u8, - 248u8, 91u8, 254u8, 30u8, 22u8, 62u8, 180u8, 188u8, 204u8, 29u8, 103u8, + 126u8, 215u8, 240u8, 118u8, 0u8, 238u8, 20u8, 9u8, 183u8, 212u8, 158u8, + 139u8, 125u8, 63u8, 197u8, 41u8, 168u8, 55u8, 5u8, 29u8, 184u8, 102u8, + 99u8, 40u8, 115u8, 194u8, 250u8, 210u8, 196u8, 235u8, 47u8, 203u8, ], ) } @@ -44945,42 +39724,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::auction_info::AuctionInfo, + auction_info::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Auctions", "AuctionInfo", - (), [ - 116u8, 81u8, 223u8, 26u8, 151u8, 103u8, 209u8, 182u8, 169u8, 173u8, - 220u8, 234u8, 88u8, 191u8, 255u8, 75u8, 148u8, 75u8, 167u8, 37u8, 6u8, - 14u8, 224u8, 193u8, 92u8, 82u8, 205u8, 172u8, 209u8, 83u8, 3u8, 77u8, - ], - ) - } - #[doc = " Amounts currently reserved in the accounts of the bidders currently winning"] - #[doc = " (sub-)ranges."] - pub fn reserved_amounts_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::reserved_amounts::ReservedAmounts, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Auctions", - "ReservedAmounts", - (), - [ - 77u8, 44u8, 116u8, 36u8, 189u8, 213u8, 126u8, 32u8, 42u8, 131u8, 108u8, - 41u8, 147u8, 40u8, 247u8, 245u8, 161u8, 42u8, 152u8, 195u8, 28u8, - 142u8, 231u8, 209u8, 113u8, 11u8, 240u8, 37u8, 112u8, 38u8, 239u8, - 245u8, + 155u8, 88u8, 103u8, 247u8, 146u8, 35u8, 15u8, 225u8, 36u8, 57u8, 73u8, + 88u8, 162u8, 199u8, 46u8, 105u8, 187u8, 59u8, 92u8, 48u8, 120u8, 147u8, + 81u8, 6u8, 91u8, 64u8, 158u8, 150u8, 195u8, 210u8, 85u8, 254u8, ], ) } @@ -44988,48 +39741,19 @@ pub mod api { #[doc = " (sub-)ranges."] pub fn reserved_amounts( &self, - _0: types::reserved_amounts::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::reserved_amounts::Param0, - >, - types::reserved_amounts::ReservedAmounts, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (reserved_amounts::Param0,), + reserved_amounts::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Auctions", "ReservedAmounts", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 77u8, 44u8, 116u8, 36u8, 189u8, 213u8, 126u8, 32u8, 42u8, 131u8, 108u8, - 41u8, 147u8, 40u8, 247u8, 245u8, 161u8, 42u8, 152u8, 195u8, 28u8, - 142u8, 231u8, 209u8, 113u8, 11u8, 240u8, 37u8, 112u8, 38u8, 239u8, - 245u8, - ], - ) - } - #[doc = " The winning bids for each of the 10 ranges at each sample in the final Ending Period of"] - #[doc = " the current auction. The map's key is the 0-based index into the Sample Size. The"] - #[doc = " first sample of the ending period is 0; the last is `Sample Size - 1`."] - pub fn winning_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::winning::Winning, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Auctions", - "Winning", - (), - [ - 8u8, 136u8, 174u8, 152u8, 223u8, 1u8, 143u8, 45u8, 213u8, 5u8, 239u8, - 163u8, 152u8, 99u8, 197u8, 109u8, 194u8, 140u8, 246u8, 10u8, 40u8, - 22u8, 0u8, 122u8, 20u8, 132u8, 141u8, 157u8, 56u8, 211u8, 5u8, 104u8, + 228u8, 148u8, 21u8, 107u8, 157u8, 65u8, 177u8, 118u8, 114u8, 18u8, + 145u8, 153u8, 143u8, 98u8, 115u8, 232u8, 183u8, 58u8, 138u8, 244u8, + 182u8, 149u8, 242u8, 129u8, 158u8, 82u8, 81u8, 119u8, 160u8, 45u8, + 27u8, 65u8, ], ) } @@ -45038,28 +39762,63 @@ pub mod api { #[doc = " first sample of the ending period is 0; the last is `Sample Size - 1`."] pub fn winning( &self, - _0: types::winning::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::winning::Param0, - >, - types::winning::Winning, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (winning::Param0,), + winning::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Auctions", "Winning", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 8u8, 136u8, 174u8, 152u8, 223u8, 1u8, 143u8, 45u8, 213u8, 5u8, 239u8, - 163u8, 152u8, 99u8, 197u8, 109u8, 194u8, 140u8, 246u8, 10u8, 40u8, - 22u8, 0u8, 122u8, 20u8, 132u8, 141u8, 157u8, 56u8, 211u8, 5u8, 104u8, + 55u8, 199u8, 85u8, 249u8, 162u8, 164u8, 111u8, 211u8, 3u8, 79u8, 198u8, + 91u8, 109u8, 207u8, 252u8, 124u8, 120u8, 119u8, 33u8, 155u8, 97u8, + 84u8, 62u8, 77u8, 177u8, 92u8, 182u8, 148u8, 62u8, 27u8, 131u8, 210u8, ], ) } } + pub mod auction_counter { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod auction_info { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = (::core::primitive::u32, ::core::primitive::u32); + } + } + pub mod reserved_amounts { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ( + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::polkadot_parachain_primitives::primitives::Id, + ); + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + pub mod winning { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = [::core::option::Option<( + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::polkadot_parachain_primitives::primitives::Id, + ::core::primitive::u128, + )>; 36usize]; + } + } } pub mod constants { use super::runtime_types; @@ -45881,80 +40640,25 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod funds { - use super::runtime_types; - pub type Funds = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - >; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod new_raise { - use super::runtime_types; - pub type NewRaise = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::polkadot_parachain_primitives::primitives::Id, - >; - } - pub mod endings_count { - use super::runtime_types; - pub type EndingsCount = ::core::primitive::u32; - } - pub mod next_fund_index { - use super::runtime_types; - pub type NextFundIndex = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Info on all of the funds."] - pub fn funds_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::funds::Funds, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Crowdloan", - "Funds", - (), - [ - 129u8, 59u8, 110u8, 190u8, 187u8, 234u8, 240u8, 81u8, 145u8, 133u8, - 147u8, 96u8, 190u8, 173u8, 22u8, 245u8, 190u8, 106u8, 112u8, 83u8, - 18u8, 215u8, 134u8, 241u8, 156u8, 95u8, 220u8, 39u8, 99u8, 159u8, - 109u8, 210u8, - ], - ) - } #[doc = " Info on all of the funds."] pub fn funds( &self, - _0: types::funds::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::funds::Param0, - >, - types::funds::Funds, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (funds::Param0,), + funds::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Crowdloan", "Funds", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 129u8, 59u8, 110u8, 190u8, 187u8, 234u8, 240u8, 81u8, 145u8, 133u8, - 147u8, 96u8, 190u8, 173u8, 22u8, 245u8, 190u8, 106u8, 112u8, 83u8, - 18u8, 215u8, 134u8, 241u8, 156u8, 95u8, 220u8, 39u8, 99u8, 159u8, - 109u8, 210u8, + 87u8, 128u8, 254u8, 219u8, 58u8, 122u8, 17u8, 56u8, 210u8, 33u8, 39u8, + 86u8, 6u8, 148u8, 62u8, 202u8, 59u8, 125u8, 19u8, 188u8, 51u8, 67u8, + 245u8, 175u8, 59u8, 39u8, 177u8, 7u8, 89u8, 183u8, 217u8, 46u8, ], ) } @@ -45964,20 +40668,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::new_raise::NewRaise, + new_raise::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Crowdloan", "NewRaise", - (), [ - 251u8, 31u8, 237u8, 22u8, 90u8, 248u8, 39u8, 66u8, 93u8, 81u8, 209u8, - 209u8, 194u8, 42u8, 109u8, 208u8, 56u8, 75u8, 45u8, 247u8, 253u8, - 165u8, 22u8, 184u8, 49u8, 49u8, 62u8, 126u8, 254u8, 146u8, 190u8, - 174u8, + 177u8, 237u8, 75u8, 170u8, 182u8, 39u8, 207u8, 30u8, 118u8, 107u8, + 108u8, 231u8, 140u8, 188u8, 156u8, 143u8, 118u8, 119u8, 184u8, 160u8, + 45u8, 104u8, 21u8, 103u8, 9u8, 139u8, 121u8, 111u8, 86u8, 9u8, 112u8, + 251u8, ], ) } @@ -45986,19 +40687,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::endings_count::EndingsCount, + endings_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Crowdloan", "EndingsCount", - (), [ - 106u8, 22u8, 229u8, 157u8, 118u8, 195u8, 11u8, 42u8, 5u8, 50u8, 44u8, - 183u8, 72u8, 167u8, 95u8, 243u8, 234u8, 5u8, 200u8, 253u8, 127u8, - 154u8, 23u8, 55u8, 202u8, 221u8, 82u8, 19u8, 201u8, 154u8, 248u8, 29u8, + 89u8, 177u8, 179u8, 41u8, 9u8, 66u8, 44u8, 174u8, 48u8, 95u8, 68u8, + 11u8, 59u8, 71u8, 127u8, 162u8, 134u8, 134u8, 16u8, 20u8, 37u8, 221u8, + 15u8, 131u8, 186u8, 231u8, 214u8, 237u8, 142u8, 54u8, 111u8, 94u8, ], ) } @@ -46007,24 +40705,60 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_fund_index::NextFundIndex, + next_fund_index::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Crowdloan", "NextFundIndex", - (), [ - 192u8, 21u8, 229u8, 234u8, 152u8, 224u8, 149u8, 44u8, 41u8, 9u8, 191u8, - 128u8, 118u8, 11u8, 117u8, 245u8, 170u8, 116u8, 77u8, 216u8, 175u8, - 115u8, 13u8, 85u8, 240u8, 170u8, 156u8, 201u8, 25u8, 96u8, 103u8, - 207u8, + 64u8, 227u8, 96u8, 155u8, 218u8, 243u8, 76u8, 156u8, 138u8, 96u8, 49u8, + 211u8, 59u8, 216u8, 42u8, 157u8, 120u8, 190u8, 107u8, 222u8, 214u8, + 7u8, 32u8, 177u8, 64u8, 237u8, 96u8, 104u8, 174u8, 221u8, 7u8, 233u8, ], ) } } + pub mod funds { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::core::primitive::u32, + >; + } + } + pub mod new_raise { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; + } + } + pub mod endings_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod next_fund_index { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } } pub mod constants { use super::runtime_types; @@ -46791,26 +41525,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod cursor { - use super::runtime_types; - pub type Cursor = runtime_types::pallet_migrations::MigrationCursor< - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ::core::primitive::u32, - >; - } - pub mod historic { - use super::runtime_types; - pub type Historic = (); - pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The currently active migration to run and its cursor."] @@ -46820,43 +41536,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::cursor::Cursor, + cursor::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "MultiBlockMigrations", "Cursor", - (), [ - 158u8, 123u8, 0u8, 37u8, 29u8, 141u8, 51u8, 91u8, 165u8, 167u8, 35u8, - 72u8, 219u8, 39u8, 135u8, 23u8, 215u8, 63u8, 127u8, 57u8, 55u8, 169u8, - 178u8, 177u8, 77u8, 209u8, 230u8, 152u8, 136u8, 145u8, 58u8, 33u8, - ], - ) - } - #[doc = " Set of all successfully executed migrations."] - #[doc = ""] - #[doc = " This is used as blacklist, to not re-execute migrations that have not been removed from the"] - #[doc = " codebase yet. Governance can regularly clear this out via `clear_historic`."] - pub fn historic_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::historic::Historic, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MultiBlockMigrations", - "Historic", - (), - [ - 142u8, 100u8, 97u8, 146u8, 174u8, 131u8, 203u8, 224u8, 127u8, 74u8, - 118u8, 165u8, 237u8, 128u8, 89u8, 198u8, 80u8, 250u8, 231u8, 29u8, 1u8, - 128u8, 201u8, 51u8, 150u8, 168u8, 3u8, 17u8, 35u8, 175u8, 153u8, 141u8, + 81u8, 213u8, 47u8, 72u8, 45u8, 251u8, 36u8, 119u8, 24u8, 100u8, 98u8, + 254u8, 99u8, 6u8, 156u8, 56u8, 39u8, 28u8, 206u8, 104u8, 177u8, 168u8, + 73u8, 253u8, 198u8, 146u8, 17u8, 226u8, 223u8, 160u8, 230u8, 79u8, ], ) } @@ -46866,28 +41555,46 @@ pub mod api { #[doc = " codebase yet. Governance can regularly clear this out via `clear_historic`."] pub fn historic( &self, - _0: types::historic::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::historic::Param0, - >, - types::historic::Historic, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (historic::Param0,), + historic::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "MultiBlockMigrations", "Historic", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 142u8, 100u8, 97u8, 146u8, 174u8, 131u8, 203u8, 224u8, 127u8, 74u8, - 118u8, 165u8, 237u8, 128u8, 89u8, 198u8, 80u8, 250u8, 231u8, 29u8, 1u8, - 128u8, 201u8, 51u8, 150u8, 168u8, 3u8, 17u8, 35u8, 175u8, 153u8, 141u8, + 140u8, 21u8, 108u8, 63u8, 56u8, 168u8, 238u8, 231u8, 162u8, 233u8, + 219u8, 234u8, 72u8, 81u8, 17u8, 115u8, 53u8, 174u8, 8u8, 254u8, 135u8, + 79u8, 27u8, 81u8, 88u8, 20u8, 71u8, 116u8, 181u8, 98u8, 118u8, 46u8, ], ) } } + pub mod cursor { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_migrations::MigrationCursor< + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ::core::primitive::u32, + >; + } + } + pub mod historic { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub mod output { + use super::runtime_types; + pub type Output = (); + } + } } pub mod constants { use super::runtime_types; @@ -48965,101 +43672,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod query_counter { - use super::runtime_types; - pub type QueryCounter = ::core::primitive::u64; - } - pub mod queries { - use super::runtime_types; - pub type Queries = - runtime_types::pallet_xcm::pallet::QueryStatus<::core::primitive::u32>; - pub type Param0 = ::core::primitive::u64; - } - pub mod asset_traps { - use super::runtime_types; - pub type AssetTraps = ::core::primitive::u32; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - pub mod safe_xcm_version { - use super::runtime_types; - pub type SafeXcmVersion = ::core::primitive::u32; - } - pub mod supported_version { - use super::runtime_types; - pub type SupportedVersion = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::xcm::VersionedLocation; - } - pub mod version_notifiers { - use super::runtime_types; - pub type VersionNotifiers = ::core::primitive::u64; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::xcm::VersionedLocation; - } - pub mod version_notify_targets { - use super::runtime_types; - pub type VersionNotifyTargets = ( - ::core::primitive::u64, - runtime_types::sp_weights::weight_v2::Weight, - ::core::primitive::u32, - ); - pub type Param0 = ::core::primitive::u32; - pub type Param1 = runtime_types::xcm::VersionedLocation; - } - pub mod version_discovery_queue { - use super::runtime_types; - pub type VersionDiscoveryQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedLocation, - ::core::primitive::u32, - )>; - } - pub mod current_migration { - use super::runtime_types; - pub type CurrentMigration = - runtime_types::pallet_xcm::pallet::VersionMigrationStage; - } - pub mod remote_locked_fungibles { - use super::runtime_types; - pub type RemoteLockedFungibles = - runtime_types::pallet_xcm::pallet::RemoteLockedFungibleRecord<()>; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param2 = runtime_types::xcm::VersionedAssetId; - } - pub mod locked_fungibles { - use super::runtime_types; - pub type LockedFungibles = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u128, - runtime_types::xcm::VersionedLocation, - )>; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod xcm_execution_suspended { - use super::runtime_types; - pub type XcmExecutionSuspended = ::core::primitive::bool; - } - pub mod should_record_xcm { - use super::runtime_types; - pub type ShouldRecordXcm = ::core::primitive::bool; - } - pub mod recorded_xcm { - use super::runtime_types; - pub type RecordedXcm = runtime_types::staging_xcm::v5::Xcm; - } - pub mod authorized_aliases { - use super::runtime_types; - pub type AuthorizedAliases = runtime_types::pallet_xcm::AuthorizedAliasesEntry< - runtime_types::frame_support::traits::storage::Disabled, - runtime_types::pallet_xcm::pallet::MaxAuthorizedAliases, - >; - pub type Param0 = runtime_types::xcm::VersionedLocation; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The latest available query index."] @@ -49067,91 +43681,35 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::query_counter::QueryCounter, - ::subxt::ext::subxt_core::utils::Yes, + query_counter::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "QueryCounter", - (), - [ - 216u8, 73u8, 160u8, 232u8, 60u8, 245u8, 218u8, 219u8, 152u8, 68u8, - 146u8, 219u8, 255u8, 7u8, 86u8, 112u8, 83u8, 49u8, 94u8, 173u8, 64u8, - 203u8, 147u8, 226u8, 236u8, 39u8, 129u8, 106u8, 209u8, 113u8, 150u8, - 50u8, - ], - ) - } - #[doc = " The ongoing queries."] - pub fn queries_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::queries::Queries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "Queries", - (), [ - 134u8, 206u8, 252u8, 211u8, 156u8, 173u8, 214u8, 205u8, 17u8, 177u8, - 139u8, 121u8, 43u8, 29u8, 30u8, 233u8, 210u8, 222u8, 172u8, 171u8, - 13u8, 223u8, 153u8, 88u8, 43u8, 44u8, 183u8, 253u8, 252u8, 251u8, - 184u8, 249u8, + 48u8, 193u8, 125u8, 254u8, 83u8, 115u8, 26u8, 145u8, 108u8, 4u8, 220u8, + 128u8, 7u8, 28u8, 190u8, 18u8, 113u8, 54u8, 112u8, 119u8, 83u8, 38u8, + 211u8, 244u8, 114u8, 253u8, 47u8, 19u8, 191u8, 48u8, 135u8, 136u8, ], ) } #[doc = " The ongoing queries."] pub fn queries( &self, - _0: types::queries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::queries::Param0, - >, - types::queries::Queries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (queries::Param0,), + queries::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "Queries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 134u8, 206u8, 252u8, 211u8, 156u8, 173u8, 214u8, 205u8, 17u8, 177u8, - 139u8, 121u8, 43u8, 29u8, 30u8, 233u8, 210u8, 222u8, 172u8, 171u8, - 13u8, 223u8, 153u8, 88u8, 43u8, 44u8, 183u8, 253u8, 252u8, 251u8, - 184u8, 249u8, - ], - ) - } - #[doc = " The existing asset traps."] - #[doc = ""] - #[doc = " Key is the blake2 256 hash of (origin, versioned `Assets`) pair. Value is the number of"] - #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] - pub fn asset_traps_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::asset_traps::AssetTraps, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "AssetTraps", - (), [ - 148u8, 41u8, 254u8, 134u8, 61u8, 172u8, 126u8, 146u8, 78u8, 178u8, - 50u8, 77u8, 226u8, 8u8, 200u8, 78u8, 77u8, 91u8, 26u8, 133u8, 104u8, - 126u8, 28u8, 28u8, 202u8, 62u8, 87u8, 183u8, 231u8, 191u8, 5u8, 181u8, + 224u8, 163u8, 205u8, 252u8, 74u8, 174u8, 107u8, 213u8, 158u8, 52u8, + 58u8, 58u8, 157u8, 64u8, 121u8, 229u8, 134u8, 244u8, 93u8, 121u8, + 146u8, 92u8, 178u8, 22u8, 179u8, 167u8, 190u8, 161u8, 32u8, 226u8, + 75u8, 13u8, ], ) } @@ -49161,24 +43719,18 @@ pub mod api { #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] pub fn asset_traps( &self, - _0: types::asset_traps::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::asset_traps::Param0, - >, - types::asset_traps::AssetTraps, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + (asset_traps::Param0,), + asset_traps::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "AssetTraps", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 148u8, 41u8, 254u8, 134u8, 61u8, 172u8, 126u8, 146u8, 78u8, 178u8, - 50u8, 77u8, 226u8, 8u8, 200u8, 78u8, 77u8, 91u8, 26u8, 133u8, 104u8, - 126u8, 28u8, 28u8, 202u8, 62u8, 87u8, 183u8, 231u8, 191u8, 5u8, 181u8, + 79u8, 123u8, 120u8, 168u8, 143u8, 42u8, 141u8, 178u8, 254u8, 38u8, + 118u8, 249u8, 9u8, 134u8, 201u8, 223u8, 232u8, 155u8, 22u8, 22u8, 65u8, + 162u8, 205u8, 96u8, 2u8, 155u8, 246u8, 15u8, 239u8, 28u8, 133u8, 93u8, ], ) } @@ -49188,226 +43740,54 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::safe_xcm_version::SafeXcmVersion, + safe_xcm_version::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "SafeXcmVersion", - (), - [ - 187u8, 8u8, 74u8, 126u8, 80u8, 215u8, 177u8, 60u8, 223u8, 123u8, 196u8, - 155u8, 166u8, 66u8, 25u8, 164u8, 191u8, 66u8, 116u8, 131u8, 116u8, - 188u8, 224u8, 122u8, 75u8, 195u8, 246u8, 188u8, 83u8, 134u8, 49u8, - 143u8, - ], - ) - } - #[doc = " The Latest versions that we know various locations support."] - pub fn supported_version_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::supported_version::SupportedVersion, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "SupportedVersion", - (), - [ - 156u8, 153u8, 195u8, 67u8, 72u8, 227u8, 183u8, 107u8, 71u8, 221u8, - 125u8, 172u8, 34u8, 22u8, 56u8, 182u8, 219u8, 223u8, 183u8, 137u8, - 243u8, 231u8, 153u8, 254u8, 144u8, 104u8, 48u8, 189u8, 232u8, 104u8, - 180u8, 65u8, - ], - ) - } - #[doc = " The Latest versions that we know various locations support."] - pub fn supported_version_iter1( - &self, - _0: types::supported_version::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::supported_version::Param0, - >, - types::supported_version::SupportedVersion, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "SupportedVersion", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 156u8, 153u8, 195u8, 67u8, 72u8, 227u8, 183u8, 107u8, 71u8, 221u8, - 125u8, 172u8, 34u8, 22u8, 56u8, 182u8, 219u8, 223u8, 183u8, 137u8, - 243u8, 231u8, 153u8, 254u8, 144u8, 104u8, 48u8, 189u8, 232u8, 104u8, - 180u8, 65u8, + 2u8, 34u8, 133u8, 78u8, 129u8, 132u8, 72u8, 253u8, 136u8, 86u8, 44u8, + 40u8, 16u8, 79u8, 138u8, 105u8, 51u8, 165u8, 195u8, 207u8, 74u8, 106u8, + 143u8, 144u8, 119u8, 54u8, 110u8, 246u8, 191u8, 133u8, 66u8, 155u8, ], ) } #[doc = " The Latest versions that we know various locations support."] pub fn supported_version( &self, - _0: types::supported_version::Param0, - _1: types::supported_version::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::supported_version::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::supported_version::Param1, - >, - ), - types::supported_version::SupportedVersion, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (supported_version::Param0, supported_version::Param1), + supported_version::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "SupportedVersion", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 156u8, 153u8, 195u8, 67u8, 72u8, 227u8, 183u8, 107u8, 71u8, 221u8, - 125u8, 172u8, 34u8, 22u8, 56u8, 182u8, 219u8, 223u8, 183u8, 137u8, - 243u8, 231u8, 153u8, 254u8, 144u8, 104u8, 48u8, 189u8, 232u8, 104u8, - 180u8, 65u8, - ], - ) - } - #[doc = " All locations that we have requested version notifications from."] - pub fn version_notifiers_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::version_notifiers::VersionNotifiers, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "VersionNotifiers", - (), - [ - 216u8, 78u8, 44u8, 71u8, 246u8, 59u8, 163u8, 153u8, 68u8, 31u8, 197u8, - 114u8, 33u8, 203u8, 20u8, 60u8, 61u8, 177u8, 94u8, 13u8, 213u8, 203u8, - 150u8, 145u8, 134u8, 249u8, 53u8, 21u8, 122u8, 208u8, 66u8, 67u8, - ], - ) - } - #[doc = " All locations that we have requested version notifications from."] - pub fn version_notifiers_iter1( - &self, - _0: types::version_notifiers::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::version_notifiers::Param0, - >, - types::version_notifiers::VersionNotifiers, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "VersionNotifiers", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 216u8, 78u8, 44u8, 71u8, 246u8, 59u8, 163u8, 153u8, 68u8, 31u8, 197u8, - 114u8, 33u8, 203u8, 20u8, 60u8, 61u8, 177u8, 94u8, 13u8, 213u8, 203u8, - 150u8, 145u8, 134u8, 249u8, 53u8, 21u8, 122u8, 208u8, 66u8, 67u8, + 191u8, 97u8, 1u8, 147u8, 205u8, 201u8, 104u8, 179u8, 53u8, 77u8, 252u8, + 68u8, 41u8, 140u8, 221u8, 204u8, 239u8, 119u8, 236u8, 22u8, 238u8, + 234u8, 152u8, 149u8, 101u8, 237u8, 176u8, 29u8, 162u8, 212u8, 115u8, + 94u8, ], ) } #[doc = " All locations that we have requested version notifications from."] pub fn version_notifiers( &self, - _0: types::version_notifiers::Param0, - _1: types::version_notifiers::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::version_notifiers::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::version_notifiers::Param1, - >, - ), - types::version_notifiers::VersionNotifiers, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (version_notifiers::Param0, version_notifiers::Param1), + version_notifiers::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "VersionNotifiers", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 216u8, 78u8, 44u8, 71u8, 246u8, 59u8, 163u8, 153u8, 68u8, 31u8, 197u8, - 114u8, 33u8, 203u8, 20u8, 60u8, 61u8, 177u8, 94u8, 13u8, 213u8, 203u8, - 150u8, 145u8, 134u8, 249u8, 53u8, 21u8, 122u8, 208u8, 66u8, 67u8, - ], - ) - } - #[doc = " The target locations that are subscribed to our version changes, as well as the most recent"] - #[doc = " of our versions we informed them of."] - pub fn version_notify_targets_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::version_notify_targets::VersionNotifyTargets, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "VersionNotifyTargets", - (), - [ - 166u8, 29u8, 245u8, 121u8, 177u8, 119u8, 188u8, 0u8, 32u8, 188u8, 9u8, - 180u8, 60u8, 28u8, 161u8, 5u8, 189u8, 78u8, 238u8, 14u8, 148u8, 5u8, - 151u8, 153u8, 62u8, 163u8, 144u8, 82u8, 91u8, 227u8, 210u8, 205u8, - ], - ) - } - #[doc = " The target locations that are subscribed to our version changes, as well as the most recent"] - #[doc = " of our versions we informed them of."] - pub fn version_notify_targets_iter1( - &self, - _0: types::version_notify_targets::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::version_notify_targets::Param0, - >, - types::version_notify_targets::VersionNotifyTargets, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "VersionNotifyTargets", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 166u8, 29u8, 245u8, 121u8, 177u8, 119u8, 188u8, 0u8, 32u8, 188u8, 9u8, - 180u8, 60u8, 28u8, 161u8, 5u8, 189u8, 78u8, 238u8, 14u8, 148u8, 5u8, - 151u8, 153u8, 62u8, 163u8, 144u8, 82u8, 91u8, 227u8, 210u8, 205u8, + 38u8, 14u8, 110u8, 60u8, 69u8, 233u8, 214u8, 213u8, 42u8, 73u8, 109u8, + 193u8, 89u8, 151u8, 207u8, 186u8, 95u8, 11u8, 10u8, 103u8, 116u8, + 166u8, 173u8, 203u8, 170u8, 242u8, 154u8, 148u8, 30u8, 95u8, 231u8, + 86u8, ], ) } @@ -49415,33 +43795,21 @@ pub mod api { #[doc = " of our versions we informed them of."] pub fn version_notify_targets( &self, - _0: types::version_notify_targets::Param0, - _1: types::version_notify_targets::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::version_notify_targets::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::version_notify_targets::Param1, - >, + version_notify_targets::Param0, + version_notify_targets::Param1, ), - types::version_notify_targets::VersionNotifyTargets, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + version_notify_targets::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "VersionNotifyTargets", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), [ - 166u8, 29u8, 245u8, 121u8, 177u8, 119u8, 188u8, 0u8, 32u8, 188u8, 9u8, - 180u8, 60u8, 28u8, 161u8, 5u8, 189u8, 78u8, 238u8, 14u8, 148u8, 5u8, - 151u8, 153u8, 62u8, 163u8, 144u8, 82u8, 91u8, 227u8, 210u8, 205u8, + 97u8, 187u8, 121u8, 154u8, 77u8, 100u8, 237u8, 43u8, 160u8, 40u8, 88u8, + 61u8, 216u8, 102u8, 230u8, 19u8, 83u8, 93u8, 50u8, 194u8, 202u8, 235u8, + 158u8, 146u8, 251u8, 218u8, 213u8, 99u8, 61u8, 143u8, 115u8, 86u8, ], ) } @@ -49452,20 +43820,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::version_discovery_queue::VersionDiscoveryQueue, + version_discovery_queue::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "VersionDiscoveryQueue", - (), [ - 206u8, 152u8, 58u8, 105u8, 70u8, 142u8, 210u8, 246u8, 107u8, 8u8, - 190u8, 195u8, 255u8, 27u8, 199u8, 241u8, 221u8, 238u8, 61u8, 92u8, - 245u8, 162u8, 151u8, 234u8, 151u8, 6u8, 216u8, 115u8, 214u8, 138u8, - 8u8, 27u8, + 63u8, 18u8, 238u8, 96u8, 29u8, 116u8, 198u8, 116u8, 104u8, 226u8, 82u8, + 156u8, 142u8, 66u8, 248u8, 221u8, 102u8, 145u8, 137u8, 75u8, 31u8, + 212u8, 171u8, 140u8, 103u8, 88u8, 40u8, 119u8, 218u8, 253u8, 171u8, + 158u8, ], ) } @@ -49474,184 +43839,57 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::current_migration::CurrentMigration, + current_migration::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "CurrentMigration", - (), - [ - 74u8, 138u8, 181u8, 162u8, 59u8, 251u8, 37u8, 28u8, 232u8, 51u8, 30u8, - 152u8, 252u8, 133u8, 95u8, 195u8, 47u8, 127u8, 21u8, 44u8, 62u8, 143u8, - 170u8, 234u8, 160u8, 37u8, 131u8, 179u8, 57u8, 241u8, 140u8, 124u8, - ], - ) - } - #[doc = " Fungible assets which we know are locked on a remote chain."] - pub fn remote_locked_fungibles_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::remote_locked_fungibles::RemoteLockedFungibles, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "RemoteLockedFungibles", - (), [ - 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, - 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, - 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, - 11u8, - ], - ) - } - #[doc = " Fungible assets which we know are locked on a remote chain."] - pub fn remote_locked_fungibles_iter1( - &self, - _0: types::remote_locked_fungibles::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::remote_locked_fungibles::Param0, - >, - types::remote_locked_fungibles::RemoteLockedFungibles, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "RemoteLockedFungibles", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, - 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, - 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, - 11u8, - ], - ) - } - #[doc = " Fungible assets which we know are locked on a remote chain."] - pub fn remote_locked_fungibles_iter2( - &self, - _0: types::remote_locked_fungibles::Param0, - _1: types::remote_locked_fungibles::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::remote_locked_fungibles::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::remote_locked_fungibles::Param1, - >, - ), - types::remote_locked_fungibles::RemoteLockedFungibles, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "RemoteLockedFungibles", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, - 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, - 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, - 11u8, + 59u8, 42u8, 220u8, 155u8, 38u8, 248u8, 254u8, 246u8, 245u8, 131u8, + 252u8, 31u8, 114u8, 228u8, 214u8, 231u8, 14u8, 1u8, 231u8, 22u8, 252u8, + 211u8, 223u8, 96u8, 154u8, 8u8, 16u8, 98u8, 231u8, 29u8, 221u8, 211u8, ], ) } #[doc = " Fungible assets which we know are locked on a remote chain."] pub fn remote_locked_fungibles( &self, - _0: types::remote_locked_fungibles::Param0, - _1: types::remote_locked_fungibles::Param1, - _2: types::remote_locked_fungibles::Param2, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::remote_locked_fungibles::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::remote_locked_fungibles::Param1, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::remote_locked_fungibles::Param2, - >, + remote_locked_fungibles::Param0, + remote_locked_fungibles::Param1, + remote_locked_fungibles::Param2, ), - types::remote_locked_fungibles::RemoteLockedFungibles, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + remote_locked_fungibles::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "RemoteLockedFungibles", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_2), - ), - [ - 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, - 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, - 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, - 11u8, - ], - ) - } - #[doc = " Fungible assets which we know are locked on this chain."] - pub fn locked_fungibles_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::locked_fungibles::LockedFungibles, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "LockedFungibles", - (), [ - 112u8, 157u8, 87u8, 224u8, 37u8, 77u8, 11u8, 17u8, 173u8, 230u8, 168u8, - 230u8, 33u8, 8u8, 209u8, 110u8, 182u8, 34u8, 118u8, 28u8, 15u8, 14u8, - 185u8, 50u8, 16u8, 52u8, 90u8, 125u8, 46u8, 20u8, 120u8, 136u8, + 114u8, 118u8, 146u8, 31u8, 45u8, 47u8, 200u8, 215u8, 188u8, 160u8, + 15u8, 42u8, 97u8, 38u8, 68u8, 201u8, 245u8, 60u8, 45u8, 113u8, 49u8, + 189u8, 67u8, 25u8, 129u8, 225u8, 113u8, 187u8, 36u8, 5u8, 179u8, 12u8, ], ) } #[doc = " Fungible assets which we know are locked on this chain."] pub fn locked_fungibles( &self, - _0: types::locked_fungibles::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::locked_fungibles::Param0, - >, - types::locked_fungibles::LockedFungibles, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (locked_fungibles::Param0,), + locked_fungibles::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "LockedFungibles", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 112u8, 157u8, 87u8, 224u8, 37u8, 77u8, 11u8, 17u8, 173u8, 230u8, 168u8, - 230u8, 33u8, 8u8, 209u8, 110u8, 182u8, 34u8, 118u8, 28u8, 15u8, 14u8, - 185u8, 50u8, 16u8, 52u8, 90u8, 125u8, 46u8, 20u8, 120u8, 136u8, + 134u8, 60u8, 79u8, 31u8, 80u8, 9u8, 36u8, 175u8, 149u8, 163u8, 102u8, + 227u8, 186u8, 18u8, 151u8, 112u8, 100u8, 192u8, 224u8, 173u8, 6u8, + 119u8, 83u8, 246u8, 180u8, 118u8, 214u8, 205u8, 118u8, 230u8, 46u8, + 38u8, ], ) } @@ -49660,19 +43898,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::xcm_execution_suspended::XcmExecutionSuspended, - ::subxt::ext::subxt_core::utils::Yes, + xcm_execution_suspended::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "XcmExecutionSuspended", - (), [ - 182u8, 54u8, 69u8, 68u8, 78u8, 76u8, 103u8, 79u8, 47u8, 136u8, 99u8, - 104u8, 128u8, 129u8, 249u8, 54u8, 214u8, 136u8, 97u8, 48u8, 178u8, - 42u8, 26u8, 27u8, 82u8, 24u8, 33u8, 77u8, 33u8, 27u8, 20u8, 127u8, + 72u8, 57u8, 186u8, 122u8, 214u8, 168u8, 225u8, 182u8, 180u8, 55u8, + 255u8, 78u8, 86u8, 41u8, 166u8, 52u8, 180u8, 152u8, 54u8, 238u8, 71u8, + 126u8, 123u8, 128u8, 3u8, 232u8, 190u8, 197u8, 54u8, 26u8, 53u8, 214u8, ], ) } @@ -49687,19 +43922,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::should_record_xcm::ShouldRecordXcm, + should_record_xcm::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "ShouldRecordXcm", - (), [ - 77u8, 184u8, 154u8, 92u8, 185u8, 225u8, 131u8, 210u8, 55u8, 115u8, 3u8, - 182u8, 191u8, 132u8, 51u8, 136u8, 42u8, 136u8, 54u8, 36u8, 229u8, - 229u8, 47u8, 88u8, 4u8, 175u8, 136u8, 78u8, 226u8, 253u8, 13u8, 178u8, + 31u8, 112u8, 200u8, 223u8, 113u8, 217u8, 66u8, 51u8, 47u8, 64u8, 79u8, + 244u8, 76u8, 150u8, 117u8, 209u8, 228u8, 128u8, 68u8, 89u8, 28u8, 78u8, + 56u8, 129u8, 43u8, 40u8, 196u8, 1u8, 26u8, 215u8, 108u8, 216u8, ], ) } @@ -49713,42 +43945,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::recorded_xcm::RecordedXcm, + recorded_xcm::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "RecordedXcm", - (), [ - 21u8, 172u8, 234u8, 160u8, 115u8, 240u8, 135u8, 8u8, 11u8, 62u8, 121u8, - 113u8, 13u8, 164u8, 179u8, 0u8, 139u8, 216u8, 216u8, 236u8, 135u8, - 116u8, 200u8, 199u8, 199u8, 249u8, 211u8, 0u8, 4u8, 86u8, 187u8, 198u8, - ], - ) - } - #[doc = " Map of authorized aliasers of local origins. Each local location can authorize a list of"] - #[doc = " other locations to alias into it. Each aliaser is only valid until its inner `expiry`"] - #[doc = " block number."] - pub fn authorized_aliases_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::authorized_aliases::AuthorizedAliases, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "XcmPallet", - "AuthorizedAliases", - (), - [ - 240u8, 28u8, 155u8, 219u8, 136u8, 114u8, 250u8, 219u8, 149u8, 37u8, - 248u8, 248u8, 115u8, 12u8, 249u8, 220u8, 104u8, 132u8, 84u8, 29u8, 4u8, - 70u8, 254u8, 69u8, 2u8, 16u8, 147u8, 58u8, 253u8, 171u8, 226u8, 48u8, + 243u8, 50u8, 131u8, 99u8, 1u8, 39u8, 229u8, 165u8, 68u8, 112u8, 24u8, + 203u8, 124u8, 111u8, 49u8, 143u8, 255u8, 118u8, 63u8, 170u8, 152u8, + 53u8, 162u8, 167u8, 239u8, 72u8, 84u8, 181u8, 204u8, 141u8, 98u8, + 242u8, ], ) } @@ -49757,28 +43964,172 @@ pub mod api { #[doc = " block number."] pub fn authorized_aliases( &self, - _0: types::authorized_aliases::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::authorized_aliases::Param0, - >, - types::authorized_aliases::AuthorizedAliases, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (authorized_aliases::Param0,), + authorized_aliases::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "XcmPallet", "AuthorizedAliases", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 240u8, 28u8, 155u8, 219u8, 136u8, 114u8, 250u8, 219u8, 149u8, 37u8, - 248u8, 248u8, 115u8, 12u8, 249u8, 220u8, 104u8, 132u8, 84u8, 29u8, 4u8, - 70u8, 254u8, 69u8, 2u8, 16u8, 147u8, 58u8, 253u8, 171u8, 226u8, 48u8, + 27u8, 158u8, 56u8, 147u8, 147u8, 86u8, 28u8, 161u8, 92u8, 193u8, 235u8, + 110u8, 9u8, 107u8, 155u8, 1u8, 42u8, 106u8, 22u8, 192u8, 28u8, 22u8, + 208u8, 40u8, 223u8, 157u8, 130u8, 202u8, 133u8, 50u8, 16u8, 80u8, ], ) } } + pub mod query_counter { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u64; + } + } + pub mod queries { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_xcm::pallet::QueryStatus<::core::primitive::u32>; + } + } + pub mod asset_traps { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod safe_xcm_version { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod supported_version { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod version_notifiers { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u64; + } + } + pub mod version_notify_targets { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ( + ::core::primitive::u64, + runtime_types::sp_weights::weight_v2::Weight, + ::core::primitive::u32, + ); + } + } + pub mod version_discovery_queue { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + runtime_types::xcm::VersionedLocation, + ::core::primitive::u32, + )>; + } + } + pub mod current_migration { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_xcm::pallet::VersionMigrationStage; + } + } + pub mod remote_locked_fungibles { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param2 = runtime_types::xcm::VersionedAssetId; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_xcm::pallet::RemoteLockedFungibleRecord<()>; + } + } + pub mod locked_fungibles { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u128, + runtime_types::xcm::VersionedLocation, + )>; + } + } + pub mod xcm_execution_suspended { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + pub mod should_record_xcm { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + pub mod recorded_xcm { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::staging_xcm::v5::Xcm; + } + } + pub mod authorized_aliases { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_xcm::AuthorizedAliasesEntry< + runtime_types::frame_support::traits::storage::Disabled, + runtime_types::pallet_xcm::pallet::MaxAuthorizedAliases, + >; + } + } } pub mod constants { use super::runtime_types; @@ -50315,37 +44666,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod authorities { - use super::runtime_types; - pub type Authorities = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >; - } - pub mod validator_set_id { - use super::runtime_types; - pub type ValidatorSetId = ::core::primitive::u64; - } - pub mod next_authorities { - use super::runtime_types; - pub type NextAuthorities = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, - >; - } - pub mod set_id_session { - use super::runtime_types; - pub type SetIdSession = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u64; - } - pub mod genesis_block { - use super::runtime_types; - pub type GenesisBlock = ::core::option::Option<::core::primitive::u32>; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The current authorities set"] @@ -50353,20 +44675,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::authorities::Authorities, - ::subxt::ext::subxt_core::utils::Yes, + authorities::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Beefy", "Authorities", - (), [ - 135u8, 146u8, 24u8, 144u8, 245u8, 251u8, 253u8, 63u8, 44u8, 46u8, 72u8, - 115u8, 190u8, 93u8, 201u8, 244u8, 80u8, 80u8, 156u8, 171u8, 69u8, - 126u8, 67u8, 51u8, 196u8, 136u8, 93u8, 176u8, 111u8, 247u8, 19u8, - 161u8, + 129u8, 238u8, 59u8, 157u8, 240u8, 52u8, 6u8, 97u8, 225u8, 217u8, 198u8, + 245u8, 159u8, 174u8, 80u8, 14u8, 101u8, 214u8, 215u8, 238u8, 141u8, + 58u8, 237u8, 109u8, 97u8, 222u8, 5u8, 249u8, 78u8, 177u8, 63u8, 98u8, ], ) } @@ -50375,20 +44693,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::validator_set_id::ValidatorSetId, + validator_set_id::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Beefy", "ValidatorSetId", - (), [ - 168u8, 84u8, 23u8, 134u8, 153u8, 30u8, 183u8, 176u8, 206u8, 100u8, - 109u8, 86u8, 109u8, 126u8, 146u8, 175u8, 173u8, 1u8, 253u8, 42u8, - 122u8, 207u8, 71u8, 4u8, 145u8, 83u8, 148u8, 29u8, 243u8, 52u8, 29u8, - 78u8, + 30u8, 45u8, 245u8, 167u8, 194u8, 24u8, 72u8, 254u8, 207u8, 115u8, 66u8, + 96u8, 171u8, 188u8, 181u8, 186u8, 204u8, 183u8, 254u8, 50u8, 61u8, + 105u8, 124u8, 255u8, 158u8, 69u8, 244u8, 71u8, 65u8, 228u8, 220u8, + 239u8, ], ) } @@ -50397,50 +44712,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_authorities::NextAuthorities, - ::subxt::ext::subxt_core::utils::Yes, + next_authorities::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Beefy", "NextAuthorities", - (), - [ - 183u8, 185u8, 111u8, 92u8, 70u8, 221u8, 225u8, 184u8, 218u8, 97u8, - 108u8, 66u8, 60u8, 148u8, 40u8, 73u8, 236u8, 28u8, 169u8, 32u8, 202u8, - 125u8, 238u8, 246u8, 210u8, 51u8, 25u8, 61u8, 220u8, 195u8, 156u8, - 217u8, - ], - ) - } - #[doc = " A mapping from BEEFY set ID to the index of the *most recent* session for which its"] - #[doc = " members were responsible."] - #[doc = ""] - #[doc = " This is only used for validating equivocation proofs. An equivocation proof must"] - #[doc = " contains a key-ownership proof for a given session, therefore we need a way to tie"] - #[doc = " together sessions and BEEFY set ids, i.e. we need to validate that a validator"] - #[doc = " was the owner of a given key on a given session, and what the active set ID was"] - #[doc = " during that session."] - #[doc = ""] - #[doc = " TWOX-NOTE: `ValidatorSetId` is not under user control."] - pub fn set_id_session_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::set_id_session::SetIdSession, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Beefy", - "SetIdSession", - (), [ - 47u8, 0u8, 239u8, 121u8, 187u8, 213u8, 254u8, 50u8, 238u8, 10u8, 162u8, - 65u8, 189u8, 166u8, 37u8, 74u8, 82u8, 81u8, 160u8, 20u8, 180u8, 253u8, - 238u8, 18u8, 209u8, 203u8, 38u8, 148u8, 16u8, 105u8, 72u8, 169u8, + 101u8, 99u8, 123u8, 119u8, 83u8, 228u8, 195u8, 75u8, 146u8, 83u8, + 248u8, 51u8, 42u8, 77u8, 14u8, 44u8, 80u8, 128u8, 32u8, 81u8, 137u8, + 48u8, 190u8, 252u8, 145u8, 11u8, 205u8, 152u8, 225u8, 182u8, 227u8, + 40u8, ], ) } @@ -50456,24 +44738,19 @@ pub mod api { #[doc = " TWOX-NOTE: `ValidatorSetId` is not under user control."] pub fn set_id_session( &self, - _0: types::set_id_session::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::set_id_session::Param0, - >, - types::set_id_session::SetIdSession, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (set_id_session::Param0,), + set_id_session::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Beefy", "SetIdSession", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 47u8, 0u8, 239u8, 121u8, 187u8, 213u8, 254u8, 50u8, 238u8, 10u8, 162u8, - 65u8, 189u8, 166u8, 37u8, 74u8, 82u8, 81u8, 160u8, 20u8, 180u8, 253u8, - 238u8, 18u8, 209u8, 203u8, 38u8, 148u8, 16u8, 105u8, 72u8, 169u8, + 103u8, 143u8, 223u8, 143u8, 232u8, 62u8, 107u8, 53u8, 99u8, 129u8, + 124u8, 35u8, 87u8, 83u8, 188u8, 228u8, 91u8, 129u8, 131u8, 154u8, + 208u8, 221u8, 54u8, 83u8, 144u8, 66u8, 54u8, 35u8, 72u8, 126u8, 97u8, + 63u8, ], ) } @@ -50484,23 +44761,65 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::genesis_block::GenesisBlock, + genesis_block::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Beefy", "GenesisBlock", - (), [ - 198u8, 155u8, 11u8, 240u8, 189u8, 245u8, 159u8, 127u8, 55u8, 33u8, - 48u8, 29u8, 209u8, 119u8, 163u8, 24u8, 28u8, 22u8, 163u8, 163u8, 124u8, - 88u8, 126u8, 4u8, 193u8, 158u8, 29u8, 243u8, 212u8, 4u8, 41u8, 22u8, + 231u8, 134u8, 22u8, 151u8, 56u8, 16u8, 22u8, 23u8, 157u8, 40u8, 38u8, + 255u8, 67u8, 247u8, 112u8, 186u8, 58u8, 22u8, 0u8, 200u8, 23u8, 106u8, + 153u8, 192u8, 253u8, 159u8, 132u8, 237u8, 253u8, 57u8, 245u8, 198u8, ], ) } } + pub mod authorities { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + >; + } + } + pub mod validator_set_id { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u64; + } + } + pub mod next_authorities { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::sp_consensus_beefy::ecdsa_crypto::Public, + >; + } + } + pub mod set_id_session { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod genesis_block { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option<::core::primitive::u32>; + } + } } pub mod constants { use super::runtime_types; @@ -50569,23 +44888,8 @@ pub mod api { use super::root_mod; use super::runtime_types; pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod root_hash { - use super::runtime_types; - pub type RootHash = ::subxt::ext::subxt_core::utils::H256; - } - pub mod number_of_leaves { - use super::runtime_types; - pub type NumberOfLeaves = ::core::primitive::u64; - } - pub mod nodes { - use super::runtime_types; - pub type Nodes = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u64; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Latest MMR Root hash."] @@ -50593,19 +44897,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::root_hash::RootHash, - ::subxt::ext::subxt_core::utils::Yes, + root_hash::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Mmr", "RootHash", - (), [ - 111u8, 206u8, 173u8, 92u8, 67u8, 49u8, 150u8, 113u8, 90u8, 245u8, 38u8, - 254u8, 76u8, 250u8, 167u8, 66u8, 130u8, 129u8, 251u8, 220u8, 172u8, - 229u8, 162u8, 251u8, 36u8, 227u8, 43u8, 189u8, 7u8, 106u8, 23u8, 13u8, + 75u8, 73u8, 139u8, 8u8, 218u8, 83u8, 29u8, 124u8, 160u8, 234u8, 247u8, + 187u8, 83u8, 146u8, 232u8, 55u8, 99u8, 59u8, 100u8, 170u8, 163u8, 92u8, + 241u8, 141u8, 191u8, 225u8, 245u8, 255u8, 71u8, 254u8, 225u8, 168u8, ], ) } @@ -50614,43 +44915,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::number_of_leaves::NumberOfLeaves, - ::subxt::ext::subxt_core::utils::Yes, + number_of_leaves::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Mmr", "NumberOfLeaves", - (), - [ - 123u8, 58u8, 149u8, 174u8, 85u8, 45u8, 20u8, 115u8, 241u8, 0u8, 51u8, - 174u8, 234u8, 60u8, 230u8, 59u8, 237u8, 144u8, 170u8, 32u8, 4u8, 0u8, - 34u8, 163u8, 238u8, 205u8, 93u8, 208u8, 53u8, 38u8, 141u8, 195u8, - ], - ) - } - #[doc = " Hashes of the nodes in the MMR."] - #[doc = ""] - #[doc = " Note this collection only contains MMR peaks, the inner nodes (and leaves)"] - #[doc = " are pruned and only stored in the Offchain DB."] - pub fn nodes_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::nodes::Nodes, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Mmr", - "Nodes", - (), [ - 27u8, 84u8, 41u8, 195u8, 146u8, 81u8, 211u8, 189u8, 63u8, 125u8, 173u8, - 206u8, 69u8, 198u8, 202u8, 213u8, 89u8, 31u8, 89u8, 177u8, 76u8, 154u8, - 249u8, 197u8, 133u8, 78u8, 142u8, 71u8, 183u8, 3u8, 132u8, 25u8, + 21u8, 8u8, 165u8, 119u8, 90u8, 75u8, 149u8, 200u8, 24u8, 102u8, 107u8, + 131u8, 0u8, 198u8, 99u8, 110u8, 218u8, 151u8, 51u8, 141u8, 224u8, 52u8, + 175u8, 17u8, 213u8, 157u8, 196u8, 99u8, 164u8, 0u8, 13u8, 65u8, ], ) } @@ -50660,52 +44934,56 @@ pub mod api { #[doc = " are pruned and only stored in the Offchain DB."] pub fn nodes( &self, - _0: types::nodes::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::nodes::Param0, - >, - types::nodes::Nodes, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (nodes::Param0,), + nodes::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Mmr", "Nodes", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 27u8, 84u8, 41u8, 195u8, 146u8, 81u8, 211u8, 189u8, 63u8, 125u8, 173u8, - 206u8, 69u8, 198u8, 202u8, 213u8, 89u8, 31u8, 89u8, 177u8, 76u8, 154u8, - 249u8, 197u8, 133u8, 78u8, 142u8, 71u8, 183u8, 3u8, 132u8, 25u8, + 46u8, 17u8, 58u8, 59u8, 201u8, 9u8, 131u8, 30u8, 105u8, 7u8, 12u8, + 122u8, 36u8, 41u8, 62u8, 119u8, 250u8, 225u8, 21u8, 190u8, 250u8, + 175u8, 12u8, 230u8, 183u8, 138u8, 31u8, 133u8, 102u8, 237u8, 174u8, + 113u8, ], ) } } + pub mod root_hash { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } + pub mod number_of_leaves { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u64; + } + } + pub mod nodes { + use super::root_mod; + use super::runtime_types; + pub type Param0 = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::H256; + } + } } } pub mod mmr_leaf { use super::root_mod; use super::runtime_types; pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod beefy_authorities { - use super::runtime_types; - pub type BeefyAuthorities = - runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, - >; - } - pub mod beefy_next_authorities { - use super::runtime_types; - pub type BeefyNextAuthorities = - runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< - ::subxt::ext::subxt_core::utils::H256, - >; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Details of current BEEFY authority set."] @@ -50713,20 +44991,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::beefy_authorities::BeefyAuthorities, + beefy_authorities::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "MmrLeaf", "BeefyAuthorities", - (), [ - 128u8, 35u8, 176u8, 79u8, 224u8, 58u8, 214u8, 234u8, 231u8, 71u8, - 227u8, 153u8, 180u8, 189u8, 66u8, 44u8, 47u8, 174u8, 0u8, 83u8, 121u8, - 182u8, 226u8, 44u8, 224u8, 173u8, 237u8, 102u8, 231u8, 146u8, 110u8, - 7u8, + 3u8, 211u8, 249u8, 8u8, 253u8, 195u8, 128u8, 54u8, 189u8, 71u8, 231u8, + 242u8, 168u8, 85u8, 197u8, 239u8, 37u8, 99u8, 146u8, 203u8, 197u8, + 101u8, 48u8, 244u8, 129u8, 40u8, 101u8, 77u8, 95u8, 181u8, 160u8, 66u8, ], ) } @@ -50737,23 +45011,40 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::beefy_next_authorities::BeefyNextAuthorities, - ::subxt::ext::subxt_core::utils::Yes, + beefy_next_authorities::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "MmrLeaf", "BeefyNextAuthorities", - (), [ - 97u8, 71u8, 52u8, 111u8, 120u8, 251u8, 183u8, 155u8, 177u8, 100u8, - 236u8, 142u8, 204u8, 117u8, 95u8, 40u8, 201u8, 36u8, 32u8, 82u8, 38u8, - 234u8, 135u8, 39u8, 224u8, 69u8, 94u8, 85u8, 12u8, 89u8, 97u8, 218u8, + 103u8, 17u8, 96u8, 101u8, 193u8, 214u8, 64u8, 27u8, 223u8, 54u8, 32u8, + 221u8, 52u8, 231u8, 57u8, 138u8, 25u8, 192u8, 81u8, 68u8, 172u8, 197u8, + 182u8, 203u8, 212u8, 45u8, 120u8, 63u8, 49u8, 147u8, 33u8, 80u8, ], ) } } + pub mod beefy_authorities { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< + ::subxt::ext::subxt_core::utils::H256, + >; + } + } + pub mod beefy_next_authorities { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_consensus_beefy::mmr::BeefyAuthoritySet< + ::subxt::ext::subxt_core::utils::H256, + >; + } + } } } pub mod identity_migrator { @@ -51531,86 +45822,25 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod permanent_slots { - use super::runtime_types; - pub type PermanentSlots = (::core::primitive::u32, ::core::primitive::u32); - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod permanent_slot_count { - use super::runtime_types; - pub type PermanentSlotCount = ::core::primitive::u32; - } - pub mod temporary_slots { - use super::runtime_types; - pub type TemporarySlots = runtime_types :: polkadot_runtime_common :: assigned_slots :: ParachainTemporarySlot < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , :: core :: primitive :: u32 > ; - pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; - } - pub mod temporary_slot_count { - use super::runtime_types; - pub type TemporarySlotCount = ::core::primitive::u32; - } - pub mod active_temporary_slot_count { - use super::runtime_types; - pub type ActiveTemporarySlotCount = ::core::primitive::u32; - } - pub mod max_temporary_slots { - use super::runtime_types; - pub type MaxTemporarySlots = ::core::primitive::u32; - } - pub mod max_permanent_slots { - use super::runtime_types; - pub type MaxPermanentSlots = ::core::primitive::u32; - } - } pub struct StorageApi; impl StorageApi { - #[doc = " Assigned permanent slots, with their start lease period, and duration."] - pub fn permanent_slots_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::permanent_slots::PermanentSlots, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssignedSlots", - "PermanentSlots", - (), - [ - 133u8, 179u8, 221u8, 222u8, 50u8, 75u8, 158u8, 137u8, 167u8, 190u8, - 19u8, 237u8, 201u8, 44u8, 86u8, 64u8, 57u8, 61u8, 96u8, 112u8, 218u8, - 186u8, 176u8, 58u8, 143u8, 61u8, 105u8, 13u8, 103u8, 162u8, 188u8, - 154u8, - ], - ) - } #[doc = " Assigned permanent slots, with their start lease period, and duration."] pub fn permanent_slots( &self, - _0: types::permanent_slots::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::permanent_slots::Param0, - >, - types::permanent_slots::PermanentSlots, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (permanent_slots::Param0,), + permanent_slots::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssignedSlots", "PermanentSlots", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 133u8, 179u8, 221u8, 222u8, 50u8, 75u8, 158u8, 137u8, 167u8, 190u8, - 19u8, 237u8, 201u8, 44u8, 86u8, 64u8, 57u8, 61u8, 96u8, 112u8, 218u8, - 186u8, 176u8, 58u8, 143u8, 61u8, 105u8, 13u8, 103u8, 162u8, 188u8, - 154u8, + 55u8, 13u8, 82u8, 200u8, 170u8, 210u8, 155u8, 24u8, 66u8, 217u8, 207u8, + 195u8, 139u8, 118u8, 129u8, 105u8, 119u8, 166u8, 180u8, 89u8, 195u8, + 3u8, 17u8, 126u8, 55u8, 29u8, 189u8, 53u8, 231u8, 88u8, 165u8, 40u8, ], ) } @@ -51619,66 +45849,35 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::permanent_slot_count::PermanentSlotCount, - ::subxt::ext::subxt_core::utils::Yes, + permanent_slot_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssignedSlots", "PermanentSlotCount", - (), [ - 57u8, 211u8, 19u8, 233u8, 105u8, 201u8, 166u8, 99u8, 53u8, 217u8, 23u8, - 64u8, 216u8, 129u8, 21u8, 36u8, 234u8, 24u8, 57u8, 99u8, 13u8, 205u8, - 201u8, 78u8, 28u8, 96u8, 232u8, 62u8, 91u8, 235u8, 157u8, 213u8, - ], - ) - } - #[doc = " Assigned temporary slots."] - pub fn temporary_slots_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::temporary_slots::TemporarySlots, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssignedSlots", - "TemporarySlots", - (), - [ - 184u8, 245u8, 181u8, 90u8, 169u8, 232u8, 108u8, 3u8, 153u8, 4u8, 176u8, - 170u8, 230u8, 163u8, 236u8, 111u8, 196u8, 218u8, 154u8, 125u8, 102u8, - 216u8, 195u8, 126u8, 99u8, 90u8, 242u8, 141u8, 214u8, 165u8, 32u8, - 57u8, + 30u8, 133u8, 205u8, 149u8, 181u8, 225u8, 65u8, 119u8, 176u8, 245u8, + 48u8, 17u8, 218u8, 82u8, 142u8, 169u8, 201u8, 90u8, 220u8, 183u8, 49u8, + 23u8, 210u8, 45u8, 93u8, 250u8, 159u8, 53u8, 68u8, 145u8, 194u8, 72u8, ], ) } #[doc = " Assigned temporary slots."] pub fn temporary_slots( &self, - _0: types::temporary_slots::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::temporary_slots::Param0, - >, - types::temporary_slots::TemporarySlots, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + (temporary_slots::Param0,), + temporary_slots::output::Output, + ::subxt::ext::subxt_core::utils::Maybe, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssignedSlots", "TemporarySlots", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 184u8, 245u8, 181u8, 90u8, 169u8, 232u8, 108u8, 3u8, 153u8, 4u8, 176u8, - 170u8, 230u8, 163u8, 236u8, 111u8, 196u8, 218u8, 154u8, 125u8, 102u8, - 216u8, 195u8, 126u8, 99u8, 90u8, 242u8, 141u8, 214u8, 165u8, 32u8, - 57u8, + 88u8, 78u8, 79u8, 168u8, 158u8, 114u8, 75u8, 174u8, 77u8, 180u8, 55u8, + 235u8, 91u8, 177u8, 103u8, 98u8, 59u8, 234u8, 163u8, 161u8, 98u8, + 254u8, 49u8, 76u8, 49u8, 196u8, 134u8, 155u8, 136u8, 14u8, 235u8, + 133u8, ], ) } @@ -51687,19 +45886,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::temporary_slot_count::TemporarySlotCount, - ::subxt::ext::subxt_core::utils::Yes, + temporary_slot_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssignedSlots", "TemporarySlotCount", - (), [ - 218u8, 236u8, 69u8, 75u8, 224u8, 60u8, 9u8, 197u8, 217u8, 4u8, 210u8, - 55u8, 125u8, 106u8, 239u8, 208u8, 115u8, 105u8, 94u8, 223u8, 219u8, - 27u8, 175u8, 161u8, 120u8, 168u8, 36u8, 239u8, 136u8, 228u8, 7u8, 15u8, + 88u8, 150u8, 30u8, 239u8, 85u8, 125u8, 239u8, 105u8, 119u8, 109u8, + 35u8, 154u8, 28u8, 172u8, 164u8, 110u8, 113u8, 142u8, 30u8, 124u8, + 255u8, 216u8, 91u8, 131u8, 173u8, 14u8, 39u8, 71u8, 24u8, 72u8, 97u8, + 2u8, ], ) } @@ -51708,20 +45905,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::active_temporary_slot_count::ActiveTemporarySlotCount, - ::subxt::ext::subxt_core::utils::Yes, + active_temporary_slot_count::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssignedSlots", "ActiveTemporarySlotCount", - (), [ - 153u8, 99u8, 232u8, 164u8, 137u8, 10u8, 232u8, 172u8, 78u8, 4u8, 69u8, - 178u8, 245u8, 220u8, 56u8, 251u8, 60u8, 238u8, 127u8, 246u8, 60u8, - 11u8, 240u8, 185u8, 2u8, 194u8, 69u8, 212u8, 173u8, 205u8, 205u8, - 198u8, + 165u8, 158u8, 196u8, 108u8, 223u8, 22u8, 90u8, 56u8, 15u8, 194u8, + 179u8, 46u8, 11u8, 153u8, 209u8, 235u8, 32u8, 119u8, 194u8, 35u8, + 209u8, 120u8, 77u8, 158u8, 140u8, 55u8, 9u8, 189u8, 203u8, 21u8, 212u8, + 10u8, ], ) } @@ -51730,20 +45924,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::max_temporary_slots::MaxTemporarySlots, - ::subxt::ext::subxt_core::utils::Yes, + max_temporary_slots::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssignedSlots", "MaxTemporarySlots", - (), [ - 129u8, 130u8, 136u8, 77u8, 149u8, 130u8, 130u8, 195u8, 150u8, 114u8, - 199u8, 133u8, 86u8, 252u8, 149u8, 149u8, 131u8, 248u8, 70u8, 39u8, - 22u8, 101u8, 175u8, 13u8, 32u8, 138u8, 81u8, 20u8, 41u8, 46u8, 238u8, - 187u8, + 31u8, 249u8, 142u8, 22u8, 188u8, 227u8, 88u8, 84u8, 30u8, 20u8, 138u8, + 120u8, 142u8, 17u8, 201u8, 63u8, 154u8, 29u8, 7u8, 95u8, 149u8, 88u8, + 87u8, 223u8, 211u8, 226u8, 233u8, 151u8, 70u8, 120u8, 79u8, 231u8, ], ) } @@ -51752,24 +45942,79 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::max_permanent_slots::MaxPermanentSlots, + max_permanent_slots::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "AssignedSlots", "MaxPermanentSlots", - (), [ - 20u8, 72u8, 203u8, 62u8, 120u8, 21u8, 97u8, 9u8, 138u8, 135u8, 67u8, - 152u8, 131u8, 197u8, 59u8, 80u8, 226u8, 148u8, 159u8, 122u8, 34u8, - 86u8, 162u8, 80u8, 208u8, 151u8, 43u8, 164u8, 120u8, 33u8, 144u8, - 118u8, + 199u8, 227u8, 106u8, 254u8, 170u8, 171u8, 78u8, 228u8, 213u8, 174u8, + 240u8, 79u8, 221u8, 113u8, 168u8, 66u8, 102u8, 216u8, 99u8, 190u8, + 122u8, 11u8, 154u8, 214u8, 251u8, 235u8, 90u8, 35u8, 129u8, 196u8, + 63u8, 4u8, ], ) } } + pub mod permanent_slots { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = (::core::primitive::u32, ::core::primitive::u32); + } + } + pub mod permanent_slot_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod temporary_slots { + use super::root_mod; + use super::runtime_types; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types :: polkadot_runtime_common :: assigned_slots :: ParachainTemporarySlot < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , :: core :: primitive :: u32 > ; + } + } + pub mod temporary_slot_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod active_temporary_slot_count { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod max_temporary_slots { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + pub mod max_permanent_slots { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } } pub mod constants { use super::runtime_types; @@ -51983,22 +46228,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod validators_to_retire { - use super::runtime_types; - pub type ValidatorsToRetire = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - } - pub mod validators_to_add { - use super::runtime_types; - pub type ValidatorsToAdd = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Validators that should be retired, because their Parachain was deregistered."] @@ -52006,19 +46237,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::validators_to_retire::ValidatorsToRetire, - ::subxt::ext::subxt_core::utils::Yes, + validators_to_retire::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ValidatorManager", "ValidatorsToRetire", - (), [ - 137u8, 92u8, 99u8, 157u8, 254u8, 166u8, 190u8, 64u8, 111u8, 212u8, - 37u8, 90u8, 164u8, 0u8, 31u8, 15u8, 83u8, 21u8, 225u8, 7u8, 57u8, - 104u8, 64u8, 192u8, 58u8, 38u8, 36u8, 133u8, 181u8, 229u8, 200u8, 65u8, + 95u8, 177u8, 236u8, 19u8, 122u8, 148u8, 46u8, 161u8, 163u8, 156u8, + 159u8, 14u8, 116u8, 136u8, 244u8, 27u8, 46u8, 106u8, 71u8, 246u8, + 143u8, 46u8, 218u8, 196u8, 6u8, 81u8, 110u8, 71u8, 76u8, 189u8, 95u8, + 80u8, ], ) } @@ -52027,24 +46256,41 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::validators_to_add::ValidatorsToAdd, - ::subxt::ext::subxt_core::utils::Yes, + validators_to_add::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "ValidatorManager", "ValidatorsToAdd", - (), [ - 168u8, 209u8, 123u8, 225u8, 168u8, 62u8, 18u8, 174u8, 164u8, 161u8, - 228u8, 179u8, 251u8, 112u8, 210u8, 173u8, 24u8, 177u8, 111u8, 129u8, - 97u8, 230u8, 231u8, 103u8, 72u8, 104u8, 222u8, 156u8, 190u8, 150u8, - 147u8, 68u8, + 157u8, 236u8, 85u8, 76u8, 121u8, 194u8, 148u8, 248u8, 207u8, 13u8, + 246u8, 146u8, 87u8, 211u8, 216u8, 209u8, 124u8, 64u8, 64u8, 85u8, + 103u8, 125u8, 175u8, 49u8, 20u8, 199u8, 246u8, 242u8, 12u8, 187u8, + 126u8, 209u8, ], ) } } + pub mod validators_to_retire { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + } + } + pub mod validators_to_add { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + } + } } } pub mod state_trie_migration { @@ -52508,26 +46754,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod migration_process { - use super::runtime_types; - pub type MigrationProcess = - runtime_types::pallet_state_trie_migration::pallet::MigrationTask; - } - pub mod auto_limits { - use super::runtime_types; - pub type AutoLimits = ::core::option::Option< - runtime_types::pallet_state_trie_migration::pallet::MigrationLimits, - >; - } - pub mod signed_migration_max_limits { - use super::runtime_types; - pub type SignedMigrationMaxLimits = - runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; - } - } pub struct StorageApi; impl StorageApi { #[doc = " Migration progress."] @@ -52538,19 +46766,16 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::migration_process::MigrationProcess, + migration_process::output::Output, ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "StateTrieMigration", "MigrationProcess", - (), [ - 119u8, 172u8, 143u8, 118u8, 90u8, 3u8, 154u8, 185u8, 165u8, 165u8, - 249u8, 230u8, 77u8, 14u8, 221u8, 146u8, 75u8, 243u8, 69u8, 209u8, 79u8, - 253u8, 28u8, 64u8, 243u8, 45u8, 29u8, 1u8, 22u8, 127u8, 0u8, 66u8, + 51u8, 167u8, 58u8, 73u8, 58u8, 224u8, 152u8, 28u8, 139u8, 175u8, 149u8, + 90u8, 21u8, 93u8, 165u8, 203u8, 140u8, 168u8, 192u8, 21u8, 142u8, + 132u8, 41u8, 89u8, 52u8, 159u8, 253u8, 159u8, 115u8, 40u8, 207u8, 82u8, ], ) } @@ -52561,19 +46786,17 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::auto_limits::AutoLimits, - ::subxt::ext::subxt_core::utils::Yes, + auto_limits::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "StateTrieMigration", "AutoLimits", - (), [ - 225u8, 29u8, 94u8, 66u8, 169u8, 230u8, 106u8, 20u8, 238u8, 81u8, 238u8, - 183u8, 185u8, 74u8, 94u8, 58u8, 107u8, 174u8, 228u8, 10u8, 156u8, - 225u8, 95u8, 75u8, 208u8, 227u8, 58u8, 147u8, 161u8, 68u8, 158u8, 99u8, + 51u8, 37u8, 12u8, 255u8, 179u8, 210u8, 206u8, 206u8, 130u8, 127u8, + 85u8, 44u8, 154u8, 187u8, 123u8, 85u8, 160u8, 227u8, 144u8, 170u8, + 79u8, 147u8, 217u8, 224u8, 55u8, 234u8, 160u8, 3u8, 210u8, 233u8, + 133u8, 237u8, ], ) } @@ -52584,24 +46807,49 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::signed_migration_max_limits::SignedMigrationMaxLimits, + signed_migration_max_limits::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "StateTrieMigration", "SignedMigrationMaxLimits", - (), [ - 121u8, 97u8, 145u8, 237u8, 10u8, 145u8, 206u8, 119u8, 15u8, 12u8, - 200u8, 24u8, 231u8, 140u8, 248u8, 227u8, 202u8, 78u8, 93u8, 134u8, - 144u8, 79u8, 55u8, 136u8, 89u8, 52u8, 49u8, 64u8, 136u8, 249u8, 245u8, - 175u8, + 107u8, 156u8, 193u8, 54u8, 144u8, 67u8, 33u8, 160u8, 234u8, 28u8, 87u8, + 96u8, 113u8, 54u8, 150u8, 118u8, 191u8, 10u8, 242u8, 140u8, 112u8, + 24u8, 84u8, 94u8, 243u8, 247u8, 30u8, 179u8, 231u8, 108u8, 186u8, + 157u8, ], ) } } + pub mod migration_process { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_state_trie_migration::pallet::MigrationTask; + } + } + pub mod auto_limits { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::pallet_state_trie_migration::pallet::MigrationLimits, + >; + } + } + pub mod signed_migration_max_limits { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_state_trie_migration::pallet::MigrationLimits; + } + } } pub mod constants { use super::runtime_types; @@ -53088,14 +47336,8 @@ pub mod api { } } pub mod storage { + use super::root_mod; use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod key { - use super::runtime_types; - pub type Key = ::subxt::ext::subxt_core::utils::AccountId32; - } - } pub struct StorageApi; impl StorageApi { #[doc = " The `AccountId` of the sudo key."] @@ -53103,23 +47345,29 @@ pub mod api { &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::key::Key, + key::output::Output, ::subxt::ext::subxt_core::utils::Yes, - (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Sudo", "Key", - (), [ - 72u8, 14u8, 225u8, 162u8, 205u8, 247u8, 227u8, 105u8, 116u8, 57u8, 4u8, - 31u8, 84u8, 137u8, 227u8, 228u8, 133u8, 245u8, 206u8, 227u8, 117u8, - 36u8, 252u8, 151u8, 107u8, 15u8, 180u8, 4u8, 4u8, 152u8, 195u8, 144u8, + 135u8, 9u8, 151u8, 148u8, 179u8, 127u8, 153u8, 3u8, 158u8, 91u8, 244u8, + 242u8, 201u8, 85u8, 31u8, 10u8, 151u8, 125u8, 201u8, 113u8, 15u8, + 104u8, 164u8, 246u8, 174u8, 14u8, 251u8, 184u8, 57u8, 223u8, 162u8, + 139u8, ], ) } } + pub mod key { + use super::root_mod; + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::utils::AccountId32; + } + } } } pub mod runtime_types { diff --git a/testing/integration-tests/src/full_client/frame/balances.rs b/testing/integration-tests/src/full_client/frame/balances.rs index 1054a99aecb..89f8581aa56 100644 --- a/testing/integration-tests/src/full_client/frame/balances.rs +++ b/testing/integration-tests/src/full_client/frame/balances.rs @@ -8,7 +8,8 @@ use crate::{ }; use codec::Decode; use subxt::{ - error::{DispatchError, Error, TokenError}, + error::{DispatchError, TokenError, TransactionEventsError, TransactionFinalizedSuccessError}, + ext::scale_decode::DecodeAsType, utils::{AccountId32, MultiAddress}, }; use subxt_signer::sr25519::dev; @@ -21,25 +22,20 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let alice_account_addr = node_runtime::storage() - .system() - .account(alice.public_key().to_account_id()); - let bob_account_addr = node_runtime::storage() - .system() - .account(bob.public_key().to_account_id()); + let account_addr = node_runtime::storage().system().account(); - let alice_pre = api - .storage() - .at_latest() + let storage_at_pre = api.storage().at_latest().await?; + let account_entry_pre = storage_at_pre.entry(&account_addr)?; + + let alice_pre = account_entry_pre + .fetch((alice.public_key().to_account_id(),)) .await? - .fetch_or_default(&alice_account_addr) - .await?; - let bob_pre = api - .storage() - .at_latest() + .decode()?; + + let bob_pre = account_entry_pre + .fetch((bob.public_key().to_account_id(),)) .await? - .fetch_or_default(&bob_account_addr) - .await?; + .decode()?; let tx = node_runtime::tx() .balances() @@ -73,18 +69,18 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> { }; assert_eq!(event, expected_event); - let alice_post = api - .storage() - .at_latest() + let storage_at_post = api.storage().at_latest().await?; + let account_entry_post = storage_at_post.entry(&account_addr)?; + + let alice_post = account_entry_post + .fetch((alice.public_key().to_account_id(),)) .await? - .fetch_or_default(&alice_account_addr) - .await?; - let bob_post = api - .storage() - .at_latest() + .decode()?; + + let bob_post = account_entry_post + .fetch((bob.public_key().to_account_id(),)) .await? - .fetch_or_default(&bob_account_addr) - .await?; + .decode()?; assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); @@ -94,36 +90,27 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> { #[cfg(fullclient)] #[subxt_test] async fn tx_dynamic_transfer() -> Result<(), subxt::Error> { - use subxt::ext::scale_value::{At, Composite, Value}; + use subxt::ext::scale_value::{At, Value}; let alice = dev::alice(); let bob = dev::bob(); let ctx = test_context().await; let api = ctx.client(); - let alice_account_addr = subxt::dynamic::storage( - "System", - "Account", - vec![Value::from_bytes(alice.public_key().to_account_id())], - ); - let bob_account_addr = subxt::dynamic::storage( - "System", - "Account", - vec![Value::from_bytes(bob.public_key().to_account_id())], - ); + let account_addr = subxt::dynamic::storage::<(Value,), Value>("System", "Account"); - let alice_pre = api - .storage() - .at_latest() + let storage_at_pre = api.storage().at_latest().await?; + let account_entry_pre = storage_at_pre.entry(&account_addr)?; + + let alice_pre = account_entry_pre + .fetch((Value::from_bytes(alice.public_key().to_account_id()),)) .await? - .fetch_or_default(&alice_account_addr) - .await?; - let bob_pre = api - .storage() - .at_latest() + .decode()?; + + let bob_pre = account_entry_pre + .fetch((Value::from_bytes(bob.public_key().to_account_id()),)) .await? - .fetch_or_default(&bob_account_addr) - .await?; + .decode()?; let tx = subxt::dynamic::tx( "Balances", @@ -144,69 +131,48 @@ async fn tx_dynamic_transfer() -> Result<(), subxt::Error> { .wait_for_finalized_success() .await?; - let event_fields = events + let actual_transfer_event = events .iter() .filter_map(|ev| ev.ok()) .find(|ev| ev.pallet_name() == "Balances" && ev.variant_name() == "Transfer") .expect("Failed to find Transfer event") - .field_values()? - .map_context(|_| ()); - - let expected_fields = Composite::Named(vec![ - ( - "from".into(), - Value::unnamed_composite(vec![Value::from_bytes(alice.public_key().to_account_id())]), - ), - ( - "to".into(), - Value::unnamed_composite(vec![Value::from_bytes(bob.public_key().to_account_id())]), - ), - ("amount".into(), Value::u128(10_000)), - ]); - assert_eq!(event_fields, expected_fields); - - let alice_post = api - .storage() - .at_latest() + .decode_as_fields::() + .expect("Failed to decode event fields"); + + #[derive(DecodeAsType, Debug, PartialEq)] + #[decode_as_type(crate_path = "::subxt::ext::scale_decode")] + struct DecodedTransferEvent { + from: AccountId32, + to: AccountId32, + amount: u128, + } + + let expected_transfer_event = DecodedTransferEvent { + from: alice.public_key().to_account_id(), + to: bob.public_key().to_account_id(), + amount: 10000, + }; + + assert_eq!(actual_transfer_event, expected_transfer_event); + + let storage_at_post = api.storage().at_latest().await?; + let account_entry_post = storage_at_post.entry(&account_addr)?; + + let alice_post = account_entry_post + .fetch((Value::from_bytes(alice.public_key().to_account_id()),)) .await? - .fetch_or_default(&alice_account_addr) - .await?; - let bob_post = api - .storage() - .at_latest() + .decode()?; + + let bob_post = account_entry_post + .fetch((Value::from_bytes(bob.public_key().to_account_id()),)) .await? - .fetch_or_default(&bob_account_addr) - .await?; + .decode()?; - let alice_pre_free = alice_pre - .to_value()? - .at("data") - .at("free") - .unwrap() - .as_u128() - .unwrap(); - let alice_post_free = alice_post - .to_value()? - .at("data") - .at("free") - .unwrap() - .as_u128() - .unwrap(); + let alice_pre_free = alice_pre.at("data").at("free").unwrap().as_u128().unwrap(); + let alice_post_free = alice_post.at("data").at("free").unwrap().as_u128().unwrap(); - let bob_pre_free = bob_pre - .to_value()? - .at("data") - .at("free") - .unwrap() - .as_u128() - .unwrap(); - let bob_post_free = bob_post - .to_value()? - .at("data") - .at("free") - .unwrap() - .as_u128() - .unwrap(); + let bob_pre_free = bob_pre.at("data").at("free").unwrap().as_u128().unwrap(); + let bob_post_free = bob_post.at("data").at("free").unwrap().as_u128().unwrap(); assert!(alice_pre_free - 10_000 >= alice_post_free); assert_eq!(bob_pre_free + 10_000, bob_post_free); @@ -222,16 +188,16 @@ async fn multiple_sequential_transfers_work() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let bob_account_info_addr = node_runtime::storage() - .system() - .account(bob.public_key().to_account_id()); - let bob_pre = api .storage() .at_latest() .await? - .fetch_or_default(&bob_account_info_addr) - .await?; + .fetch( + node_runtime::storage().system().account(), + (bob.public_key().to_account_id(),), + ) + .await? + .decode()?; // Do a transfer several times. If this works, it indicates that the // nonce is properly incremented each time. @@ -246,8 +212,7 @@ async fn multiple_sequential_transfers_work() -> Result<(), subxt::Error> { signed_extrinsic .submit_and_watch() - .await - .unwrap() + .await? .wait_for_finalized_success() .await?; } @@ -256,8 +221,12 @@ async fn multiple_sequential_transfers_work() -> Result<(), subxt::Error> { .storage() .at_latest() .await? - .fetch_or_default(&bob_account_info_addr) - .await?; + .fetch( + node_runtime::storage().system().account(), + (bob.public_key().to_account_id(),), + ) + .await? + .decode()?; assert_eq!(bob_pre.data.free + 30_000, bob_post.data.free); Ok(()) @@ -274,8 +243,12 @@ async fn storage_total_issuance() { .at_latest() .await .unwrap() - .fetch_or_default(&addr) + .entry(addr) + .unwrap() + .fetch() .await + .unwrap() + .decode() .unwrap(); assert_ne!(total_issuance, 0); } @@ -286,14 +259,15 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let holds_addr = node_runtime::storage().balances().holds(bob); + let holds_addr = node_runtime::storage().balances().holds(); let holds = api .storage() .at_latest() .await? - .fetch_or_default(&holds_addr) + .fetch(holds_addr, (bob,)) .await? + .decode()? .0; assert_eq!(holds.len(), 0); @@ -345,13 +319,18 @@ async fn transfer_error() { .wait_for_finalized_success() .await; - assert!( - matches!( - res, - Err(Error::Runtime(DispatchError::Token( + // Check that we get a FundsUnavailable error + let is_funds_unavailable = matches!( + res, + Err(TransactionFinalizedSuccessError::SuccessError( + TransactionEventsError::ExtrinsicFailed(DispatchError::Token( TokenError::FundsUnavailable - ))) - ), + )), + )) + ); + + assert!( + is_funds_unavailable, "Expected an insufficient balance, got {res:?}" ); } diff --git a/testing/integration-tests/src/full_client/frame/contracts.rs b/testing/integration-tests/src/full_client/frame/contracts.rs index 60e3be3e2fa..3013ff85341 100644 --- a/testing/integration-tests/src/full_client/frame/contracts.rs +++ b/testing/integration-tests/src/full_client/frame/contracts.rs @@ -75,7 +75,8 @@ impl ContractsTestContext { let code_stored = events .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a CodeStored event".into()))?; + .ok_or_else(|| Error::other_str("Failed to find a CodeStored event"))?; + Ok(code_stored.code_hash) } @@ -109,13 +110,13 @@ impl ContractsTestContext { let code_stored = events .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a CodeStored event".into()))?; + .ok_or_else(|| Error::other_str("Failed to find a CodeStored event"))?; let instantiated = events .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; + .ok_or_else(|| Error::other_str("Failed to find a Instantiated event"))?; let _extrinsic_success = events .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a ExtrinsicSuccess event".into()))?; + .ok_or_else(|| Error::other_str("Failed to find a ExtrinsicSuccess event"))?; tracing::info!(" Code hash: {:?}", code_stored.code_hash); tracing::info!(" Contract address: {:?}", instantiated.contract); @@ -156,7 +157,7 @@ impl ContractsTestContext { tracing::info!("Instantiate result: {:?}", result); let instantiated = result .find_first::()? - .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; + .ok_or_else(|| Error::other_str("Failed to find a Instantiated event"))?; Ok(instantiated.contract) } @@ -218,37 +219,26 @@ async fn tx_call() { let cxt = ContractsTestContext::init().await; let (_, contract) = cxt.instantiate_with_code().await.unwrap(); - let info_addr = node_runtime::storage() - .contracts() - .contract_info_of(contract.clone()); + let storage_at = cxt.client().storage().at_latest().await.unwrap(); + + let contract_info_addr = node_runtime::storage().contracts().contract_info_of(); - let contract_info = cxt - .client() - .storage() - .at_latest() + let contract_info = storage_at + .fetch(&contract_info_addr, (contract.clone(),)) .await - .unwrap() - .fetch(&info_addr) - .await; + .unwrap(); assert!( - contract_info.is_ok(), + contract_info.decode().is_ok(), "Contract info is not ok, is: {contract_info:?}" ); - let info_addr_iter = node_runtime::storage().contracts().contract_info_of_iter(); + let mut iter = storage_at.iter(contract_info_addr, ()).await.unwrap(); - let keys_and_values = cxt - .client() - .storage() - .at_latest() - .await - .unwrap() - .iter(info_addr_iter) - .await - .unwrap() - .collect::>() - .await; + let mut keys_and_values = Vec::new(); + while let Some(kv) = iter.next().await { + keys_and_values.push(kv); + } assert_eq!(keys_and_values.len(), 1); println!("keys+values post: {keys_and_values:?}"); diff --git a/testing/integration-tests/src/full_client/frame/staking.rs b/testing/integration-tests/src/full_client/frame/staking.rs index 22dfc19a19b..4fb7226e2ed 100644 --- a/testing/integration-tests/src/full_client/frame/staking.rs +++ b/testing/integration-tests/src/full_client/frame/staking.rs @@ -13,8 +13,9 @@ use crate::{ }, subxt_test, test_context, }; -use assert_matches::assert_matches; -use subxt::error::{DispatchError, Error}; +use subxt::error::{ + DispatchError, Error, TransactionEventsError, TransactionFinalizedSuccessError, +}; use subxt_signer::{ SecretUri, sr25519::{self, dev}, @@ -83,11 +84,16 @@ async fn validate_not_possible_for_controller_account() -> Result<(), Error> { .wait_for_finalized_success() .await; - assert_matches!(announce_validator, Err(Error::Runtime(DispatchError::Module(err))) => { + if let Err(TransactionFinalizedSuccessError::SuccessError( + TransactionEventsError::ExtrinsicFailed(DispatchError::Module(err)), + )) = announce_validator + { let details = err.details().unwrap(); assert_eq!(details.pallet.name(), "Staking"); assert_eq!(&details.variant.name, "NotController"); - }); + } else { + panic!("Expected an error"); + } Ok(()) } @@ -142,11 +148,16 @@ async fn nominate_not_possible_for_controller_account() -> Result<(), Error> { .wait_for_finalized_success() .await; - assert_matches!(nomination, Err(Error::Runtime(DispatchError::Module(err))) => { + if let Err(TransactionFinalizedSuccessError::SuccessError( + TransactionEventsError::ExtrinsicFailed(DispatchError::Module(err)), + )) = nomination + { let details = err.details().unwrap(); assert_eq!(details.pallet.name(), "Staking"); assert_eq!(&details.variant.name, "NotController"); - }); + } else { + panic!("Expected an error"); + } Ok(()) } @@ -175,16 +186,14 @@ async fn chill_works_for_stash_only() -> Result<(), Error> { .wait_for_finalized_success() .await?; - let ledger_addr = node_runtime::storage() - .staking() - .ledger(alice_stash.public_key().to_account_id()); + let ledger_addr = node_runtime::storage().staking().ledger(); let ledger = api .storage() .at_latest() .await? - .fetch(&ledger_addr) + .fetch(ledger_addr, (alice_stash.public_key().to_account_id(),)) .await? - .unwrap(); + .decode()?; assert_eq!(alice_stash.public_key().to_account_id(), ledger.stash); let chill_tx = node_runtime::tx().staking().chill(); @@ -201,11 +210,16 @@ async fn chill_works_for_stash_only() -> Result<(), Error> { .wait_for_finalized_success() .await; - assert_matches!(chill, Err(Error::Runtime(DispatchError::Module(err))) => { + if let Err(TransactionFinalizedSuccessError::SuccessError( + TransactionEventsError::ExtrinsicFailed(DispatchError::Module(err)), + )) = chill + { let details = err.details().unwrap(); assert_eq!(details.pallet.name(), "Staking"); assert_eq!(&details.variant.name, "NotController"); - }); + } else { + panic!("Expected an error"); + } let signed_extrinsic = api .tx() @@ -256,11 +270,16 @@ async fn tx_bond() -> Result<(), Error> { .wait_for_finalized_success() .await; - assert_matches!(bond_again, Err(Error::Runtime(DispatchError::Module(err))) => { + if let Err(TransactionFinalizedSuccessError::SuccessError( + TransactionEventsError::ExtrinsicFailed(DispatchError::Module(err)), + )) = bond_again + { let details = err.details().unwrap(); assert_eq!(details.pallet.name(), "Staking"); assert_eq!(&details.variant.name, "AlreadyBonded"); - }); + } else { + panic!("Expected an error"); + } Ok(()) } @@ -283,9 +302,9 @@ async fn storage_current_era() -> Result<(), Error> { .storage() .at_latest() .await? - .fetch(¤t_era_addr) + .fetch(current_era_addr, ()) .await? - .expect("current era always exists"); + .decode()?; Ok(()) } @@ -293,13 +312,14 @@ async fn storage_current_era() -> Result<(), Error> { async fn storage_era_reward_points() -> Result<(), Error> { let ctx = test_context().await; let api = ctx.client(); - let reward_points_addr = node_runtime::storage().staking().eras_reward_points(0); + let reward_points_addr = node_runtime::storage().staking().eras_reward_points(); let current_era_result = api .storage() .at_latest() .await? - .fetch(&reward_points_addr) - .await; + .fetch(reward_points_addr, (0,)) + .await? + .decode(); assert!(current_era_result.is_ok()); Ok(()) diff --git a/testing/integration-tests/src/full_client/frame/system.rs b/testing/integration-tests/src/full_client/frame/system.rs index 99cb0afea04..ed80d815892 100644 --- a/testing/integration-tests/src/full_client/frame/system.rs +++ b/testing/integration-tests/src/full_client/frame/system.rs @@ -6,7 +6,6 @@ use crate::{ node_runtime::{self, system}, subxt_test, test_context, }; -use assert_matches::assert_matches; use subxt_signer::sr25519::dev; #[subxt_test] @@ -16,18 +15,16 @@ async fn storage_account() -> Result<(), subxt::Error> { let alice = dev::alice(); - let account_info_addr = node_runtime::storage() - .system() - .account(alice.public_key().to_account_id()); + let account_info_addr = node_runtime::storage().system().account(); - let account_info = api + let _account_info = api .storage() .at_latest() .await? - .fetch_or_default(&account_info_addr) - .await; + .fetch(account_info_addr, (alice.public_key().to_account_id(),)) + .await? + .decode()?; - assert_matches!(account_info, Ok(_)); Ok(()) } diff --git a/testing/integration-tests/src/full_client/frame/timestamp.rs b/testing/integration-tests/src/full_client/frame/timestamp.rs index e51892117fa..e191485799c 100644 --- a/testing/integration-tests/src/full_client/frame/timestamp.rs +++ b/testing/integration-tests/src/full_client/frame/timestamp.rs @@ -9,13 +9,14 @@ async fn storage_get_current_timestamp() { let ctx = test_context().await; let api = ctx.client(); - let timestamp = api - .storage() - .at_latest() - .await + let storage_at = api.storage().at_latest().await.unwrap(); + + let timestamp_value = storage_at + .entry(node_runtime::storage().timestamp().now()) .unwrap() - .fetch(&node_runtime::storage().timestamp().now()) - .await; + .fetch() + .await + .unwrap(); - assert!(timestamp.is_ok()) + assert!(timestamp_value.decode().is_ok()) } diff --git a/testing/integration-tests/src/full_client/metadata_validation.rs b/testing/integration-tests/src/full_client/metadata_validation.rs index 3e740268a0f..837b523955d 100644 --- a/testing/integration-tests/src/full_client/metadata_validation.rs +++ b/testing/integration-tests/src/full_client/metadata_validation.rs @@ -50,7 +50,7 @@ async fn metadata_to_api(metadata: Metadata, ctx: &TestContext) -> OfflineClient fn v15_to_metadata(v15: RuntimeMetadataV15) -> Metadata { let subxt_md: subxt_metadata::Metadata = v15.try_into().unwrap(); - subxt_md.into() + subxt_md } fn default_pallet() -> PalletMetadata { @@ -167,9 +167,9 @@ async fn constant_values_are_not_validated() { .expect("ExistentialDeposit constant must be present"); // Modifying a constant value should not lead to an error: - existential.value = vec![0u8; 32]; + existential.value = vec![0u8; 16]; - // Build our API again, this time form the metadata we've tweaked. + // Build our API again, this time from the metadata we've tweaked. let api_from_modified_metadata = { let metadata_before = v15_to_metadata(v15_metadata); metadata_to_api(metadata_before, &ctx).await diff --git a/testing/integration-tests/src/full_client/storage.rs b/testing/integration-tests/src/full_client/storage.rs index ecb6fe31568..d68190ccf8d 100644 --- a/testing/integration-tests/src/full_client/storage.rs +++ b/testing/integration-tests/src/full_client/storage.rs @@ -3,6 +3,7 @@ // see LICENSE for license details. use crate::{node_runtime, subxt_test, test_context, utils::wait_for_blocks}; +use futures::StreamExt; #[cfg(fullclient)] use subxt::utils::AccountId32; @@ -23,8 +24,9 @@ async fn storage_plain_lookup() -> Result<(), subxt::Error> { .storage() .at_latest() .await? - .fetch_or_default(&addr) - .await?; + .fetch(addr, ()) + .await? + .decode()?; assert!(entry > 0); Ok(()) @@ -48,13 +50,14 @@ async fn storage_map_lookup() -> Result<(), subxt::Error> { .await?; // Look up the nonce for the user (we expect it to be 1). - let nonce_addr = node_runtime::storage().system().account(alice); + let nonce_addr = node_runtime::storage().system().account(); let entry = api .storage() .at_latest() .await? - .fetch_or_default(&nonce_addr) - .await?; + .fetch(nonce_addr, (alice,)) + .await? + .decode()?; assert_eq!(entry.nonce, 1); Ok(()) @@ -70,10 +73,13 @@ async fn storage_n_mapish_key_is_properly_created() -> Result<(), subxt::Error> let api = ctx.client(); // This is what the generated code hashes a `session().key_owner(..)` key into: - let actual_key = node_runtime::storage() - .session() - .key_owner((KeyTypeId([1, 2, 3, 4]), vec![5, 6, 7, 8])); - let actual_key_bytes = api.storage().address_bytes(&actual_key)?; + let storage_addr = node_runtime::storage().session().key_owner(); + let actual_key_bytes = api + .storage() + .at_latest() + .await? + .entry(storage_addr)? + .key(((KeyTypeId([1, 2, 3, 4]), vec![5, 6, 7, 8]),))?; // Let's manually hash to what we assume it should be and compare: let expected_key_bytes = { @@ -124,9 +130,15 @@ async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> { .await?; // The actual test; look up this approval in storage: - let addr = node_runtime::storage().assets().approvals(99, alice, bob); - let entry = api.storage().at_latest().await?.fetch(&addr).await?; - assert_eq!(entry.map(|a| a.amount), Some(123)); + let addr = node_runtime::storage().assets().approvals(); + let entry = api + .storage() + .at_latest() + .await? + .fetch(addr, (99, alice, bob)) + .await? + .decode()?; + assert_eq!(entry.amount, 123); Ok(()) } @@ -168,14 +180,18 @@ async fn storage_partial_lookup() -> Result<(), subxt::Error> { } // Check all approvals. - let addr = node_runtime::storage().assets().approvals_iter(); - let addr_bytes = api.storage().address_bytes(&addr)?; - let mut results = api.storage().at_latest().await?.iter(addr).await?; + let approvals_addr = node_runtime::storage().assets().approvals(); + let storage_at = api.storage().at_latest().await?; + let approvals_entry = storage_at.entry(approvals_addr)?; + + let mut results = approvals_entry.iter(()).await?; let mut approvals = Vec::new(); - while let Some(Ok(kv)) = results.next().await { - assert!(kv.key_bytes.starts_with(&addr_bytes)); - approvals.push(kv.value); + while let Some(kv) = results.next().await { + let kv = kv?; + assert!(kv.key_bytes().starts_with(&approvals_entry.key_prefix())); + approvals.push(kv.value().decode()?); } + assert_eq!(approvals.len(), assets.len()); let mut amounts = approvals.iter().map(|a| a.amount).collect::>(); amounts.sort(); @@ -185,17 +201,13 @@ async fn storage_partial_lookup() -> Result<(), subxt::Error> { // Check all assets starting with ID 99. for (asset_id, _, _, amount) in assets.clone() { - let addr = node_runtime::storage().assets().approvals_iter1(asset_id); - let second_addr_bytes = api.storage().address_bytes(&addr)?; - // Keys must be different, since we are adding to the root key. - assert_ne!(addr_bytes, second_addr_bytes); - - let mut results = api.storage().at_latest().await?.iter(addr).await?; + let mut results = approvals_entry.iter((asset_id,)).await?; let mut approvals = Vec::new(); - while let Some(Ok(kv)) = results.next().await { - assert!(kv.key_bytes.starts_with(&addr_bytes)); - approvals.push(kv.value); + while let Some(kv) = results.next().await { + let kv = kv?; + assert!(kv.key_bytes().starts_with(&approvals_entry.key_prefix())); + approvals.push(kv.value().decode()?); } assert_eq!(approvals.len(), 1); assert_eq!(approvals[0].amount, amount); @@ -241,21 +253,14 @@ async fn storage_iter_decode_keys() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let storage_static = node_runtime::storage().system().account_iter(); - let results_static = api - .storage() - .at_latest() - .await? - .iter(storage_static) - .await?; + let storage_static = node_runtime::storage().system().account(); + let storage_at_static = api.storage().at_latest().await?; + let results_static = storage_at_static.iter(storage_static, ()).await?; - let storage_dynamic = subxt::dynamic::storage("System", "Account", vec![]); - let results_dynamic = api - .storage() - .at_latest() - .await? - .iter(storage_dynamic) - .await?; + let storage_dynamic = + subxt::dynamic::storage::<(scale_value::Value,), scale_value::Value>("System", "Account"); + let storage_at_dynamic = api.storage().at_latest().await?; + let results_dynamic = storage_at_dynamic.iter(storage_dynamic, ()).await?; // Even the testing node should have more than 3 accounts registered. let results_static = results_static.take(3).collect::>().await; @@ -272,9 +277,9 @@ async fn storage_iter_decode_keys() -> Result<(), subxt::Error> { let dynamic_kv = dynamic_kv?; // We only care about the underlying key bytes. - assert_eq!(static_kv.key_bytes, dynamic_kv.key_bytes); + assert_eq!(static_kv.key_bytes(), dynamic_kv.key_bytes()); - let bytes = static_kv.key_bytes; + let bytes = static_kv.key_bytes(); assert!(bytes.len() > 32); // The first 16 bytes should be the twox hash of "System" and the next 16 bytes should be the twox hash of "Account". diff --git a/testing/integration-tests/src/full_client/transactions.rs b/testing/integration-tests/src/full_client/transactions.rs index 93e6f0acc27..1470968f676 100644 --- a/testing/integration-tests/src/full_client/transactions.rs +++ b/testing/integration-tests/src/full_client/transactions.rs @@ -4,7 +4,6 @@ use crate::utils::node_runtime; use crate::{subxt_test, test_context}; -use core::ops::Deref; use frame_decode::extrinsics::ExtrinsicType; use subxt_signer::sr25519::dev; @@ -25,12 +24,9 @@ async fn v4_unsigned_encode_decode() -> Result<(), subxt::Error> { let tx_bytes = api.tx().create_v4_unsigned(&call).unwrap().into_encoded(); let tx_bytes_cursor = &mut &*tx_bytes; - let decoded = frame_decode::extrinsics::decode_extrinsic( - tx_bytes_cursor, - md.deref(), - api.metadata().types(), - ) - .unwrap(); + let decoded = + frame_decode::extrinsics::decode_extrinsic(tx_bytes_cursor, &md, api.metadata().types()) + .unwrap(); assert_eq!(tx_bytes_cursor.len(), 0); assert_eq!(decoded.version(), 4); @@ -55,12 +51,8 @@ async fn v5_bare_encode_decode() -> Result<(), subxt::Error> { let tx_bytes = api.tx().create_v5_bare(&call).unwrap().into_encoded(); let tx_bytes_cursor = &mut &*tx_bytes; - let decoded = frame_decode::extrinsics::decode_extrinsic( - tx_bytes_cursor, - md.deref(), - api.metadata().types(), - ) - .unwrap(); + let decoded = + frame_decode::extrinsics::decode_extrinsic(tx_bytes_cursor, &md, md.types()).unwrap(); assert_eq!(tx_bytes_cursor.len(), 0); assert_eq!(decoded.version(), 5); @@ -92,12 +84,8 @@ async fn v4_signed_encode_decode() -> Result<(), subxt::Error> { .into_encoded(); let tx_bytes_cursor = &mut &*tx_bytes; - let decoded = frame_decode::extrinsics::decode_extrinsic( - tx_bytes_cursor, - md.deref(), - api.metadata().types(), - ) - .unwrap(); + let decoded = + frame_decode::extrinsics::decode_extrinsic(tx_bytes_cursor, &md, md.types()).unwrap(); assert_eq!(tx_bytes_cursor.len(), 0); assert_eq!(decoded.version(), 4); @@ -129,12 +117,8 @@ async fn v5_general_encode_decode() -> Result<(), subxt::Error> { .into_encoded(); let tx_bytes_cursor = &mut &*tx_bytes; - let decoded = frame_decode::extrinsics::decode_extrinsic( - tx_bytes_cursor, - md.deref(), - api.metadata().types(), - ) - .unwrap(); + let decoded = + frame_decode::extrinsics::decode_extrinsic(tx_bytes_cursor, &md, md.types()).unwrap(); assert_eq!(tx_bytes_cursor.len(), 0); assert_eq!(decoded.version(), 5); diff --git a/testing/integration-tests/src/light_client/mod.rs b/testing/integration-tests/src/light_client/mod.rs index dc05b963178..8f4d4818d7d 100644 --- a/testing/integration-tests/src/light_client/mod.rs +++ b/testing/integration-tests/src/light_client/mod.rs @@ -32,6 +32,7 @@ use codec::Compact; use std::sync::Arc; use subxt::backend::chain_head::ChainHeadBackend; use subxt::backend::rpc::RpcClient; +use subxt::dynamic::Value; use subxt::{client::OnlineClient, config::PolkadotConfig, lightclient::LightClient}; use subxt_metadata::Metadata; @@ -104,7 +105,7 @@ async fn runtime_api_call(api: &Client) -> Result<(), subxt::Error> { let block = sub.next().await.unwrap()?; tracing::trace!("First block took {:?}", now.elapsed()); - let rt = block.runtime_api().await?; + let rt = block.runtime_api().await; // get metadata via state_call. if it decodes ok, it's probably all good. let result_bytes = rt.call_raw("Metadata_metadata", None).await?; @@ -120,13 +121,10 @@ async fn storage_plain_lookup(api: &Client) -> Result<(), subxt::Error> { let now = std::time::Instant::now(); tracing::trace!("Check storage_plain_lookup"); + let storage_at = api.storage().at_latest().await?; + let addr = node_runtime::storage().timestamp().now(); - let entry = api - .storage() - .at_latest() - .await? - .fetch_or_default(&addr) - .await?; + let entry = storage_at.fetch(addr, ()).await?.decode()?; tracing::trace!("Storage lookup took {:?}\n", now.elapsed()); @@ -140,7 +138,7 @@ async fn dynamic_constant_query(api: &Client) -> Result<(), subxt::Error> { let now = std::time::Instant::now(); tracing::trace!("Check dynamic_constant_query"); - let constant_query = subxt::dynamic::constant("System", "BlockLength"); + let constant_query = subxt::dynamic::constant::("System", "BlockLength"); let _value = api.constants().at(&constant_query)?; tracing::trace!("Dynamic constant query took {:?}\n", now.elapsed()); diff --git a/testing/integration-tests/src/utils/wait_for_blocks.rs b/testing/integration-tests/src/utils/wait_for_blocks.rs index f7f9726987e..e1eec8a2bbe 100644 --- a/testing/integration-tests/src/utils/wait_for_blocks.rs +++ b/testing/integration-tests/src/utils/wait_for_blocks.rs @@ -3,8 +3,8 @@ // see LICENSE for license details. use subxt::{ - Config, Error, OnlineClient, SubstrateConfig, backend::StreamOf, blocks::Block, - client::OnlineClientT, + Config, OnlineClient, SubstrateConfig, backend::StreamOf, blocks::Block, client::OnlineClientT, + error::BackendError, }; /// Wait for blocks to be produced before running tests. Specifically, we @@ -32,7 +32,9 @@ pub async fn wait_for_number_of_blocks( /// This may be useful on the unstable backend when the initial blocks may be large /// and one relies on something to included in finalized block in ner future. pub async fn consume_initial_blocks( - blocks: &mut StreamOf>, Error>>, + blocks: &mut StreamOf< + Result>, BackendError>, + >, ) { use tokio::time::{Duration, Instant, interval_at}; const MAX_DURATION: Duration = Duration::from_millis(200); diff --git a/testing/ui-tests/src/correct/custom_values.rs b/testing/ui-tests/src/correct/custom_values.rs index ca1b0539aed..f16bcc0bcd3 100644 --- a/testing/ui-tests/src/correct/custom_values.rs +++ b/testing/ui-tests/src/correct/custom_values.rs @@ -20,8 +20,8 @@ fn main() { assert_eq!(foo, expected_foo); // dynamic query: - let foo_value = api.custom_values().at("Foo").unwrap(); - let foo: Foo = foo_value.as_type().unwrap(); + let foo_address = subxt::dynamic::custom_value::("Foo"); + let foo = api.custom_values().at(&foo_address).unwrap(); assert_eq!(foo, expected_foo); // static query for some custom value that has an invalid type id: (we can still access the bytes)