diff --git a/Cargo.lock b/Cargo.lock index b84c5919043..e9ce0118d8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,6 +98,15 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-lock" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +dependencies = [ + "event-listener", +] + [[package]] name = "async-trait" version = "0.1.56" @@ -163,23 +172,29 @@ version = "0.1.0" dependencies = [ "beefy-primitives", "ckb-merkle-mountain-range", + "color-eyre", "derive_more", + "frame-metadata", "frame-support", + "hex", "hex-literal", + "jsonrpsee 0.15.0", "pallet-beefy-mmr", "pallet-mmr", "pallet-mmr-rpc", "parity-scale-codec", "rs_merkle", "serde_json", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", "sp-mmr-primitives", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", "subxt", + "subxt-codegen", + "syn", "tokio", ] @@ -356,6 +371,33 @@ dependencies = [ "cfg-if 0.1.10", ] +[[package]] +name = "color-eyre" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + [[package]] name = "const-oid" version = "0.7.1" @@ -660,6 +702,22 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fake-simd" version = "0.1.2" @@ -1152,6 +1210,22 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +dependencies = [ + "http", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "webpki-roots", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1187,6 +1261,12 @@ dependencies = [ "syn", ] +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" version = "1.9.1" @@ -1227,16 +1307,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpsee" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91dc760c341fa81173f9a434931aaf32baad5552b0230cc6c93e8fb7eaad4c19" -dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core 0.10.1", -] - [[package]] name = "jsonrpsee" version = "0.13.1" @@ -1251,16 +1321,59 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11e017217fcd18da0a25296d3693153dd19c8a6aadab330b3595285d075385d1" +dependencies = [ + "jsonrpsee-client-transport 0.14.0", + "jsonrpsee-core 0.14.0", +] + +[[package]] +name = "jsonrpsee" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d966710cd10f992b87107c3b54f9301738892cf5692a5730a362957cc927e3c" +dependencies = [ + "jsonrpsee-client-transport 0.15.0", + "jsonrpsee-core 0.15.0", + "jsonrpsee-http-client", + "jsonrpsee-types 0.15.0", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce395539a14d3ad4ec1256fde105abd36a2da25d578a291cabe98f45adfdb111" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core 0.14.0", + "jsonrpsee-types 0.14.0", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + [[package]] name = "jsonrpsee-client-transport" -version = "0.10.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765f7a36d5087f74e3b3b47805c2188fef8eb54afcb587b078d9f8ebfe9c7220" +checksum = "57bc7b8506b6f313ec2915e2205f72015a55827d6fc4fbf6f485f45c802843a6" dependencies = [ - "futures", + "futures-util", "http", - "jsonrpsee-core 0.10.1", - "jsonrpsee-types 0.10.1", + "jsonrpsee-core 0.15.0", + "jsonrpsee-types 0.15.0", "pin-project", "rustls-native-certs", "soketto", @@ -1274,9 +1387,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ef77ecd20c2254d54f5da8c0738eacca61e6b6511268a8f2753e3148c6c706" +checksum = "6e27462b21279edf9a6a91f46ffbe125e9cdc58b901d2e08bf59b31a47d7d0ab" dependencies = [ "anyhow", "arrayvec 0.7.2", @@ -1285,7 +1398,9 @@ dependencies = [ "futures-channel", "futures-util", "hyper", - "jsonrpsee-types 0.10.1", + "jsonrpsee-types 0.13.1", + "parking_lot", + "rand 0.8.5", "rustc-hash", "serde", "serde_json", @@ -1297,27 +1412,68 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e27462b21279edf9a6a91f46ffbe125e9cdc58b901d2e08bf59b31a47d7d0ab" +checksum = "16efcd4477de857d4a2195a45769b2fe9ebb54f3ef5a4221d3b014a4fe33ec0b" dependencies = [ "anyhow", - "arrayvec 0.7.2", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types 0.14.0", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411236b4379b4d9e252b557ba3a9137c7fad5fdc944f2a29347db7c9edc929ee" +dependencies = [ + "anyhow", + "async-lock", "async-trait", "beef", "futures-channel", + "futures-timer", "futures-util", "hyper", - "jsonrpsee-types 0.13.1", - "parking_lot", - "rand 0.8.5", + "jsonrpsee-types 0.15.0", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20c78311a7686a5397806d362a1c8f7088fa59662dda23b01260d37ad235d682" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls", + "jsonrpsee-core 0.15.0", + "jsonrpsee-types 0.15.0", "rustc-hash", "serde", "serde_json", - "soketto", "thiserror", "tokio", "tracing", + "tracing-futures", ] [[package]] @@ -1353,9 +1509,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b6aa52f322cbf20c762407629b8300f39bcc0cf0619840d9252a2f65fd2dd9" +checksum = "8fd11763134104122ddeb0f97e4bbe393058017dfb077db63fbf44b4dd0dd86e" dependencies = [ "anyhow", "beef", @@ -1367,9 +1523,23 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd11763134104122ddeb0f97e4bbe393058017dfb077db63fbf44b4dd0dd86e" +checksum = "3bcf76cd316f5d3ad48138085af1f45e2c58c98e02f0779783dbb034d43f7c86" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1e88f208ac5004389f0063e87bd7463f5e864ff1ac40484f80e8432976ffa0a" dependencies = [ "anyhow", "beef", @@ -1759,6 +1929,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "owo-colors" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" + [[package]] name = "pallet-beefy" version = "4.0.0-dev" @@ -3310,7 +3486,7 @@ dependencies = [ "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.2.25", ] [[package]] @@ -3322,7 +3498,7 @@ dependencies = [ "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.2.25", ] [[package]] @@ -3477,17 +3653,16 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "subxt" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab902b8d1bf5ecdc16c78e1f7fdef77665d5ce77004b2be1f6ac4b4f679d987" +checksum = "e731c0245979a80f9090a89b43635e23f367f13a225695f286f307978db36f11" dependencies = [ "bitvec", "derivative", "frame-metadata", "futures", "hex", - "jsonrpsee 0.10.1", - "log", + "jsonrpsee 0.14.0", "parity-scale-codec", "parking_lot", "scale-info", @@ -3498,13 +3673,14 @@ dependencies = [ "subxt-macro", "subxt-metadata", "thiserror", + "tracing", ] [[package]] name = "subxt-codegen" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac3c4e3565338616f009bc40419f45fa7d9472a5717fa8cce129777c709d1a1" +checksum = "4c9462b52d539cde2e0dbbd1c89d28079459ed790f42218c5bfc9d61c9575e32" dependencies = [ "darling", "frame-metadata", @@ -3520,9 +3696,9 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078edfe8f06cb00848e2e64e923fe809f345042c3d7ec13edcd7f0e617656a9b" +checksum = "38521809516f4c244b6f38ed13fc67ef6ada29a846fa26123a4206ff743f3461" dependencies = [ "darling", "proc-macro-error", @@ -3532,9 +3708,9 @@ dependencies = [ [[package]] name = "subxt-metadata" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819a10a1a13bd9645419f59ac9d7cc8deb51052566b9d0c2157354ea44513d5" +checksum = "37b01bac35f2524ce590fa1438fb6c81a63df1b4c94f686be391afd8d02615b3" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -3748,6 +3924,26 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-error" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +dependencies = [ + "tracing", + "tracing-subscriber 0.3.15", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -3791,6 +3987,17 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "tracing-subscriber" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + [[package]] name = "trie-db" version = "0.23.1" diff --git a/Cargo.toml b/Cargo.toml index 57b59ee55b2..b3181f6cdda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,12 +7,22 @@ authors = ["Composable developers"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +[build-dependencies] +subxt-codegen = "0.22.0" +jsonrpsee = { version = "0.15.0", features = ["async-client", "client-ws-transport", "http-client"] } +frame-metadata = { version = "15.0.0", features = ["v14", "std"] } +syn = "1.0.98" +codec = { package = "parity-scale-codec", version = "3.0.0" } +color-eyre = "0.6.2" +hex = "0.4.3" +tokio = { version = "1.19.2", features = ["macros", "rt-multi-thread"] } + [dependencies] sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-runtime = { default-features = false, version = "6.0.0" } +sp-core = { default-features = false, version = "6.0.0" } sp-core-hashing = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } - +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } beefy-mmr = { package = "pallet-beefy-mmr", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } pallet-mmr = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } pallet-mmr-primitives = { package = "sp-mmr-primitives", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } @@ -21,19 +31,19 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = rs_merkle = { version = "1.2.0", default-features = false } mmr-lib= { package = "ckb-merkle-mountain-range", version = "0.3.2", default-features = false } derive_more = { version = "0.99.17", default-features = false, features = ["from"] } -# Mock deps -subxt = { version = "0.21.0", optional = true } +# Optional deps +subxt = { version = "0.22.0", optional = true } tokio = { version = "1.17.0", features = ["full"], optional = true } hex-literal = { version = "0.3.4", optional = true } serde_json = { version = "1.0.74", optional = true } pallet-mmr-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", optional = true } sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", optional = true } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", optional = true } +hex = { version = "0.4.3", optional = true } [dev-dependencies] -subxt = "0.21.0" tokio = { version = "1.17.0", features = ["full"] } +subxt = "0.22.0" hex-literal = "0.3.4" serde_json = "1.0.74" pallet-mmr-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } @@ -55,6 +65,7 @@ std = [ "pallet-mmr/std", "pallet-mmr-primitives/std", "rs_merkle/std", - "mmr-lib/std" + "mmr-lib/std", + "frame-support/std" ] -mocks = ["std", "subxt", "hex-literal", "serde_json", "pallet-mmr-rpc", "frame-support", "sp-io", "sp-trie"] +prover = ["std", "subxt", "hex-literal", "serde_json", "pallet-mmr-rpc", "sp-io", "sp-trie", "hex"] diff --git a/build.rs b/build.rs new file mode 100644 index 00000000000..9658ba40273 --- /dev/null +++ b/build.rs @@ -0,0 +1,64 @@ +use codec::{Decode, Input}; +use frame_metadata::RuntimeMetadataPrefixed; +use jsonrpsee::{ + async_client::ClientBuilder, + client_transport::ws::{Uri, WsTransportClientBuilder}, + core::{client::ClientT, Error}, + rpc_params, +}; +use std::{env, fs, path::Path}; +use subxt_codegen::DerivesRegistry; + +// We need this build script to rebuild the runtime metadata from a live node +// Since we have exported functions that depends on the having the latest relay chain metadata +// Build is disabled by default and only enabled when the env variable PROVER_ENABLED is set to 1 + +async fn fetch_metadata_ws() -> color_eyre::Result> { + let node_var = env::var("NODE_ENDPOINT").unwrap_or("ws://127.0.0.1:9944".to_string()); + let (sender, receiver) = WsTransportClientBuilder::default() + .build(node_var.parse::().unwrap()) + .await + .map_err(|e| Error::Transport(e.into()))?; + + let client = ClientBuilder::default() + .max_notifs_per_subscription(4096) + .build_with_tokio(sender, receiver); + + let metadata: String = client.request("state_getMetadata", rpc_params![]).await?; + Ok(hex::decode(metadata.trim_start_matches("0x"))?) +} + +fn codegen(encoded: &mut I) -> color_eyre::Result { + let metadata = ::decode(encoded)?; + let generator = subxt_codegen::RuntimeGenerator::new(metadata); + let item_mod = syn::parse_quote!( + pub mod api {} + ); + + // add any derives you want here: + let p = Vec::::new() + .iter() + .map(|raw| syn::parse_str(raw)) + .collect::, _>>()?; + let mut derives = DerivesRegistry::default(); + derives.extend_for_all(p.into_iter()); + + let runtime_api = generator.generate_runtime(item_mod, derives); + Ok(format!("{}", runtime_api)) +} + +#[tokio::main] +async fn main() -> color_eyre::Result<()> { + let build_enabled = env::var("PROVER_ENABLED") + .map(|v| v == "1") + .unwrap_or(false); + if build_enabled { + let metadata = fetch_metadata_ws().await?; + let code = codegen(&mut &metadata[..])?; + let out_dir = env::var_os("OUT_DIR").unwrap(); + let dest_path = Path::new(&out_dir).join("subxt_codegen.rs"); + fs::write(&dest_path, &code)?; + } + + Ok(()) +} diff --git a/src/error.rs b/src/error.rs index 25dfd5c3194..da3dbc450ef 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,23 +1,41 @@ //! Light client error definition - +use codec::alloc::string::String; use sp_std::prelude::*; -#[derive(sp_std::fmt::Debug, PartialEq, Eq, derive_more::From)] +#[derive(sp_std::fmt::Debug, derive_more::From)] /// Error definition for the light client pub enum BeefyClientError { - /// Failed to read a value from storage - StorageReadError, - /// Failed to write a value to storage - StorageWriteError, - /// Error decoding some value - DecodingError, - /// Invalid Mmr Update - InvalidMmrUpdate, + /// Outdated commitment + #[from(ignore)] + OutdatedCommitment { + /// Latest beefy height stored + latest_beefy_height: u32, + /// Commitment block number received + commitment_block_number: u32, + }, + /// Mmr root hash not found in commitment + MmrRootHashNotFound, + /// Invalid Authority set id received + #[from(ignore)] + AuthoritySetMismatch { + /// Current authority set id + current_set_id: u64, + /// Next authority set id + next_set_id: u64, + /// Authority set id in commitment + commitment_set_id: u64, + }, /// Incomplete Signature threshold IncompleteSignatureThreshold, /// Error recovering public key from signature InvalidSignature, /// Some invalid merkle root hash - InvalidRootHash, + #[from(ignore)] + InvalidRootHash { + /// Root hash + root_hash: Vec, + /// Root hash length + len: u64, + }, /// Some invalid mmr proof InvalidMmrProof, /// Invalid authority proof @@ -26,4 +44,18 @@ pub enum BeefyClientError { InvalidMerkleProof, /// Mmr Error MmrVerificationError(mmr_lib::Error), + #[cfg(any(test, feature = "prover"))] + /// subxt error + Subxt(subxt::BasicError), + #[cfg(any(test, feature = "prover"))] + /// subxt rpc error + SubxtRRpc(subxt::rpc::RpcError), + #[cfg(any(test, feature = "prover"))] + /// Trie error + TrieProof(Box>>), + /// Codec error + Codec(codec::Error), + /// Custom error + #[from(ignore)] + Custom(String), } diff --git a/src/lib.rs b/src/lib.rs index ad507952f38..9cfd630f8bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,16 +15,14 @@ //! Beefy Light Client Implementation #![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(not(feature = "mocks"), deny(missing_docs))] +#![cfg_attr(not(feature = "prover"), deny(missing_docs))] use core::marker::PhantomData; pub mod error; pub mod primitives; -#[cfg(any(test, feature = "mocks"))] -pub mod runtime; -#[cfg(any(test, feature = "mocks"))] -pub mod test_utils; +#[cfg(any(test, feature = "prover"))] +pub mod queries; #[cfg(test)] mod tests; pub mod traits; @@ -38,9 +36,9 @@ use crate::traits::{ClientState, HostFunctions}; use beefy_primitives::known_payload_ids::MMR_ROOT_ID; use beefy_primitives::mmr::MmrLeaf; use codec::Encode; -use sp_core::crypto::ByteArray; +use frame_support::sp_runtime::app_crypto::ByteArray; +use frame_support::sp_runtime::traits::Convert; use sp_core::H256; -use sp_runtime::traits::Convert; use sp_std::prelude::*; use sp_std::vec; @@ -78,7 +76,11 @@ impl BeefyLightClient { if current_authority_set.id != validator_set_id && next_authority_set.id != validator_set_id { - return Err(BeefyClientError::InvalidMmrUpdate); + return Err(BeefyClientError::AuthoritySetMismatch { + current_set_id: current_authority_set.id, + next_set_id: next_authority_set.id, + commitment_set_id: validator_set_id, + }); } // Extract root hash from signed commitment and validate it @@ -92,10 +94,13 @@ impl BeefyLightClient { if root.len() == HASH_LENGTH { root } else { - return Err(BeefyClientError::InvalidRootHash); + return Err(BeefyClientError::InvalidRootHash { + root_hash: root.clone(), + len: root.len() as u64, + }); } } else { - return Err(BeefyClientError::InvalidMmrUpdate); + return Err(BeefyClientError::MmrRootHashNotFound); } }; @@ -152,13 +157,23 @@ impl BeefyLightClient { } authorities_changed = true; } - _ => return Err(BeefyClientError::InvalidMmrUpdate), + _ => { + return Err(BeefyClientError::AuthoritySetMismatch { + current_set_id: current_authority_set.id, + next_set_id: next_authority_set.id, + commitment_set_id: validator_set_id, + }) + } } let latest_beefy_height = trusted_client_state.latest_beefy_height; - if mmr_update.signed_commitment.commitment.block_number <= latest_beefy_height { - return Err(BeefyClientError::InvalidMmrUpdate); + let commitment_block_number = mmr_update.signed_commitment.commitment.block_number; + if commitment_block_number <= latest_beefy_height { + return Err(BeefyClientError::OutdatedCommitment { + latest_beefy_height, + commitment_block_number, + }); } // Move on to verify mmr_proof @@ -250,7 +265,7 @@ impl BeefyLightClient { } /// Calculate the leaf index for this block number -fn get_leaf_index_for_block_number(activation_block: u32, block_number: u32) -> u32 { +pub fn get_leaf_index_for_block_number(activation_block: u32, block_number: u32) -> u32 { // calculate the leaf index for this leaf. if activation_block == 0 { // in this case the leaf index is the same as the block number - 1 (leaf index starts at 0) diff --git a/src/queries.rs b/src/queries.rs new file mode 100644 index 00000000000..3211401df29 --- /dev/null +++ b/src/queries.rs @@ -0,0 +1,4 @@ +pub mod helpers; +pub mod relay_chain_queries; +pub mod runtime; +pub mod utils; diff --git a/src/queries/helpers.rs b/src/queries/helpers.rs new file mode 100644 index 00000000000..856ec9545db --- /dev/null +++ b/src/queries/helpers.rs @@ -0,0 +1,190 @@ +use codec::{Decode, Encode}; +use frame_support::sp_runtime::traits::Convert; +use sp_core::keccak_256; +use sp_runtime::traits::BlakeTwo256; +use sp_trie::{generate_trie_proof, TrieDBMut, TrieMut}; +use std::collections::BTreeMap; +use subxt::{Client, Config}; + +use crate::{ + error::BeefyClientError, primitives::SignatureWithAuthorityIndex, queries::utils::Crypto, + MerkleHasher, +}; + +pub struct TimeStampExtWithProof { + pub ext: Vec, + pub proof: Vec>, +} + +pub struct AuthorityProofWithSignatures { + pub authority_proof: Vec<[u8; 32]>, + pub signatures: Vec, +} + +pub struct ParaHeadsProof { + pub parachain_heads_proof: Vec<[u8; 32]>, + pub para_head: Vec, + pub heads_leaf_index: u32, + pub heads_total_count: u32, +} + +/// Fetch timestamp extrinsic and it's proof +pub async fn fetch_timestamp_extrinsic_with_proof( + client: &Client, + block_hash: Option, +) -> Result { + let block = client.rpc().block(block_hash).await?.ok_or_else(|| { + BeefyClientError::Custom(format!( + "[get_parachain_headers] Block with hash :{:?} not found", + block_hash + )) + })?; + let extrinsics = block + .block + .extrinsics + .into_iter() + .map(|e| e.encode()) + .collect::>(); + + let (ext, proof) = { + if extrinsics.is_empty() { + (vec![], vec![]) + } else { + let timestamp_ext = extrinsics[0].clone(); + + let mut db = sp_trie::MemoryDB::::default(); + + let root = { + let mut root = Default::default(); + let mut trie = >>::new(&mut db, &mut root); + + for (i, ext) in extrinsics.into_iter().enumerate() { + let key = codec::Compact(i as u32).encode(); + trie.insert(&key, &ext)?; + } + *trie.root() + }; + + let key = codec::Compact::(0u32).encode(); + let extrinsic_proof = generate_trie_proof::, _, _, _>( + &db, + root, + vec![&key], + )?; + (timestamp_ext, extrinsic_proof) + } + }; + + Ok(TimeStampExtWithProof { ext, proof }) +} + +pub type ParaId = u32; +pub type HeadData = Vec; +/// Calculate the proof for the parachain heads added to this leaf +pub fn prove_parachain_headers( + // Map of para ids to to finalized head data + finalized_para_heads: &BTreeMap, + para_id: u32, +) -> Result { + let mut index = None; + let mut parachain_leaves = vec![]; + // Values are already sorted by key which is the para_id + for (idx, (key, header)) in finalized_para_heads.iter().enumerate() { + let pair = (*key, header.clone()); + let leaf_hash = keccak_256(pair.encode().as_slice()); + parachain_leaves.push(leaf_hash); + if key == ¶_id { + index = Some(idx); + } + } + + let tree = rs_merkle::MerkleTree::>::from_leaves(¶chain_leaves); + + let proof = if let Some(index) = index { + tree.proof(&[index]) + .proof_hashes() + .into_iter() + .map(|item| item.clone()) + .collect::>() + } else { + vec![] + }; + + let para_head = finalized_para_heads + .get(¶_id) + .ok_or_else(|| { + BeefyClientError::Custom(format!( + "[get_parachain_headers] Para Header not found for para id {}", + para_id + )) + })? + .clone(); + Ok(ParaHeadsProof { + parachain_heads_proof: proof, + para_head, + heads_leaf_index: index.ok_or_else(|| { + BeefyClientError::Custom("[get_parachain_headers] heads leaf index is None".to_string()) + })? as u32, + heads_total_count: parachain_leaves.len() as u32, + }) +} + +/// Get the proof for authority set that signed this commitment +pub fn prove_authority_set( + signed_commitment: &beefy_primitives::SignedCommitment< + u32, + beefy_primitives::crypto::Signature, + >, + authority_address_hashes: Vec<[u8; 32]>, +) -> Result { + let signatures = signed_commitment + .signatures + .iter() + .enumerate() + .map(|(index, x)| { + if let Some(sig) = x { + let mut temp = [0u8; 65]; + if sig.len() == 65 { + temp.copy_from_slice(&*sig.encode()); + Some(SignatureWithAuthorityIndex { + index: index as u32, + signature: temp, + }) + } else { + None + } + } else { + None + } + }) + .filter_map(|x| x) + .collect::>(); + + let signature_indices = signatures + .iter() + .map(|x| x.index as usize) + .collect::>(); + + let tree = + rs_merkle::MerkleTree::>::from_leaves(&authority_address_hashes); + + let authority_proof = tree.proof(&signature_indices); + Ok(AuthorityProofWithSignatures { + authority_proof: authority_proof.proof_hashes().to_vec(), + signatures, + }) +} + +/// Hash encoded authority public keys +pub fn hash_authority_addresses( + encoded_public_keys: Vec>, +) -> Result, BeefyClientError> { + let authority_address_hashes = encoded_public_keys + .into_iter() + .map(|x| { + beefy_primitives::crypto::AuthorityId::decode(&mut &*x) + .map(|id| keccak_256(&beefy_mmr::BeefyEcdsaToEthereum::convert(id))) + }) + .collect::, codec::Error>>()?; + Ok(authority_address_hashes) +} diff --git a/src/queries/relay_chain_queries.rs b/src/queries/relay_chain_queries.rs new file mode 100644 index 00000000000..865bd6f6ec4 --- /dev/null +++ b/src/queries/relay_chain_queries.rs @@ -0,0 +1,179 @@ +use beefy_primitives::{SignedCommitment, VersionedFinalityProof}; +use codec::{Decode, Encode}; +use pallet_mmr_rpc::{LeafBatchProof, LeafProof}; +use sp_core::H256; +use sp_runtime::traits::Header as HeaderT; +use std::collections::BTreeMap; +use subxt::{ + rpc::{rpc_params, ClientT}, + Client, Config, +}; + +use crate::{error::BeefyClientError, get_leaf_index_for_block_number}; + +use super::runtime; + +pub struct FinalizedParaHeads { + pub leaf_indices: Vec, + pub raw_finalized_heads: BTreeMap>>, +} + +/// Get the raw parachain heads finalized in the provided block +pub async fn fetch_finalized_parachain_heads( + client: &Client, + commitment_block_number: u32, + latest_beefy_height: u32, + para_id: u32, + beefy_activation_block: u32, +) -> Result +where + u32: From<::BlockNumber>, +{ + let subxt_block_number: subxt::BlockNumber = commitment_block_number.into(); + let block_hash = client.rpc().block_hash(Some(subxt_block_number)).await?; + + let api = client + .clone() + .to_runtime_api::>>(); + + let para_ids = api.storage().paras().parachains(block_hash).await?; + let storage_prefix = frame_support::storage::storage_prefix(b"Paras", b"Heads"); + let mut para_header_keys = Vec::new(); + + for para_id in para_ids { + let encoded_para_id = para_id.encode(); + + let mut full_key = storage_prefix.clone().to_vec(); + full_key.extend_from_slice(sp_core::hashing::twox_64(&encoded_para_id).as_slice()); + full_key.extend_from_slice(&encoded_para_id); + para_header_keys.push(subxt::sp_core::storage::StorageKey(full_key)); + } + + let previous_finalized_block_number: subxt::BlockNumber = (latest_beefy_height + 1).into(); + let previous_finalized_hash = client + .rpc() + .block_hash(Some(previous_finalized_block_number)) + .await? + .ok_or_else(|| { + BeefyClientError::Custom( + "Failed to get previous finalized beefy block hash from block number".to_string(), + ) + })?; + + let change_set = client + .storage() + .query_storage(para_header_keys, previous_finalized_hash, block_hash) + .await?; + let mut finalized_blocks = BTreeMap::new(); + let mut leaf_indices = vec![]; + for changes in change_set { + let header = client + .rpc() + .header(Some(changes.block)) + .await? + .ok_or_else(|| { + BeefyClientError::Custom(format!( + "[get_parachain_headers] block not found {:?}", + changes.block + )) + })?; + + let mut heads = BTreeMap::new(); + + for (key, value) in changes.changes { + if let Some(storage_data) = value { + let key = key.0.to_vec(); + let para_id = u32::decode(&mut &key[40..])?; + let head_data: runtime::api::runtime_types::polkadot_parachain::primitives::HeadData = + Decode::decode(&mut &*storage_data.0)?; + heads.insert(para_id, head_data.0); + } + } + + if !heads.contains_key(¶_id) { + continue; + } + let block_number = u32::from(*header.number()); + finalized_blocks.insert(block_number as u64, heads); + leaf_indices.push(get_leaf_index_for_block_number( + beefy_activation_block, + block_number, + )); + } + + Ok(FinalizedParaHeads { + raw_finalized_heads: finalized_blocks, + leaf_indices, + }) +} + +/// Get beefy justification for latest finalized beefy block +pub async fn fetch_beefy_justification( + client: &Client, +) -> Result< + ( + SignedCommitment, + T::Hash, + ), + BeefyClientError, +> { + let latest_beefy_finalized: ::Hash = client + .rpc() + .client + .request("beefy_getFinalizedHead", rpc_params!()) + .await?; + let block = client + .rpc() + .block(Some(latest_beefy_finalized)) + .await + .ok() + .flatten() + .expect("Should find a valid block"); + + let justifications = block + .justifications + .expect("Block should have valid justifications"); + + let beefy_justification = justifications + .into_justification(beefy_primitives::BEEFY_ENGINE_ID) + .expect("Should have valid beefy justification"); + let VersionedFinalityProof::V1(signed_commitment) = VersionedFinalityProof::< + u32, + beefy_primitives::crypto::Signature, + >::decode(&mut &*beefy_justification) + .expect("Beefy justification should decode correctly"); + + Ok((signed_commitment, latest_beefy_finalized)) +} + +/// Query a batch leaf proof +pub async fn fetch_mmr_batch_proof( + client: &Client, + leaf_indices: Vec, + block_hash: Option, +) -> Result, BeefyClientError> { + let proof: LeafBatchProof = client + .rpc() + .client + .request( + "mmr_generateBatchProof", + rpc_params!(leaf_indices, block_hash), + ) + .await?; + Ok(proof) +} + +/// Query a single leaf proof +pub async fn fetch_mmr_leaf_proof( + client: &Client, + leaf_index: u64, + block_hash: Option, +) -> Result, BeefyClientError> { + let proof: LeafProof = client + .rpc() + .client + .request("mmr_generateProof", rpc_params!(leaf_index, block_hash)) + .await?; + + Ok(proof) +} diff --git a/src/queries/runtime.rs b/src/queries/runtime.rs new file mode 100644 index 00000000000..ecf399f85e3 --- /dev/null +++ b/src/queries/runtime.rs @@ -0,0 +1 @@ +include!(concat!(env!("OUT_DIR"), "/subxt_codegen.rs")); diff --git a/src/queries/utils.rs b/src/queries/utils.rs new file mode 100644 index 00000000000..1616065b29f --- /dev/null +++ b/src/queries/utils.rs @@ -0,0 +1,312 @@ +use crate::error::BeefyClientError; +use crate::primitives::{ParachainHeader, PartialMmrLeaf, SignedCommitment}; +use crate::queries::helpers::{ + fetch_timestamp_extrinsic_with_proof, hash_authority_addresses, prove_parachain_headers, + ParaHeadsProof, TimeStampExtWithProof, +}; +use crate::queries::relay_chain_queries::{fetch_beefy_justification, fetch_mmr_batch_proof}; +use crate::traits::{ClientState, HostFunctions}; +use crate::{get_leaf_index_for_block_number, queries::runtime, MerkleHasher, MmrUpdateProof}; +use beefy_primitives::known_payload_ids::MMR_ROOT_ID; +use beefy_primitives::mmr::{BeefyNextAuthoritySet, MmrLeaf}; +use codec::{Decode, Encode}; +use hex_literal::hex; +use pallet_mmr_primitives::BatchProof; +use sp_core::H256; +use sp_io::crypto; +use sp_runtime::{generic::Header, traits::BlakeTwo256}; +use subxt::sp_core::keccak_256; +use subxt::{Client, Config}; + +use super::helpers::{prove_authority_set, AuthorityProofWithSignatures}; +use super::relay_chain_queries::{ + fetch_finalized_parachain_heads, fetch_mmr_leaf_proof, FinalizedParaHeads, +}; + +#[derive(Clone)] +pub struct Crypto; + +impl HostFunctions for Crypto { + fn keccak_256(input: &[u8]) -> [u8; 32] { + keccak_256(input) + } + + fn secp256k1_ecdsa_recover_compressed( + signature: &[u8; 65], + value: &[u8; 32], + ) -> Option> { + crypto::secp256k1_ecdsa_recover_compressed(signature, value) + .ok() + .map(|val| val.to_vec()) + } +} + +pub struct ClientWrapper { + pub relay_client: Client, + pub para_client: Client, + pub beefy_activation_block: u32, + pub para_id: u32, +} + +impl ClientWrapper +where + u32: From<::BlockNumber>, +{ + pub async fn get_initial_client_state(client: Option<&Client>) -> ClientState { + if client.is_none() { + return ClientState { + latest_beefy_height: 0, + mmr_root_hash: Default::default(), + current_authorities: BeefyNextAuthoritySet { + id: 0, + len: 5, + root: H256::from(hex!( + "baa93c7834125ee3120bac6e3342bd3f28611110ad21ab6075367abdffefeb09" + )), + }, + next_authorities: BeefyNextAuthoritySet { + id: 1, + len: 5, + root: H256::from(hex!( + "baa93c7834125ee3120bac6e3342bd3f28611110ad21ab6075367abdffefeb09" + )), + }, + beefy_activation_block: 0, + }; + } + // Get initial validator set + // In development mode validators are the same for all sessions only validator set_id changes + let api = client + .expect("Client should be defined") + .clone() + .to_runtime_api::>>(); + let validator_set_id = api.storage().beefy().validator_set_id(None).await.unwrap(); + let next_val_set = api + .storage() + .mmr_leaf() + .beefy_next_authorities(None) + .await + .expect("Authorirty set should be defined"); + ClientState { + latest_beefy_height: 0, + mmr_root_hash: Default::default(), + current_authorities: BeefyNextAuthoritySet { + id: validator_set_id, + len: next_val_set.len, + root: next_val_set.root, + }, + next_authorities: BeefyNextAuthoritySet { + id: validator_set_id + 1, + len: next_val_set.len, + root: next_val_set.root, + }, + beefy_activation_block: 0, + } + } + + pub async fn fetch_finalized_parachain_headers_at( + &self, + commitment_block_number: u32, + latest_beefy_height: u32, + ) -> Result<(Vec, BatchProof), BeefyClientError> { + let FinalizedParaHeads { + leaf_indices, + raw_finalized_heads: finalized_blocks, + } = fetch_finalized_parachain_heads( + &self.relay_client, + commitment_block_number, + latest_beefy_height, + self.para_id, + self.beefy_activation_block, + ) + .await?; + + let subxt_block_number: subxt::BlockNumber = commitment_block_number.into(); + let block_hash = self + .relay_client + .rpc() + .block_hash(Some(subxt_block_number)) + .await?; + + let batch_proof = + fetch_mmr_batch_proof(&self.relay_client, leaf_indices, block_hash).await?; + + let leaves: Vec> = Decode::decode(&mut &*batch_proof.leaves.to_vec())?; + + let mut parachain_headers = vec![]; + for leaf_bytes in leaves { + let leaf: MmrLeaf = Decode::decode(&mut &*leaf_bytes)?; + let parent_block: u32 = leaf.parent_number_and_hash.0.into(); + let leaf_block_number = (parent_block + 1) as u64; + let para_headers = finalized_blocks.get(&leaf_block_number).ok_or_else(|| { + BeefyClientError::Custom(format!( + "[get_parachain_headers] Para Headers not found for relay chain block {}", + leaf_block_number + )) + })?; + let ParaHeadsProof { + parachain_heads_proof, + para_head, + heads_leaf_index, + heads_total_count, + } = prove_parachain_headers(¶_headers, self.para_id)?; + + let decoded_para_head = Header::::decode(&mut &*para_head)?; + let block_number = decoded_para_head.number; + let subxt_block_number: subxt::BlockNumber = block_number.into(); + let block_hash = self + .para_client + .rpc() + .block_hash(Some(subxt_block_number)) + .await?; + + let TimeStampExtWithProof { + ext: timestamp_extrinsic, + proof: extrinsic_proof, + } = fetch_timestamp_extrinsic_with_proof(&self.para_client, block_hash).await?; + + let header = ParachainHeader { + parachain_header: para_head, + partial_mmr_leaf: PartialMmrLeaf { + version: leaf.version, + parent_number_and_hash: leaf.parent_number_and_hash, + beefy_next_authority_set: leaf.beefy_next_authority_set.clone(), + }, + para_id: self.para_id, + parachain_heads_proof, + heads_leaf_index, + heads_total_count, + extrinsic_proof, + timestamp_extrinsic, + }; + + parachain_headers.push(header); + } + + let batch_proof: pallet_mmr_primitives::BatchProof = + Decode::decode(&mut batch_proof.proof.0.as_slice())?; + Ok((parachain_headers, batch_proof)) + } + + pub async fn fetch_mmr_update_proof_for( + &self, + signed_commitment: beefy_primitives::SignedCommitment< + u32, + beefy_primitives::crypto::Signature, + >, + ) -> Result { + let api = self + .relay_client + .clone() + .to_runtime_api::>>(); + let subxt_block_number: subxt::BlockNumber = + signed_commitment.commitment.block_number.into(); + let block_hash = self + .relay_client + .rpc() + .block_hash(Some(subxt_block_number)) + .await?; + + let current_authorities = api.storage().beefy().authorities(block_hash).await?; + + // Current LeafIndex + let block_number = signed_commitment.commitment.block_number; + let leaf_index = get_leaf_index_for_block_number(self.beefy_activation_block, block_number); + let leaf_proof = + fetch_mmr_leaf_proof(&self.relay_client, leaf_index.into(), block_hash).await?; + + let opaque_leaf: Vec = codec::Decode::decode(&mut &*leaf_proof.leaf.0)?; + let latest_leaf: MmrLeaf = + codec::Decode::decode(&mut &*opaque_leaf)?; + let mmr_proof: pallet_mmr_primitives::Proof = + codec::Decode::decode(&mut &*leaf_proof.proof.0)?; + + let authority_address_hashes = hash_authority_addresses( + current_authorities + .into_iter() + .map(|x| x.encode()) + .collect(), + )?; + + let AuthorityProofWithSignatures { + authority_proof, + signatures, + } = prove_authority_set(&signed_commitment, authority_address_hashes)?; + + Ok(MmrUpdateProof { + signed_commitment: SignedCommitment { + commitment: signed_commitment.commitment.clone(), + signatures, + }, + latest_mmr_leaf: latest_leaf.clone(), + mmr_proof, + authority_proof, + }) + } + + /// Construct a beefy client state to be submitted to the counterparty chain + pub async fn construct_beefy_client_state( + &self, + beefy_activation_block: u32, + ) -> Result { + let api = self + .relay_client + .clone() + .to_runtime_api::>>(); + + let (signed_commitment, latest_beefy_finalized) = + fetch_beefy_justification(&self.relay_client).await?; + + println!("Constructing a beefy header"); + // Encoding and decoding to fix dependency version conflicts + let next_authority_set = api + .storage() + .mmr_leaf() + .beefy_next_authorities(Some(latest_beefy_finalized)) + .await + .expect("Should retrieve next authority set") + .encode(); + let next_authority_set = BeefyNextAuthoritySet::decode(&mut &*next_authority_set) + .expect("Should decode next authority set correctly"); + + let current_authorities = api + .storage() + .beefy() + .authorities(Some(latest_beefy_finalized)) + .await + .expect("Should retrieve authority set"); + + let authority_address_hashes = hash_authority_addresses( + current_authorities + .into_iter() + .map(|x| x.encode()) + .collect(), + )?; + let tree = + rs_merkle::MerkleTree::>::from_leaves(&authority_address_hashes); + + let authority_root = tree.root().expect("Should generate root"); + let authority_root: H256 = authority_root.into(); + let current_authority_set = BeefyNextAuthoritySet { + id: next_authority_set.id - 1, + len: authority_address_hashes.len() as u32, + root: authority_root, + }; + + let mmr_root_hash = signed_commitment + .commitment + .payload + .get_decoded::(&MMR_ROOT_ID) + .expect("Mmr root hash should decode correctly"); + + let client_state = ClientState { + mmr_root_hash, + latest_beefy_height: signed_commitment.commitment.block_number as u32, + beefy_activation_block, + current_authorities: current_authority_set.clone(), + next_authorities: next_authority_set.clone(), + }; + + Ok(client_state) + } +} diff --git a/src/runtime.rs b/src/runtime.rs deleted file mode 100644 index 5ab1ea3e848..00000000000 --- a/src/runtime.rs +++ /dev/null @@ -1,33593 +0,0 @@ -#[allow(dead_code, unused_imports, non_camel_case_types, unused_qualifications)] -pub mod api { - use super::api as root_mod; - pub static PALLETS: [&str; 49usize] = [ - "System", - "Babe", - "Timestamp", - "Indices", - "Balances", - "TransactionPayment", - "Authorship", - "Offences", - "Historical", - "Session", - "Grandpa", - "ImOnline", - "AuthorityDiscovery", - "ParachainsOrigin", - "Configuration", - "ParasShared", - "ParaInclusion", - "ParaInherent", - "ParaScheduler", - "Paras", - "Initializer", - "Dmp", - "Ump", - "Hrmp", - "ParaSessionInfo", - "ParasDisputes", - "Registrar", - "Auctions", - "Crowdloan", - "Slots", - "ParasSudoWrapper", - "AssignedSlots", - "Sudo", - "Mmr", - "Beefy", - "MmrLeaf", - "ValidatorManager", - "BridgeRococoGrandpa", - "BridgeWococoGrandpa", - "BridgeRococoMessages", - "BridgeWococoMessages", - "BridgeRococoMessagesDispatch", - "BridgeWococoMessagesDispatch", - "Collective", - "Membership", - "Utility", - "Proxy", - "Multisig", - "XcmPallet", - ]; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - System(system::Event), - #[codec(index = 3)] - Indices(indices::Event), - #[codec(index = 4)] - Balances(balances::Event), - #[codec(index = 7)] - Offences(offences::Event), - #[codec(index = 9)] - Session(session::Event), - #[codec(index = 10)] - Grandpa(grandpa::Event), - #[codec(index = 11)] - ImOnline(im_online::Event), - #[codec(index = 16)] - ParaInclusion(para_inclusion::Event), - #[codec(index = 19)] - Paras(paras::Event), - #[codec(index = 22)] - Ump(ump::Event), - #[codec(index = 23)] - Hrmp(hrmp::Event), - #[codec(index = 25)] - ParasDisputes(paras_disputes::Event), - #[codec(index = 26)] - Registrar(registrar::Event), - #[codec(index = 27)] - Auctions(auctions::Event), - #[codec(index = 28)] - Crowdloan(crowdloan::Event), - #[codec(index = 29)] - Slots(slots::Event), - #[codec(index = 31)] - AssignedSlots(assigned_slots::Event), - #[codec(index = 32)] - Sudo(sudo::Event), - #[codec(index = 36)] - ValidatorManager(validator_manager::Event), - #[codec(index = 43)] - BridgeRococoMessages(bridge_rococo_messages::Event), - #[codec(index = 44)] - BridgeWococoMessages(bridge_wococo_messages::Event), - #[codec(index = 45)] - BridgeRococoMessagesDispatch(bridge_rococo_messages_dispatch::Event), - #[codec(index = 46)] - BridgeWococoMessagesDispatch(bridge_wococo_messages_dispatch::Event), - #[codec(index = 80)] - Collective(collective::Event), - #[codec(index = 81)] - Membership(membership::Event), - #[codec(index = 90)] - Utility(utility::Event), - #[codec(index = 91)] - Proxy(proxy::Event), - #[codec(index = 92)] - Multisig(multisig::Event), - #[codec(index = 99)] - XcmPallet(xcm_pallet::Event), - } - pub mod system { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct FillBlock { - pub ratio: runtime_types::sp_arithmetic::per_things::Perbill, - } - impl ::subxt::Call for FillBlock { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "fill_block"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Remark { - pub remark: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for Remark { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHeapPages { - pub pages: ::core::primitive::u64, - } - impl ::subxt::Call for SetHeapPages { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_heap_pages"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetCode { - pub code: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for SetCode { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetCodeWithoutChecks { - pub code: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for SetCodeWithoutChecks { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_code_without_checks"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetStorage { - pub items: ::std::vec::Vec<( - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - )>, - } - impl ::subxt::Call for SetStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_storage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct KillStorage { - pub keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - } - impl ::subxt::Call for KillStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_storage"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct KillPrefix { - pub prefix: ::std::vec::Vec<::core::primitive::u8>, - pub subkeys: ::core::primitive::u32, - } - impl ::subxt::Call for KillPrefix { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_prefix"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RemarkWithEvent { - pub remark: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for RemarkWithEvent { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark_with_event"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "A dispatch that will fill the block weight up to the given ratio."] - pub fn fill_block( - &self, - ratio: runtime_types::sp_arithmetic::per_things::Perbill, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - FillBlock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 228u8, 117u8, 251u8, 95u8, 47u8, 56u8, 32u8, 177u8, 191u8, 72u8, 75u8, - 23u8, 193u8, 175u8, 227u8, 218u8, 127u8, 94u8, 114u8, 110u8, 215u8, - 61u8, 162u8, 102u8, 73u8, 89u8, 218u8, 148u8, 59u8, 73u8, 59u8, 149u8, - ] - { - let call = FillBlock { ratio }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Make some on-chain remark."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`"] - #[doc = "# "] - pub fn remark( - &self, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Remark, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 186u8, 79u8, 33u8, 199u8, 216u8, 115u8, 19u8, 146u8, 220u8, 174u8, - 98u8, 61u8, 179u8, 230u8, 40u8, 70u8, 22u8, 251u8, 77u8, 62u8, 133u8, - 80u8, 186u8, 70u8, 135u8, 172u8, 178u8, 241u8, 69u8, 106u8, 235u8, - 140u8, - ] - { - let call = Remark { remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of pages in the WebAssembly environment's heap."] - pub fn set_heap_pages( - &self, - pages: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHeapPages, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 77u8, 138u8, 122u8, 55u8, 179u8, 101u8, 60u8, 137u8, 173u8, 39u8, 28u8, - 36u8, 237u8, 243u8, 232u8, 162u8, 76u8, 176u8, 135u8, 58u8, 60u8, - 177u8, 105u8, 136u8, 94u8, 53u8, 26u8, 31u8, 41u8, 156u8, 228u8, 241u8, - ] - { - let call = SetHeapPages { pages }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the new runtime code."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] - #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] - #[doc = " expensive)."] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] - #[doc = "expensive. We will treat this as a full block."] - #[doc = "# "] - pub fn set_code( - &self, - code: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 35u8, 75u8, 103u8, 203u8, 91u8, 141u8, 77u8, 95u8, 37u8, 157u8, 107u8, - 240u8, 54u8, 242u8, 245u8, 205u8, 104u8, 165u8, 177u8, 37u8, 86u8, - 197u8, 28u8, 202u8, 121u8, 159u8, 18u8, 204u8, 237u8, 117u8, 141u8, - 131u8, - ] - { - let call = SetCode { code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the new runtime code without doing any checks of the given `code`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C)` where `C` length of `code`"] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] - #[doc = "block. # "] - pub fn set_code_without_checks( - &self, - code: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCodeWithoutChecks, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 150u8, 148u8, 119u8, 129u8, 77u8, 216u8, 135u8, 187u8, 127u8, 24u8, - 238u8, 15u8, 227u8, 229u8, 191u8, 217u8, 106u8, 129u8, 149u8, 79u8, - 154u8, 78u8, 53u8, 159u8, 89u8, 69u8, 103u8, 197u8, 93u8, 161u8, 134u8, - 17u8, - ] - { - let call = SetCodeWithoutChecks { code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set some items of storage."] - pub fn set_storage( - &self, - items: ::std::vec::Vec<( - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - )>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetStorage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 197u8, 12u8, 119u8, 205u8, 152u8, 103u8, 211u8, 170u8, 146u8, 253u8, - 25u8, 56u8, 180u8, 146u8, 74u8, 75u8, 38u8, 108u8, 212u8, 154u8, 23u8, - 22u8, 148u8, 175u8, 107u8, 186u8, 222u8, 13u8, 149u8, 132u8, 204u8, - 217u8, - ] - { - let call = SetStorage { items }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Kill some items from storage."] - pub fn kill_storage( - &self, - keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillStorage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 154u8, 115u8, 185u8, 20u8, 126u8, 90u8, 222u8, 131u8, 199u8, 57u8, - 184u8, 226u8, 43u8, 245u8, 161u8, 176u8, 194u8, 123u8, 139u8, 97u8, - 97u8, 94u8, 47u8, 64u8, 204u8, 96u8, 190u8, 94u8, 216u8, 237u8, 69u8, - 51u8, - ] - { - let call = KillStorage { keys }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Kill all storage items with a key that starts with the given prefix."] - #[doc = ""] - #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] - #[doc = "the prefix we are removing to accurately calculate the weight of this function."] - pub fn kill_prefix( - &self, - prefix: ::std::vec::Vec<::core::primitive::u8>, - subkeys: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillPrefix, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 214u8, 101u8, 191u8, 241u8, 1u8, 241u8, 144u8, 116u8, 246u8, 199u8, - 159u8, 249u8, 155u8, 164u8, 220u8, 221u8, 75u8, 33u8, 204u8, 3u8, - 255u8, 201u8, 187u8, 238u8, 181u8, 213u8, 41u8, 105u8, 234u8, 120u8, - 202u8, 115u8, - ] - { - let call = KillPrefix { prefix, subkeys }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Make some on-chain remark and emit event."] - pub fn remark_with_event( - &self, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemarkWithEvent, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 171u8, 82u8, 75u8, 237u8, 69u8, 197u8, 223u8, 125u8, 123u8, 51u8, - 241u8, 35u8, 202u8, 210u8, 227u8, 109u8, 1u8, 241u8, 255u8, 63u8, 33u8, - 115u8, 156u8, 239u8, 97u8, 76u8, 193u8, 35u8, 74u8, 199u8, 43u8, 255u8, - ] - { - let call = RemarkWithEvent { remark }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::frame_system::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An extrinsic completed successfully."] - pub struct ExtrinsicSuccess { - pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, - } - impl ::subxt::Event for ExtrinsicSuccess { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "ExtrinsicSuccess"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An extrinsic failed."] - pub struct ExtrinsicFailed { - pub dispatch_error: runtime_types::sp_runtime::DispatchError, - pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, - } - impl ::subxt::Event for ExtrinsicFailed { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "ExtrinsicFailed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "`:code` was updated."] - pub struct CodeUpdated; - impl ::subxt::Event for CodeUpdated { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "CodeUpdated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A new account was created."] - pub struct NewAccount { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for NewAccount { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "NewAccount"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An account was reaped."] - pub struct KilledAccount { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for KilledAccount { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "KilledAccount"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "On on-chain remark happened."] - pub struct Remarked { - pub sender: ::subxt::sp_core::crypto::AccountId32, - pub hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Remarked { - const PALLET: &'static str = "System"; - const EVENT: &'static str = "Remarked"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Account<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Account"; - type Value = runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ExtrinsicCount; - impl ::subxt::StorageEntry for ExtrinsicCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExtrinsicCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockWeight; - impl ::subxt::StorageEntry for BlockWeight { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "BlockWeight"; - type Value = - runtime_types::frame_support::weights::PerDispatchClass<::core::primitive::u64>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AllExtrinsicsLen; - impl ::subxt::StorageEntry for AllExtrinsicsLen { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "AllExtrinsicsLen"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockHash<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for BlockHash<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "BlockHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ExtrinsicData<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ExtrinsicData<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExtrinsicData"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Number; - impl ::subxt::StorageEntry for Number { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Number"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParentHash; - impl ::subxt::StorageEntry for ParentHash { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ParentHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Digest; - impl ::subxt::StorageEntry for Digest { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Digest"; - type Value = runtime_types::sp_runtime::generic::digest::Digest; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Events; - impl ::subxt::StorageEntry for Events { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "Events"; - type Value = ::std::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::rococo_runtime::Event, - ::subxt::sp_core::H256, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EventCount; - impl ::subxt::StorageEntry for EventCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EventTopics<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for EventTopics<'_> { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventTopics"; - type Value = ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct LastRuntimeUpgrade; - impl ::subxt::StorageEntry for LastRuntimeUpgrade { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "LastRuntimeUpgrade"; - type Value = runtime_types::frame_system::LastRuntimeUpgradeInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToU32RefCount; - impl ::subxt::StorageEntry for UpgradedToU32RefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToU32RefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToTripleRefCount; - impl ::subxt::StorageEntry for UpgradedToTripleRefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToTripleRefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ExecutionPhase; - impl ::subxt::StorageEntry for ExecutionPhase { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExecutionPhase"; - type Value = runtime_types::frame_system::Phase; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The full account information for a particular account ID."] - pub async fn account( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 224u8, 184u8, 2u8, 14u8, 38u8, 177u8, 223u8, 98u8, 223u8, 15u8, 130u8, - 23u8, 212u8, 69u8, 61u8, 165u8, 171u8, 61u8, 171u8, 57u8, 88u8, 71u8, - 168u8, 172u8, 54u8, 91u8, 109u8, 231u8, 169u8, 167u8, 195u8, 46u8, - ] - { - let entry = Account(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The full account information for a particular account ID."] - pub async fn account_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Account<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 224u8, 184u8, 2u8, 14u8, 38u8, 177u8, 223u8, 98u8, 223u8, 15u8, 130u8, - 23u8, 212u8, 69u8, 61u8, 165u8, 171u8, 61u8, 171u8, 57u8, 88u8, 71u8, - 168u8, 172u8, 54u8, 91u8, 109u8, 231u8, 169u8, 167u8, 195u8, 46u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Total extrinsics count for the current block."] - pub async fn extrinsic_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 223u8, 60u8, 201u8, 120u8, 36u8, 44u8, 180u8, 210u8, 242u8, 53u8, - 222u8, 154u8, 123u8, 176u8, 249u8, 8u8, 225u8, 28u8, 232u8, 4u8, 136u8, - 41u8, 151u8, 82u8, 189u8, 149u8, 49u8, 166u8, 139u8, 9u8, 163u8, 231u8, - ] - { - let entry = ExtrinsicCount; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current weight for the block."] - pub async fn block_weight( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::PerDispatchClass<::core::primitive::u64>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 2u8, 236u8, 190u8, 174u8, 244u8, 98u8, 194u8, 168u8, 89u8, 208u8, 7u8, - 45u8, 175u8, 171u8, 177u8, 121u8, 215u8, 190u8, 184u8, 195u8, 49u8, - 133u8, 44u8, 1u8, 181u8, 215u8, 89u8, 84u8, 255u8, 16u8, 57u8, 152u8, - ] - { - let entry = BlockWeight; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Total length (in bytes) for all extrinsics put together, for the current block."] - pub async fn all_extrinsics_len( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 202u8, 145u8, 209u8, 225u8, 40u8, 220u8, 174u8, 74u8, 93u8, 164u8, - 254u8, 248u8, 254u8, 192u8, 32u8, 117u8, 96u8, 149u8, 53u8, 145u8, - 219u8, 64u8, 234u8, 18u8, 217u8, 200u8, 203u8, 141u8, 145u8, 28u8, - 134u8, 60u8, - ] - { - let entry = AllExtrinsicsLen; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of block numbers to block hashes."] - pub async fn block_hash( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 24u8, 99u8, 146u8, 142u8, 205u8, 166u8, 4u8, 32u8, 218u8, 213u8, 24u8, - 236u8, 45u8, 116u8, 145u8, 204u8, 27u8, 141u8, 169u8, 249u8, 111u8, - 141u8, 37u8, 136u8, 45u8, 73u8, 167u8, 217u8, 118u8, 206u8, 246u8, - 120u8, - ] - { - let entry = BlockHash(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of block numbers to block hashes."] - pub async fn block_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, BlockHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 24u8, 99u8, 146u8, 142u8, 205u8, 166u8, 4u8, 32u8, 218u8, 213u8, 24u8, - 236u8, 45u8, 116u8, 145u8, 204u8, 27u8, 141u8, 169u8, 249u8, 111u8, - 141u8, 37u8, 136u8, 45u8, 73u8, 167u8, 217u8, 118u8, 206u8, 246u8, - 120u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] - pub async fn extrinsic_data( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, 238u8, 211u8, - 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, 168u8, 125u8, 98u8, 23u8, 241u8, - 59u8, 49u8, 86u8, 126u8, 9u8, 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, - ] - { - let entry = ExtrinsicData(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] - pub async fn extrinsic_data_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ExtrinsicData<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, 238u8, 211u8, - 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, 168u8, 125u8, 98u8, 23u8, 241u8, - 59u8, 49u8, 86u8, 126u8, 9u8, 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current block number being processed. Set by `execute_block`."] - pub async fn number( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 228u8, 96u8, 102u8, 190u8, 252u8, 130u8, 239u8, 172u8, 126u8, 235u8, - 246u8, 139u8, 208u8, 15u8, 88u8, 245u8, 141u8, 232u8, 43u8, 204u8, - 36u8, 87u8, 211u8, 141u8, 187u8, 68u8, 236u8, 70u8, 193u8, 235u8, - 164u8, 191u8, - ] - { - let entry = Number; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Hash of the previous block."] - pub async fn parent_hash( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 194u8, 221u8, 147u8, 22u8, 68u8, 141u8, 32u8, 6u8, 202u8, 39u8, 164u8, - 184u8, 69u8, 126u8, 190u8, 101u8, 215u8, 27u8, 127u8, 157u8, 200u8, - 69u8, 170u8, 139u8, 232u8, 27u8, 254u8, 181u8, 183u8, 105u8, 111u8, - 177u8, - ] - { - let entry = ParentHash; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Digest of the current block, also part of the block header."] - pub async fn digest( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_runtime::generic::digest::Digest, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 10u8, 176u8, 13u8, 228u8, 226u8, 42u8, 210u8, 151u8, 107u8, 212u8, - 136u8, 15u8, 38u8, 182u8, 225u8, 12u8, 250u8, 56u8, 193u8, 243u8, - 219u8, 113u8, 95u8, 233u8, 21u8, 229u8, 125u8, 146u8, 92u8, 250u8, - 32u8, 168u8, - ] - { - let entry = Digest; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Events deposited for the current block."] - #[doc = ""] - #[doc = " NOTE: The item is unbound and should therefore never be read on chain."] - #[doc = " It could otherwise inflate the PoV size of a block."] - #[doc = ""] - #[doc = " Events have a large in-memory size. Box the events to not go out-of-memory"] - #[doc = " just in case someone still reads them from within the runtime."] - pub async fn events( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::rococo_runtime::Event, - ::subxt::sp_core::H256, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 102u8, 185u8, 5u8, 149u8, 227u8, 155u8, 48u8, 16u8, 217u8, 255u8, - 253u8, 140u8, 56u8, 26u8, 192u8, 151u8, 218u8, 201u8, 8u8, 32u8, 123u8, - 156u8, 52u8, 183u8, 39u8, 139u8, 177u8, 63u8, 171u8, 153u8, 249u8, - 134u8, - ] - { - let entry = Events; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of events in the `Events` list."] - pub async fn event_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 236u8, 93u8, 90u8, 177u8, 250u8, 211u8, 138u8, 187u8, 26u8, 208u8, - 203u8, 113u8, 221u8, 233u8, 227u8, 9u8, 249u8, 25u8, 202u8, 185u8, - 161u8, 144u8, 167u8, 104u8, 127u8, 187u8, 38u8, 18u8, 52u8, 61u8, 66u8, - 112u8, - ] - { - let entry = EventCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 `(T::BlockNumber, 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 async fn event_topics( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 231u8, 73u8, 172u8, 223u8, 210u8, 145u8, 151u8, 102u8, 73u8, 23u8, - 140u8, 55u8, 97u8, 40u8, 219u8, 239u8, 229u8, 177u8, 72u8, 41u8, 93u8, - 178u8, 7u8, 209u8, 57u8, 86u8, 153u8, 252u8, 86u8, 152u8, 245u8, 179u8, - ] - { - let entry = EventTopics(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 `(T::BlockNumber, 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 async fn event_topics_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, EventTopics<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 231u8, 73u8, 172u8, 223u8, 210u8, 145u8, 151u8, 102u8, 73u8, 23u8, - 140u8, 55u8, 97u8, 40u8, 219u8, 239u8, 229u8, 177u8, 72u8, 41u8, 93u8, - 178u8, 7u8, 209u8, 57u8, 86u8, 153u8, 252u8, 86u8, 152u8, 245u8, 179u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] - pub async fn last_runtime_upgrade( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 219u8, 153u8, 158u8, 38u8, 45u8, 65u8, 151u8, 137u8, 53u8, 76u8, 11u8, - 181u8, 218u8, 248u8, 125u8, 190u8, 100u8, 240u8, 173u8, 75u8, 179u8, - 137u8, 198u8, 197u8, 248u8, 185u8, 118u8, 58u8, 42u8, 165u8, 125u8, - 119u8, - ] - { - let entry = LastRuntimeUpgrade; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] - pub async fn upgraded_to_u32_ref_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 171u8, 88u8, 244u8, 92u8, 122u8, 67u8, 27u8, 18u8, 59u8, 175u8, 175u8, - 178u8, 20u8, 150u8, 213u8, 59u8, 222u8, 141u8, 32u8, 107u8, 3u8, 114u8, - 83u8, 250u8, 180u8, 233u8, 152u8, 54u8, 187u8, 99u8, 131u8, 204u8, - ] - { - let entry = UpgradedToU32RefCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " True if we have upgraded so that AccountInfo contains three types of `RefCount`. False"] - #[doc = " (default) if not."] - pub async fn upgraded_to_triple_ref_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 90u8, 33u8, 56u8, 86u8, 90u8, 101u8, 89u8, 133u8, 203u8, 56u8, 201u8, - 210u8, 244u8, 232u8, 150u8, 18u8, 51u8, 105u8, 14u8, 230u8, 103u8, - 155u8, 246u8, 99u8, 53u8, 207u8, 225u8, 128u8, 186u8, 76u8, 40u8, - 185u8, - ] - { - let entry = UpgradedToTripleRefCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The execution phase of the block."] - pub async fn execution_phase( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 174u8, 13u8, 230u8, 220u8, 239u8, 161u8, 172u8, 122u8, 188u8, 95u8, - 141u8, 118u8, 91u8, 158u8, 111u8, 145u8, 243u8, 173u8, 226u8, 212u8, - 187u8, 118u8, 94u8, 132u8, 221u8, 244u8, 61u8, 148u8, 217u8, 30u8, - 238u8, 225u8, - ] - { - let entry = ExecutionPhase; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Block & extrinsics weights: base values and limits."] - pub fn block_weights( - &self, - ) -> ::core::result::Result< - runtime_types::frame_system::limits::BlockWeights, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("System", "BlockWeights")? - == [ - 215u8, 15u8, 243u8, 205u8, 15u8, 204u8, 67u8, 181u8, 5u8, 25u8, 77u8, - 32u8, 15u8, 69u8, 250u8, 90u8, 118u8, 42u8, 116u8, 3u8, 231u8, 203u8, - 152u8, 28u8, 230u8, 136u8, 184u8, 234u8, 38u8, 25u8, 58u8, 181u8, - ] - { - let pallet = locked_metadata.pallet("System")?; - let constant = pallet.constant("BlockWeights")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum length of a block (in bytes)."] - pub fn block_length( - &self, - ) -> ::core::result::Result< - runtime_types::frame_system::limits::BlockLength, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("System", "BlockLength")? - == [ - 120u8, 249u8, 182u8, 103u8, 246u8, 214u8, 149u8, 44u8, 42u8, 64u8, 2u8, - 56u8, 157u8, 184u8, 43u8, 195u8, 214u8, 251u8, 207u8, 207u8, 249u8, - 105u8, 203u8, 108u8, 179u8, 93u8, 93u8, 246u8, 40u8, 175u8, 160u8, - 114u8, - ] - { - let pallet = locked_metadata.pallet("System")?; - let constant = pallet.constant("BlockLength")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] - pub fn block_hash_count( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("System", "BlockHashCount")? - == [ - 123u8, 126u8, 182u8, 103u8, 71u8, 187u8, 233u8, 8u8, 47u8, 226u8, - 159u8, 139u8, 0u8, 59u8, 190u8, 135u8, 189u8, 77u8, 190u8, 81u8, 39u8, - 198u8, 224u8, 219u8, 70u8, 143u8, 6u8, 132u8, 196u8, 61u8, 117u8, - 194u8, - ] - { - let pallet = locked_metadata.pallet("System")?; - let constant = pallet.constant("BlockHashCount")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The weight of runtime database operations the runtime can invoke."] - pub fn db_weight( - &self, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::RuntimeDbWeight, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("System", "DbWeight")? - == [ - 203u8, 8u8, 106u8, 152u8, 74u8, 132u8, 2u8, 132u8, 244u8, 106u8, 147u8, - 12u8, 93u8, 80u8, 61u8, 158u8, 172u8, 178u8, 228u8, 125u8, 213u8, - 102u8, 75u8, 210u8, 64u8, 185u8, 204u8, 84u8, 10u8, 164u8, 204u8, 62u8, - ] - { - let pallet = locked_metadata.pallet("System")?; - let constant = pallet.constant("DbWeight")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Get the chain's current version."] - pub fn version( - &self, - ) -> ::core::result::Result< - runtime_types::sp_version::RuntimeVersion, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("System", "Version")? - == [ - 204u8, 182u8, 166u8, 232u8, 201u8, 27u8, 210u8, 58u8, 156u8, 104u8, - 233u8, 214u8, 202u8, 35u8, 247u8, 203u8, 119u8, 118u8, 106u8, 249u8, - 73u8, 145u8, 104u8, 122u8, 34u8, 30u8, 41u8, 131u8, 209u8, 223u8, - 165u8, 89u8, - ] - { - let pallet = locked_metadata.pallet("System")?; - let constant = pallet.constant("Version")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The designated SS85 prefix of this chain."] - #[doc = ""] - #[doc = " This replaces the \"ss58Format\" property declared in the chain spec. Reason is"] - #[doc = " that the runtime should know about the prefix in order to make use of it as"] - #[doc = " an identifier of the chain."] - pub fn ss58_prefix( - &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("System", "SS58Prefix")? - == [ - 197u8, 217u8, 49u8, 68u8, 82u8, 238u8, 120u8, 50u8, 91u8, 58u8, 6u8, - 156u8, 40u8, 1u8, 241u8, 213u8, 141u8, 74u8, 83u8, 115u8, 117u8, 41u8, - 119u8, 50u8, 140u8, 136u8, 163u8, 185u8, 34u8, 190u8, 60u8, 97u8, - ] - { - let pallet = locked_metadata.pallet("System")?; - let constant = pallet.constant("SS58Prefix")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod babe { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReportEquivocation { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocation { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "report_equivocation"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocationUnsigned { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "report_equivocation_unsigned"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PlanConfigChange { - pub config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - } - impl ::subxt::Call for PlanConfigChange { - const PALLET: &'static str = "Babe"; - const FUNCTION: &'static str = "plan_config_change"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - pub fn report_equivocation( - &self, - equivocation_proof: runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocation, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 123u8, 212u8, 216u8, 77u8, 79u8, 132u8, 201u8, 155u8, 166u8, 230u8, - 50u8, 89u8, 98u8, 68u8, 56u8, 213u8, 206u8, 245u8, 91u8, 104u8, 89u8, - 189u8, 57u8, 38u8, 127u8, 22u8, 47u8, 206u8, 142u8, 202u8, 106u8, - 154u8, - ] - { - let call = ReportEquivocation { - equivocation_proof: ::std::boxed::Box::new(equivocation_proof), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_equivocation_unsigned( - &self, - equivocation_proof: runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocationUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 32u8, 163u8, 168u8, 251u8, 251u8, 9u8, 1u8, 195u8, 173u8, 32u8, 235u8, - 125u8, 141u8, 201u8, 130u8, 207u8, 239u8, 76u8, 150u8, 99u8, 74u8, - 193u8, 60u8, 165u8, 93u8, 49u8, 95u8, 224u8, 217u8, 243u8, 117u8, - 173u8, - ] - { - let call = ReportEquivocationUnsigned { - equivocation_proof: ::std::boxed::Box::new(equivocation_proof), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] - #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] - #[doc = "Multiple calls to this method will replace any existing planned config change that had"] - #[doc = "not been enacted yet."] - pub fn plan_config_change( - &self, - config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PlanConfigChange, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 215u8, 121u8, 90u8, 87u8, 178u8, 247u8, 114u8, 53u8, 174u8, 28u8, 20u8, - 33u8, 139u8, 216u8, 13u8, 187u8, 74u8, 198u8, 38u8, 28u8, 175u8, 13u8, - 73u8, 132u8, 103u8, 78u8, 217u8, 207u8, 113u8, 169u8, 42u8, 103u8, - ] - { - let call = PlanConfigChange { config }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct EpochIndex; - impl ::subxt::StorageEntry for EpochIndex { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochIndex"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Authorities; - impl ::subxt::StorageEntry for Authorities { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Authorities"; - type Value = - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct GenesisSlot; - impl ::subxt::StorageEntry for GenesisSlot { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "GenesisSlot"; - type Value = runtime_types::sp_consensus_slots::Slot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentSlot; - impl ::subxt::StorageEntry for CurrentSlot { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "CurrentSlot"; - type Value = runtime_types::sp_consensus_slots::Slot; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Randomness; - impl ::subxt::StorageEntry for Randomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Randomness"; - type Value = [::core::primitive::u8; 32usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingEpochConfigChange; - impl ::subxt::StorageEntry for PendingEpochConfigChange { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "PendingEpochConfigChange"; - type Value = runtime_types::sp_consensus_babe::digests::NextConfigDescriptor; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextRandomness; - impl ::subxt::StorageEntry for NextRandomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextRandomness"; - type Value = [::core::primitive::u8; 32usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextAuthorities; - impl ::subxt::StorageEntry for NextAuthorities { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextAuthorities"; - type Value = - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SegmentIndex; - impl ::subxt::StorageEntry for SegmentIndex { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "SegmentIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UnderConstruction<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for UnderConstruction<'_> { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "UnderConstruction"; - type Value = runtime_types::frame_support::storage::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Initialized; - impl ::subxt::StorageEntry for Initialized { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Initialized"; - type Value = - ::core::option::Option; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AuthorVrfRandomness; - impl ::subxt::StorageEntry for AuthorVrfRandomness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "AuthorVrfRandomness"; - type Value = ::core::option::Option<[::core::primitive::u8; 32usize]>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EpochStart; - impl ::subxt::StorageEntry for EpochStart { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochStart"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Lateness; - impl ::subxt::StorageEntry for Lateness { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "Lateness"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EpochConfig; - impl ::subxt::StorageEntry for EpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextEpochConfig; - impl ::subxt::StorageEntry for NextEpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextEpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Current epoch index."] - pub async fn epoch_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 51u8, 27u8, 91u8, 156u8, 118u8, 99u8, 46u8, 219u8, 190u8, 147u8, 205u8, - 23u8, 106u8, 169u8, 121u8, 218u8, 208u8, 235u8, 135u8, 127u8, 243u8, - 41u8, 55u8, 243u8, 235u8, 122u8, 57u8, 86u8, 37u8, 90u8, 208u8, 71u8, - ] - { - let entry = EpochIndex; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Current epoch authorities."] - pub async fn authorities( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 39u8, 102u8, 251u8, 125u8, 230u8, 247u8, 174u8, 255u8, 2u8, 81u8, 86u8, - 69u8, 182u8, 92u8, 191u8, 163u8, 66u8, 181u8, 247u8, 9u8, 57u8, 154u8, - 239u8, 34u8, 25u8, 139u8, 119u8, 4u8, 131u8, 124u8, 135u8, 240u8, - ] - { - let entry = Authorities; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The slot at which the first epoch actually started. This is 0"] - #[doc = " until the first block of the chain."] - pub async fn genesis_slot( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 136u8, 244u8, 7u8, 142u8, 224u8, 33u8, 144u8, 186u8, 155u8, 144u8, - 68u8, 81u8, 241u8, 57u8, 40u8, 207u8, 35u8, 39u8, 28u8, 41u8, 210u8, - 213u8, 53u8, 195u8, 175u8, 119u8, 6u8, 175u8, 100u8, 192u8, 180u8, - 73u8, - ] - { - let entry = GenesisSlot; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Current slot number."] - pub async fn current_slot( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 233u8, 102u8, 77u8, 99u8, 103u8, 50u8, 151u8, 229u8, 46u8, 226u8, - 181u8, 37u8, 117u8, 204u8, 234u8, 120u8, 116u8, 166u8, 80u8, 188u8, - 92u8, 154u8, 137u8, 150u8, 79u8, 164u8, 29u8, 203u8, 2u8, 51u8, 123u8, - 104u8, - ] - { - let entry = CurrentSlot; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The epoch randomness for the *current* epoch."] - #[doc = ""] - #[doc = " # Security"] - #[doc = ""] - #[doc = " This MUST NOT be used for gambling, as it can be influenced by a"] - #[doc = " malicious validator in the short term. It MAY be used in many"] - #[doc = " cryptographic protocols, however, so long as one remembers that this"] - #[doc = " (like everything else on-chain) it is public. For example, it can be"] - #[doc = " used where a number is needed that cannot have been chosen by an"] - #[doc = " adversary, for purposes such as public-coin zero-knowledge proofs."] - pub async fn randomness( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<[::core::primitive::u8; 32usize], ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 191u8, 197u8, 25u8, 164u8, 104u8, 248u8, 247u8, 193u8, 244u8, 60u8, - 181u8, 195u8, 248u8, 90u8, 41u8, 199u8, 82u8, 123u8, 72u8, 126u8, 18u8, - 17u8, 128u8, 215u8, 34u8, 251u8, 227u8, 70u8, 166u8, 10u8, 104u8, - 140u8, - ] - { - let entry = Randomness; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Pending epoch configuration change that will be applied when the next epoch is enacted."] - pub async fn pending_epoch_config_change( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 98u8, 52u8, 22u8, 32u8, 76u8, 196u8, 89u8, 78u8, 119u8, 181u8, 17u8, - 49u8, 220u8, 159u8, 195u8, 74u8, 33u8, 59u8, 15u8, 104u8, 26u8, 111u8, - 165u8, 68u8, 147u8, 14u8, 86u8, 94u8, 250u8, 167u8, 146u8, 82u8, - ] - { - let entry = PendingEpochConfigChange; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Next epoch randomness."] - pub async fn next_randomness( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<[::core::primitive::u8; 32usize], ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 185u8, 98u8, 45u8, 109u8, 253u8, 38u8, 238u8, 221u8, 240u8, 29u8, 38u8, - 107u8, 118u8, 117u8, 131u8, 115u8, 21u8, 255u8, 203u8, 81u8, 243u8, - 251u8, 91u8, 60u8, 163u8, 202u8, 125u8, 193u8, 173u8, 234u8, 166u8, - 92u8, - ] - { - let entry = NextRandomness; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Next epoch authorities."] - pub async fn next_authorities( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_consensus_babe::app::Public, - ::core::primitive::u64, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 211u8, 175u8, 218u8, 0u8, 212u8, 114u8, 210u8, 137u8, 146u8, 135u8, - 78u8, 133u8, 85u8, 253u8, 140u8, 242u8, 101u8, 155u8, 159u8, 8u8, - 217u8, 176u8, 234u8, 143u8, 212u8, 103u8, 198u8, 94u8, 121u8, 111u8, - 56u8, 89u8, - ] - { - let entry = NextAuthorities; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Randomness under construction."] - #[doc = ""] - #[doc = " We make a trade-off between storage accesses and list length."] - #[doc = " We store the under-construction randomness in segments of up to"] - #[doc = " `UNDER_CONSTRUCTION_SEGMENT_LENGTH`."] - #[doc = ""] - #[doc = " Once a segment reaches this length, we begin the next one."] - #[doc = " We reset all segments and return to `0` at the beginning of every"] - #[doc = " epoch."] - pub async fn segment_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 128u8, 45u8, 87u8, 58u8, 174u8, 152u8, 241u8, 156u8, 56u8, 192u8, 19u8, - 45u8, 75u8, 160u8, 35u8, 253u8, 145u8, 11u8, 178u8, 81u8, 114u8, 117u8, - 112u8, 107u8, 163u8, 208u8, 240u8, 151u8, 102u8, 176u8, 246u8, 5u8, - ] - { - let entry = SegmentIndex; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] - pub async fn under_construction( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 12u8, 167u8, 30u8, 96u8, 161u8, 63u8, 210u8, 63u8, 91u8, 199u8, 188u8, - 78u8, 254u8, 255u8, 253u8, 202u8, 203u8, 26u8, 4u8, 105u8, 76u8, 125u8, - 191u8, 245u8, 32u8, 97u8, 127u8, 129u8, 167u8, 80u8, 210u8, 123u8, - ] - { - let entry = UnderConstruction(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] - pub async fn under_construction_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UnderConstruction<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 12u8, 167u8, 30u8, 96u8, 161u8, 63u8, 210u8, 63u8, 91u8, 199u8, 188u8, - 78u8, 254u8, 255u8, 253u8, 202u8, 203u8, 26u8, 4u8, 105u8, 76u8, 125u8, - 191u8, 245u8, 32u8, 97u8, 127u8, 129u8, 167u8, 80u8, 210u8, 123u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Temporary value (cleared at block finalization) which is `Some`"] - #[doc = " if per-block initialization has already been called for current block."] - pub async fn initialized( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - ::core::option::Option< - runtime_types::sp_consensus_babe::digests::PreDigest, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 174u8, 23u8, 254u8, 52u8, 114u8, 235u8, 65u8, 46u8, 39u8, 97u8, 238u8, - 243u8, 237u8, 138u8, 142u8, 85u8, 114u8, 69u8, 58u8, 172u8, 7u8, 238u8, - 110u8, 153u8, 22u8, 122u8, 117u8, 149u8, 113u8, 221u8, 127u8, 225u8, - ] - { - let entry = Initialized; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " This field should always be populated during block processing unless"] - #[doc = " secondary plain slots are enabled (which don't contain a VRF output)."] - #[doc = ""] - #[doc = " It is set in `on_finalize`, before it will contain the value from the last block."] - pub async fn author_vrf_randomness( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<[::core::primitive::u8; 32usize]>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 66u8, 235u8, 74u8, 252u8, 222u8, 135u8, 19u8, 28u8, 74u8, 191u8, 170u8, - 197u8, 207u8, 127u8, 77u8, 121u8, 138u8, 138u8, 110u8, 187u8, 34u8, - 14u8, 230u8, 43u8, 241u8, 241u8, 63u8, 163u8, 53u8, 179u8, 250u8, - 247u8, - ] - { - let entry = AuthorVrfRandomness; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The block numbers when the last and current epoch have started, respectively `N-1` and"] - #[doc = " `N`."] - #[doc = " NOTE: We track this is in order to annotate the block number when a given pool of"] - #[doc = " entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in"] - #[doc = " slots, which may be skipped, the block numbers may not line up with the slot numbers."] - pub async fn epoch_start( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - (::core::primitive::u32, ::core::primitive::u32), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 196u8, 39u8, 241u8, 20u8, 150u8, 180u8, 136u8, 4u8, 195u8, 205u8, - 218u8, 10u8, 130u8, 131u8, 168u8, 243u8, 207u8, 249u8, 58u8, 195u8, - 177u8, 119u8, 110u8, 243u8, 241u8, 3u8, 245u8, 56u8, 157u8, 5u8, 68u8, - 60u8, - ] - { - let entry = EpochStart; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " How late the current block is compared to its parent."] - #[doc = ""] - #[doc = " This entry is populated as part of block execution and is cleaned up"] - #[doc = " on block finalization. Querying this storage entry outside of block"] - #[doc = " execution context should always yield zero."] - pub async fn lateness( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 229u8, 230u8, 224u8, 89u8, 49u8, 213u8, 198u8, 236u8, 144u8, 56u8, - 193u8, 234u8, 62u8, 242u8, 191u8, 199u8, 105u8, 131u8, 74u8, 63u8, - 75u8, 1u8, 210u8, 49u8, 3u8, 128u8, 18u8, 77u8, 219u8, 146u8, 60u8, - 88u8, - ] - { - let entry = Lateness; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The configuration for the current epoch. Should never be `None` as it is initialized in"] - #[doc = " genesis."] - pub async fn epoch_config( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 169u8, 189u8, 214u8, 159u8, 181u8, 232u8, 243u8, 4u8, 113u8, 24u8, - 221u8, 229u8, 27u8, 35u8, 3u8, 121u8, 136u8, 88u8, 187u8, 193u8, 207u8, - 153u8, 223u8, 225u8, 166u8, 183u8, 53u8, 3u8, 162u8, 207u8, 88u8, - 133u8, - ] - { - let entry = EpochConfig; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The configuration for the next epoch, `None` if the config will not change"] - #[doc = " (you can fallback to `EpochConfig` instead in that case)."] - pub async fn next_epoch_config( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 239u8, 125u8, 203u8, 223u8, 161u8, 107u8, 232u8, 54u8, 158u8, 100u8, - 244u8, 140u8, 119u8, 58u8, 253u8, 245u8, 73u8, 236u8, 50u8, 67u8, - 228u8, 162u8, 166u8, 168u8, 162u8, 152u8, 239u8, 246u8, 153u8, 223u8, - 109u8, 121u8, - ] - { - let entry = NextEpochConfig; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The amount of time, in slots, that each epoch should last."] - #[doc = " NOTE: Currently it is not possible to change the epoch duration after"] - #[doc = " the chain has started. Attempting to do so will brick block production."] - pub fn epoch_duration( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Babe", "EpochDuration")? - == [ - 59u8, 175u8, 230u8, 66u8, 80u8, 146u8, 114u8, 61u8, 39u8, 30u8, 164u8, - 158u8, 155u8, 71u8, 224u8, 229u8, 68u8, 52u8, 30u8, 195u8, 39u8, 8u8, - 6u8, 196u8, 21u8, 54u8, 163u8, 187u8, 4u8, 42u8, 47u8, 92u8, - ] - { - let pallet = locked_metadata.pallet("Babe")?; - let constant = pallet.constant("EpochDuration")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The expected average block time at which BABE should be creating"] - #[doc = " blocks. Since BABE is probabilistic it is not trivial to figure out"] - #[doc = " what the expected average block time should be based on the slot"] - #[doc = " duration and the security parameter `c` (where `1 - c` represents"] - #[doc = " the probability of a slot being empty)."] - pub fn expected_block_time( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Babe", "ExpectedBlockTime")? - == [ - 249u8, 170u8, 37u8, 7u8, 132u8, 115u8, 106u8, 71u8, 116u8, 166u8, 78u8, - 251u8, 242u8, 146u8, 99u8, 207u8, 204u8, 225u8, 157u8, 57u8, 19u8, - 17u8, 202u8, 231u8, 50u8, 67u8, 17u8, 205u8, 238u8, 80u8, 154u8, 125u8, - ] - { - let pallet = locked_metadata.pallet("Babe")?; - let constant = pallet.constant("ExpectedBlockTime")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Max number of authorities allowed"] - pub fn max_authorities( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Babe", "MaxAuthorities")? - == [ - 248u8, 195u8, 131u8, 166u8, 10u8, 50u8, 71u8, 223u8, 41u8, 49u8, 43u8, - 99u8, 251u8, 113u8, 75u8, 193u8, 159u8, 15u8, 77u8, 217u8, 147u8, - 205u8, 165u8, 50u8, 6u8, 166u8, 77u8, 189u8, 102u8, 22u8, 201u8, 19u8, - ] - { - let pallet = locked_metadata.pallet("Babe")?; - let constant = pallet.constant("MaxAuthorities")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod timestamp { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Set { - #[codec(compact)] - pub now: ::core::primitive::u64, - } - impl ::subxt::Call for Set { - const PALLET: &'static str = "Timestamp"; - const FUNCTION: &'static str = "set"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the current time."] - #[doc = ""] - #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] - #[doc = "phase, if this call hasn't been invoked by that time."] - #[doc = ""] - #[doc = "The timestamp should be greater than the previous one by the amount specified by"] - #[doc = "`MinimumPeriod`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Inherent`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] - #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] - #[doc = " `on_finalize`)"] - #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] - #[doc = "# "] - pub fn set( - &self, - now: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Set, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 191u8, 73u8, 102u8, 150u8, 65u8, 157u8, 172u8, 194u8, 7u8, 72u8, 1u8, - 35u8, 54u8, 99u8, 245u8, 139u8, 40u8, 136u8, 245u8, 53u8, 167u8, 100u8, - 143u8, 244u8, 160u8, 5u8, 18u8, 130u8, 77u8, 160u8, 227u8, 51u8, - ] - { - let call = Set { now }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Now; - impl ::subxt::StorageEntry for Now { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "Now"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DidUpdate; - impl ::subxt::StorageEntry for DidUpdate { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "DidUpdate"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Current time for the current block."] - pub async fn now( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 148u8, 53u8, 50u8, 54u8, 13u8, 161u8, 57u8, 150u8, 16u8, 83u8, 144u8, - 221u8, 59u8, 75u8, 158u8, 130u8, 39u8, 123u8, 106u8, 134u8, 202u8, - 185u8, 83u8, 85u8, 60u8, 41u8, 120u8, 96u8, 210u8, 34u8, 2u8, 250u8, - ] - { - let entry = Now; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Did the timestamp get updated in this block?"] - pub async fn did_update( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 70u8, 13u8, 92u8, 186u8, 80u8, 151u8, 167u8, 90u8, 158u8, 232u8, 175u8, - 13u8, 103u8, 135u8, 2u8, 78u8, 16u8, 6u8, 39u8, 158u8, 167u8, 85u8, - 27u8, 47u8, 122u8, 73u8, 127u8, 26u8, 35u8, 168u8, 72u8, 204u8, - ] - { - let entry = DidUpdate; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The minimum period between blocks. Beware that this is different to the *expected*"] - #[doc = " period that the block production apparatus provides. Your chosen consensus system will"] - #[doc = " generally work with this to determine a sensible block time. e.g. For Aura, it will be"] - #[doc = " double this period on default settings."] - pub fn minimum_period( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Timestamp", "MinimumPeriod")? - == [ - 141u8, 242u8, 40u8, 24u8, 83u8, 43u8, 33u8, 194u8, 156u8, 149u8, 219u8, - 61u8, 10u8, 123u8, 120u8, 247u8, 228u8, 22u8, 25u8, 24u8, 214u8, 188u8, - 54u8, 135u8, 240u8, 162u8, 41u8, 216u8, 3u8, 58u8, 238u8, 39u8, - ] - { - let pallet = locked_metadata.pallet("Timestamp")?; - let constant = pallet.constant("MinimumPeriod")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod indices { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct Claim { - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Claim { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "claim"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Transfer { - pub new: ::subxt::sp_core::crypto::AccountId32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "transfer"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct Free { - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Free { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "free"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceTransfer { - pub new: ::subxt::sp_core::crypto::AccountId32, - pub index: ::core::primitive::u32, - pub freeze: ::core::primitive::bool, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct Freeze { - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "freeze"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Assign an previously unassigned index."] - #[doc = ""] - #[doc = "Payment: `Deposit` is reserved from the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be claimed. This must not be in use."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - pub fn claim( - &self, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Claim, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 27u8, 4u8, 108u8, 55u8, 23u8, 109u8, 175u8, 25u8, 201u8, 230u8, 228u8, - 51u8, 164u8, 15u8, 79u8, 10u8, 219u8, 182u8, 242u8, 102u8, 164u8, - 148u8, 39u8, 91u8, 106u8, 197u8, 29u8, 190u8, 178u8, 221u8, 16u8, 87u8, - ] - { - let call = Claim { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] - #[doc = "is effectively transferred to the new account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One transfer operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (recipient)"] - #[doc = " - Writes: Indices Accounts, System Account (recipient)"] - #[doc = "# "] - pub fn transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Transfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 124u8, 83u8, 33u8, 230u8, 23u8, 70u8, 83u8, 59u8, 76u8, 100u8, 219u8, - 100u8, 165u8, 163u8, 102u8, 193u8, 11u8, 22u8, 30u8, 125u8, 114u8, - 28u8, 61u8, 156u8, 38u8, 170u8, 129u8, 74u8, 187u8, 28u8, 33u8, 65u8, - ] - { - let call = Transfer { new, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Free up an index owned by the sender."] - #[doc = ""] - #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] - #[doc = ""] - #[doc = "- `index`: the index to be freed. This must be owned by the sender."] - #[doc = ""] - #[doc = "Emits `IndexFreed` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - pub fn free( - &self, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Free, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 143u8, 162u8, 33u8, 229u8, 3u8, 159u8, 153u8, 111u8, 100u8, - 160u8, 250u8, 227u8, 24u8, 157u8, 226u8, 173u8, 39u8, 25u8, 200u8, - 137u8, 147u8, 232u8, 213u8, 182u8, 49u8, 142u8, 250u8, 139u8, 155u8, - 84u8, 214u8, - ] - { - let call = Free { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] - #[doc = "held, then any deposit is reimbursed to its current owner."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `index`: the index to be (re-)assigned."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (original owner)"] - #[doc = " - Writes: Indices Accounts, System Account (original owner)"] - #[doc = "# "] - pub fn force_transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - freeze: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 181u8, 143u8, 90u8, 135u8, 132u8, 11u8, 145u8, 85u8, 4u8, 211u8, 56u8, - 110u8, 213u8, 153u8, 224u8, 106u8, 198u8, 250u8, 130u8, 253u8, 72u8, - 58u8, 133u8, 150u8, 102u8, 119u8, 177u8, 175u8, 77u8, 106u8, 253u8, - 99u8, - ] - { - let call = ForceTransfer { new, index, freeze }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] - #[doc = "deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "- `index`: the index to be frozen in place."] - #[doc = ""] - #[doc = "Emits `IndexFrozen` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one slash operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - pub fn freeze( - &self, - index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Freeze, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 204u8, 127u8, 214u8, 137u8, 138u8, 28u8, 171u8, 169u8, 184u8, 164u8, - 235u8, 114u8, 132u8, 176u8, 14u8, 207u8, 72u8, 39u8, 179u8, 231u8, - 137u8, 243u8, 242u8, 57u8, 89u8, 57u8, 213u8, 210u8, 87u8, 12u8, 253u8, - 159u8, - ] - { - let call = Freeze { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_indices::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A account index was assigned."] - pub struct IndexAssigned { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for IndexAssigned { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexAssigned"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - #[doc = "A account index has been freed up (unassigned)."] - pub struct IndexFreed { - pub index: ::core::primitive::u32, - } - impl ::subxt::Event for IndexFreed { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexFreed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A account index has been frozen to its current account ID."] - pub struct IndexFrozen { - pub index: ::core::primitive::u32, - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for IndexFrozen { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexFrozen"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Accounts<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Accounts<'_> { - const PALLET: &'static str = "Indices"; - const STORAGE: &'static str = "Accounts"; - type Value = ( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The lookup from index to account."] - pub async fn accounts( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 105u8, 208u8, 81u8, 30u8, 157u8, 108u8, 22u8, 122u8, 152u8, 220u8, - 40u8, 97u8, 255u8, 166u8, 222u8, 11u8, 81u8, 245u8, 143u8, 79u8, 57u8, - 19u8, 174u8, 164u8, 220u8, 59u8, 77u8, 117u8, 39u8, 72u8, 251u8, 234u8, - ] - { - let entry = Accounts(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The lookup from index to account."] - pub async fn accounts_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Accounts<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 105u8, 208u8, 81u8, 30u8, 157u8, 108u8, 22u8, 122u8, 152u8, 220u8, - 40u8, 97u8, 255u8, 166u8, 222u8, 11u8, 81u8, 245u8, 143u8, 79u8, 57u8, - 19u8, 174u8, 164u8, 220u8, 59u8, 77u8, 117u8, 39u8, 72u8, 251u8, 234u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The deposit needed for reserving an index."] - pub fn deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Indices", "Deposit")? - == [ - 217u8, 97u8, 70u8, 109u8, 180u8, 214u8, 183u8, 67u8, 253u8, 148u8, - 245u8, 108u8, 187u8, 95u8, 0u8, 15u8, 167u8, 149u8, 163u8, 194u8, - 206u8, 220u8, 164u8, 101u8, 1u8, 99u8, 206u8, 165u8, 63u8, 141u8, - 109u8, 1u8, - ] - { - let pallet = locked_metadata.pallet("Indices")?; - let constant = pallet.constant("Deposit")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod balances { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Transfer { - pub dest: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetBalance { - pub who: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - #[codec(compact)] - pub new_free: ::core::primitive::u128, - #[codec(compact)] - pub new_reserved: ::core::primitive::u128, - } - impl ::subxt::Call for SetBalance { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "set_balance"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceTransfer { - pub source: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - pub dest: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct TransferKeepAlive { - pub dest: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - #[codec(compact)] - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for TransferKeepAlive { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer_keep_alive"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct TransferAll { - pub dest: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - pub keep_alive: ::core::primitive::bool, - } - impl ::subxt::Call for TransferAll { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer_all"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceUnreserve { - pub who: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Call for ForceUnreserve { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_unreserve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] - #[doc = " types. See related functions below."] - #[doc = "- It contains a limited number of reads and writes internally and no complex"] - #[doc = " computation."] - #[doc = ""] - #[doc = "Related functions:"] - #[doc = ""] - #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] - #[doc = " - Transferring balances to accounts that did not exist before will cause"] - #[doc = " `T::OnNewAccount::on_new_account` to be called."] - #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] - #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] - #[doc = " that the transfer will not kill the origin account."] - #[doc = "---------------------------------"] - #[doc = "- Origin account is already in memory, so no DB operations for them."] - #[doc = "# "] - pub fn transfer( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Transfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 250u8, 8u8, 164u8, 186u8, 80u8, 220u8, 134u8, 247u8, 142u8, 121u8, - 34u8, 22u8, 169u8, 39u8, 6u8, 93u8, 72u8, 47u8, 44u8, 107u8, 9u8, 98u8, - 203u8, 190u8, 136u8, 55u8, 251u8, 78u8, 216u8, 150u8, 98u8, 118u8, - ] - { - let call = Transfer { dest, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the balances of a given account."] - #[doc = ""] - #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] - #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] - #[doc = "If the new free or reserved balance is below the existential deposit,"] - #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - pub fn set_balance( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - new_free: ::core::primitive::u128, - new_reserved: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetBalance, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 232u8, 6u8, 27u8, 131u8, 163u8, 72u8, 148u8, 197u8, 14u8, 239u8, 94u8, - 1u8, 32u8, 94u8, 17u8, 14u8, 123u8, 82u8, 39u8, 233u8, 77u8, 20u8, - 40u8, 139u8, 222u8, 137u8, 103u8, 18u8, 126u8, 63u8, 200u8, 149u8, - ] - { - let call = SetBalance { - who, - new_free, - new_reserved, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] - #[doc = "specified."] - #[doc = "# "] - #[doc = "- Same as transfer, but additional read and write because the source account is not"] - #[doc = " assumed to be in the overlay."] - #[doc = "# "] - pub fn force_transfer( - &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceTransfer, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 120u8, 66u8, 111u8, 84u8, 176u8, 241u8, 214u8, 118u8, 219u8, 75u8, - 127u8, 222u8, 45u8, 33u8, 204u8, 147u8, 126u8, 214u8, 101u8, 190u8, - 37u8, 37u8, 159u8, 166u8, 61u8, 143u8, 22u8, 32u8, 15u8, 83u8, 221u8, - 230u8, - ] - { - let call = ForceTransfer { - source, - dest, - value, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] - #[doc = "origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer`] instead."] - #[doc = ""] - #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] - pub fn transfer_keep_alive( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - value: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TransferKeepAlive, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 111u8, 233u8, 125u8, 71u8, 223u8, 141u8, 112u8, 94u8, 157u8, 11u8, - 88u8, 7u8, 239u8, 145u8, 247u8, 183u8, 245u8, 87u8, 157u8, 35u8, 49u8, - 91u8, 54u8, 103u8, 101u8, 76u8, 110u8, 94u8, 81u8, 170u8, 153u8, 209u8, - ] - { - let call = TransferKeepAlive { dest, value }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true). # "] - #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] - #[doc = " #"] - pub fn transfer_all( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - keep_alive: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TransferAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 240u8, 165u8, 185u8, 144u8, 24u8, 149u8, 15u8, 46u8, 60u8, 147u8, 19u8, - 187u8, 96u8, 24u8, 150u8, 53u8, 151u8, 232u8, 200u8, 164u8, 176u8, - 167u8, 8u8, 23u8, 63u8, 135u8, 68u8, 110u8, 5u8, 21u8, 35u8, 78u8, - ] - { - let call = TransferAll { dest, keep_alive }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - pub fn force_unreserve( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - amount: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnreserve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 106u8, 42u8, 48u8, 136u8, 41u8, 155u8, 214u8, 112u8, 99u8, 122u8, - 202u8, 250u8, 95u8, 60u8, 182u8, 13u8, 25u8, 149u8, 212u8, 212u8, - 247u8, 191u8, 130u8, 95u8, 84u8, 252u8, 252u8, 197u8, 244u8, 149u8, - 103u8, 67u8, - ] - { - let call = ForceUnreserve { who, amount }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_balances::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An account was created with some free balance."] - pub struct Endowed { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub free_balance: ::core::primitive::u128, - } - impl ::subxt::Event for Endowed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Endowed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] - #[doc = "resulting in an outright loss."] - pub struct DustLost { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for DustLost { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "DustLost"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Transfer succeeded."] - pub struct Transfer { - pub from: ::subxt::sp_core::crypto::AccountId32, - pub to: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Transfer { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Transfer"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A balance was set by root."] - pub struct BalanceSet { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub free: ::core::primitive::u128, - pub reserved: ::core::primitive::u128, - } - impl ::subxt::Event for BalanceSet { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "BalanceSet"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some balance was reserved (moved from free to reserved)."] - pub struct Reserved { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Reserved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some balance was unreserved (moved from reserved to free)."] - pub struct Unreserved { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Unreserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Unreserved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some balance was moved from the reserve of the first account to the second account."] - #[doc = "Final argument indicates the destination balance type."] - pub struct ReserveRepatriated { - pub from: ::subxt::sp_core::crypto::AccountId32, - pub to: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - pub destination_status: - runtime_types::frame_support::traits::tokens::misc::BalanceStatus, - } - impl ::subxt::Event for ReserveRepatriated { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "ReserveRepatriated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some amount was deposited (e.g. for transaction fees)."] - pub struct Deposit { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Deposit"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] - pub struct Withdraw { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Withdraw { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Withdraw"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] - pub struct Slashed { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - } - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Slashed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct TotalIssuance; - impl ::subxt::StorageEntry for TotalIssuance { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "TotalIssuance"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Account<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Account<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Account"; - type Value = runtime_types::pallet_balances::AccountData<::core::primitive::u128>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Locks<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Locks<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Locks"; - type Value = - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_balances::BalanceLock<::core::primitive::u128>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Reserves<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Reserves<'_> { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "Reserves"; - type Value = runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_balances::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The total units issued in the system."] - pub async fn total_issuance( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 1u8, 206u8, 252u8, 237u8, 6u8, 30u8, 20u8, 232u8, 164u8, 115u8, 51u8, - 156u8, 156u8, 206u8, 241u8, 187u8, 44u8, 84u8, 25u8, 164u8, 235u8, - 20u8, 86u8, 242u8, 124u8, 23u8, 28u8, 140u8, 26u8, 73u8, 231u8, 51u8, - ] - { - let entry = TotalIssuance; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn account( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 129u8, 169u8, 171u8, 206u8, 229u8, 178u8, 69u8, 118u8, 199u8, 64u8, - 254u8, 67u8, 16u8, 154u8, 160u8, 197u8, 177u8, 161u8, 148u8, 199u8, - 78u8, 219u8, 187u8, 83u8, 99u8, 110u8, 207u8, 252u8, 243u8, 39u8, 46u8, - 106u8, - ] - { - let entry = Account(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn account_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Account<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 129u8, 169u8, 171u8, 206u8, 229u8, 178u8, 69u8, 118u8, 199u8, 64u8, - 254u8, 67u8, 16u8, 154u8, 160u8, 197u8, 177u8, 161u8, 148u8, 199u8, - 78u8, 219u8, 187u8, 83u8, 99u8, 110u8, 207u8, 252u8, 243u8, 39u8, 46u8, - 106u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] - pub async fn locks( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_balances::BalanceLock<::core::primitive::u128>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 31u8, 76u8, 213u8, 60u8, 86u8, 11u8, 155u8, 151u8, 33u8, 212u8, 74u8, - 89u8, 174u8, 74u8, 195u8, 107u8, 29u8, 163u8, 178u8, 34u8, 209u8, 8u8, - 201u8, 237u8, 77u8, 99u8, 205u8, 212u8, 236u8, 132u8, 2u8, 252u8, - ] - { - let entry = Locks(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Any liquidity locks on some account balances."] - #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] - pub async fn locks_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 31u8, 76u8, 213u8, 60u8, 86u8, 11u8, 155u8, 151u8, 33u8, 212u8, 74u8, - 89u8, 174u8, 74u8, 195u8, 107u8, 29u8, 163u8, 178u8, 34u8, 209u8, 8u8, - 201u8, 237u8, 77u8, 99u8, 205u8, 212u8, 236u8, 132u8, 2u8, 252u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Named reserves on some account balances."] - pub async fn reserves( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData< - [::core::primitive::u8; 8usize], - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 103u8, 6u8, 69u8, 151u8, 81u8, 40u8, 146u8, 113u8, 56u8, 239u8, 104u8, - 31u8, 168u8, 242u8, 141u8, 121u8, 213u8, 213u8, 114u8, 63u8, 62u8, - 47u8, 91u8, 119u8, 57u8, 91u8, 95u8, 81u8, 19u8, 208u8, 59u8, 146u8, - ] - { - let entry = Reserves(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Named reserves on some account balances."] - pub async fn reserves_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reserves<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 103u8, 6u8, 69u8, 151u8, 81u8, 40u8, 146u8, 113u8, 56u8, 239u8, 104u8, - 31u8, 168u8, 242u8, 141u8, 121u8, 213u8, 213u8, 114u8, 63u8, 62u8, - 47u8, 91u8, 119u8, 57u8, 91u8, 95u8, 81u8, 19u8, 208u8, 59u8, 146u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Storage version of the pallet."] - #[doc = ""] - #[doc = " This is set to v2.0.0 for new networks."] - pub async fn storage_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::Releases, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 135u8, 96u8, 28u8, 234u8, 124u8, 212u8, 56u8, 140u8, 40u8, 101u8, - 235u8, 128u8, 136u8, 221u8, 182u8, 81u8, 17u8, 9u8, 184u8, 228u8, - 174u8, 165u8, 200u8, 162u8, 214u8, 178u8, 227u8, 72u8, 34u8, 5u8, - 173u8, 96u8, - ] - { - let entry = StorageVersion; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The minimum amount required to keep an account open."] - pub fn existential_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Balances", "ExistentialDeposit")? - == [ - 100u8, 197u8, 144u8, 241u8, 166u8, 142u8, 204u8, 246u8, 114u8, 229u8, - 145u8, 5u8, 133u8, 180u8, 23u8, 117u8, 117u8, 204u8, 228u8, 32u8, 70u8, - 243u8, 110u8, 36u8, 218u8, 106u8, 47u8, 136u8, 193u8, 46u8, 121u8, - 242u8, - ] - { - let pallet = locked_metadata.pallet("Balances")?; - let constant = pallet.constant("ExistentialDeposit")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of locks that should exist on an account."] - #[doc = " Not strictly enforced, but used for weight estimation."] - pub fn max_locks( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Balances", "MaxLocks")? - == [ - 250u8, 58u8, 19u8, 15u8, 35u8, 113u8, 227u8, 89u8, 39u8, 75u8, 21u8, - 108u8, 202u8, 32u8, 163u8, 167u8, 207u8, 233u8, 69u8, 151u8, 53u8, - 164u8, 230u8, 16u8, 14u8, 22u8, 172u8, 46u8, 36u8, 216u8, 29u8, 1u8, - ] - { - let pallet = locked_metadata.pallet("Balances")?; - let constant = pallet.constant("MaxLocks")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum number of named reserves that can exist on an account."] - pub fn max_reserves( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Balances", "MaxReserves")? - == [ - 24u8, 30u8, 77u8, 89u8, 216u8, 114u8, 140u8, 11u8, 127u8, 252u8, 130u8, - 203u8, 4u8, 55u8, 62u8, 240u8, 65u8, 182u8, 187u8, 189u8, 140u8, 6u8, - 177u8, 216u8, 159u8, 108u8, 18u8, 73u8, 95u8, 67u8, 62u8, 50u8, - ] - { - let pallet = locked_metadata.pallet("Balances")?; - let constant = pallet.constant("MaxReserves")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod transaction_payment { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct NextFeeMultiplier; - impl ::subxt::StorageEntry for NextFeeMultiplier { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "NextFeeMultiplier"; - type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_transaction_payment::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn next_fee_multiplier( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::fixed_point::FixedU128, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 232u8, 48u8, 68u8, 202u8, 209u8, 29u8, 249u8, 71u8, 0u8, 84u8, 229u8, - 250u8, 176u8, 203u8, 27u8, 26u8, 34u8, 55u8, 83u8, 183u8, 224u8, 40u8, - 62u8, 127u8, 131u8, 88u8, 128u8, 9u8, 56u8, 178u8, 31u8, 183u8, - ] - { - let entry = NextFeeMultiplier; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn storage_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_transaction_payment::Releases, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 219u8, 243u8, 82u8, 176u8, 65u8, 5u8, 132u8, 114u8, 8u8, 82u8, 176u8, - 200u8, 97u8, 150u8, 177u8, 164u8, 166u8, 11u8, 34u8, 12u8, 12u8, 198u8, - 58u8, 191u8, 186u8, 221u8, 221u8, 119u8, 181u8, 253u8, 154u8, 228u8, - ] - { - let entry = StorageVersion; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " A fee mulitplier for `Operational` extrinsics to compute \"virtual tip\" to boost their"] - #[doc = " `priority`"] - #[doc = ""] - #[doc = " This value is multipled by the `final_fee` to obtain a \"virtual tip\" that is later"] - #[doc = " added to a tip component in regular `priority` calculations."] - #[doc = " It means that a `Normal` transaction can front-run a similarly-sized `Operational`"] - #[doc = " extrinsic (with no tip), by including a tip value greater than the virtual tip."] - #[doc = ""] - #[doc = " ```rust,ignore"] - #[doc = " // For `Normal`"] - #[doc = " let priority = priority_calc(tip);"] - #[doc = ""] - #[doc = " // For `Operational`"] - #[doc = " let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;"] - #[doc = " let priority = priority_calc(tip + virtual_tip);"] - #[doc = " ```"] - #[doc = ""] - #[doc = " Note that since we use `final_fee` the multiplier applies also to the regular `tip`"] - #[doc = " sent with the transaction. So, not only does the transaction get a priority bump based"] - #[doc = " on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`"] - #[doc = " transactions."] - pub fn operational_fee_multiplier( - &self, - ) -> ::core::result::Result<::core::primitive::u8, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata - .constant_hash("TransactionPayment", "OperationalFeeMultiplier")? - == [ - 161u8, 232u8, 150u8, 43u8, 106u8, 83u8, 56u8, 248u8, 54u8, 123u8, - 244u8, 73u8, 5u8, 49u8, 245u8, 150u8, 70u8, 92u8, 158u8, 207u8, 127u8, - 115u8, 211u8, 21u8, 24u8, 136u8, 89u8, 44u8, 151u8, 211u8, 235u8, - 196u8, - ] - { - let pallet = locked_metadata.pallet("TransactionPayment")?; - let constant = pallet.constant("OperationalFeeMultiplier")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The polynomial that is applied in order to derive fee from weight."] - pub fn weight_to_fee( - &self, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::frame_support::weights::WeightToFeeCoefficient< - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("TransactionPayment", "WeightToFee")? - == [ - 44u8, 92u8, 141u8, 157u8, 190u8, 186u8, 18u8, 118u8, 159u8, 148u8, - 39u8, 199u8, 183u8, 135u8, 82u8, 229u8, 224u8, 178u8, 162u8, 242u8, - 91u8, 15u8, 6u8, 164u8, 166u8, 152u8, 105u8, 87u8, 195u8, 103u8, 250u8, - 97u8, - ] - { - let pallet = locked_metadata.pallet("TransactionPayment")?; - let constant = pallet.constant("WeightToFee")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The polynomial that is applied in order to derive fee from length."] - pub fn length_to_fee( - &self, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::frame_support::weights::WeightToFeeCoefficient< - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("TransactionPayment", "LengthToFee")? - == [ - 246u8, 248u8, 52u8, 88u8, 59u8, 206u8, 226u8, 212u8, 183u8, 37u8, - 151u8, 169u8, 36u8, 254u8, 225u8, 237u8, 99u8, 254u8, 150u8, 59u8, - 102u8, 252u8, 73u8, 209u8, 33u8, 33u8, 22u8, 175u8, 24u8, 190u8, 232u8, - 180u8, - ] - { - let pallet = locked_metadata.pallet("TransactionPayment")?; - let constant = pallet.constant("LengthToFee")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod authorship { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetUncles { - pub new_uncles: ::std::vec::Vec< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for SetUncles { - const PALLET: &'static str = "Authorship"; - const FUNCTION: &'static str = "set_uncles"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Provide a set of uncles."] - pub fn set_uncles( - &self, - new_uncles: ::std::vec::Vec< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUncles, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 5u8, 56u8, 71u8, 152u8, 103u8, 232u8, 101u8, 171u8, 200u8, 2u8, 177u8, - 102u8, 0u8, 93u8, 210u8, 90u8, 56u8, 151u8, 5u8, 235u8, 227u8, 197u8, - 189u8, 248u8, 2u8, 71u8, 49u8, 220u8, 212u8, 253u8, 235u8, 67u8, - ] - { - let call = SetUncles { new_uncles }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Uncles; - impl ::subxt::StorageEntry for Uncles { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "Uncles"; - type Value = ::std::vec::Vec< - runtime_types::pallet_authorship::UncleEntryItem< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Author; - impl ::subxt::StorageEntry for Author { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "Author"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DidSetUncles; - impl ::subxt::StorageEntry for DidSetUncles { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "DidSetUncles"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Uncles"] - pub async fn uncles( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_authorship::UncleEntryItem< - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 71u8, 135u8, 85u8, 172u8, 221u8, 165u8, 212u8, 2u8, 208u8, 50u8, 9u8, - 92u8, 251u8, 25u8, 194u8, 123u8, 210u8, 4u8, 148u8, 30u8, 20u8, 146u8, - 21u8, 210u8, 138u8, 128u8, 144u8, 152u8, 97u8, 57u8, 205u8, 231u8, - ] - { - let entry = Uncles; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Author of current block."] - pub async fn author( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 191u8, 57u8, 3u8, 242u8, 220u8, 123u8, 103u8, 215u8, 149u8, 120u8, - 20u8, 139u8, 146u8, 234u8, 180u8, 105u8, 129u8, 128u8, 114u8, 147u8, - 114u8, 236u8, 23u8, 21u8, 15u8, 250u8, 180u8, 19u8, 177u8, 145u8, 77u8, - 228u8, - ] - { - let entry = Author; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Whether uncles were already set in this block."] - pub async fn did_set_uncles( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 64u8, 3u8, 208u8, 187u8, 50u8, 45u8, 37u8, 88u8, 163u8, 226u8, 37u8, - 126u8, 232u8, 107u8, 156u8, 187u8, 29u8, 15u8, 53u8, 46u8, 28u8, 73u8, - 83u8, 123u8, 14u8, 244u8, 243u8, 43u8, 245u8, 143u8, 15u8, 115u8, - ] - { - let entry = DidSetUncles; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of blocks back we should accept uncles."] - #[doc = " This means that we will deal with uncle-parents that are"] - #[doc = " `UncleGenerations + 1` before `now`."] - pub fn uncle_generations( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Authorship", "UncleGenerations")? - == [ - 0u8, 72u8, 57u8, 175u8, 222u8, 143u8, 191u8, 33u8, 163u8, 157u8, 202u8, - 83u8, 186u8, 103u8, 162u8, 103u8, 227u8, 158u8, 239u8, 212u8, 205u8, - 193u8, 226u8, 138u8, 5u8, 220u8, 221u8, 42u8, 7u8, 146u8, 173u8, 205u8, - ] - { - let pallet = locked_metadata.pallet("Authorship")?; - let constant = pallet.constant("UncleGenerations")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod offences { - use super::root_mod; - use super::runtime_types; - pub type Event = runtime_types::pallet_offences::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] - #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] - #[doc = "\\[kind, timeslot\\]."] - pub struct Offence { - pub kind: [::core::primitive::u8; 16usize], - pub timeslot: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Event for Offence { - const PALLET: &'static str = "Offences"; - const EVENT: &'static str = "Offence"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Reports<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reports<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "Reports"; - type Value = runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::sp_core::crypto::AccountId32, - (::subxt::sp_core::crypto::AccountId32, ()), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ConcurrentReportsIndex<'a>( - pub &'a [::core::primitive::u8; 16usize], - pub &'a [::core::primitive::u8], - ); - impl ::subxt::StorageEntry for ConcurrentReportsIndex<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ConcurrentReportsIndex"; - type Value = ::std::vec::Vec<::subxt::sp_core::H256>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new(&self.1, ::subxt::StorageHasher::Twox64Concat), - ]) - } - } - pub struct ReportsByKindIndex<'a>(pub &'a [::core::primitive::u8; 16usize]); - impl ::subxt::StorageEntry for ReportsByKindIndex<'_> { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ReportsByKindIndex"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The primary structure that holds all offence records keyed by report identifiers."] - pub async fn reports( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_staking::offence::OffenceDetails< - ::subxt::sp_core::crypto::AccountId32, - (::subxt::sp_core::crypto::AccountId32, ()), - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 159u8, 183u8, 120u8, 137u8, 114u8, 85u8, 18u8, 113u8, 131u8, 156u8, - 32u8, 32u8, 26u8, 47u8, 28u8, 116u8, 237u8, 136u8, 51u8, 176u8, 94u8, - 48u8, 112u8, 87u8, 162u8, 90u8, 25u8, 168u8, 182u8, 198u8, 79u8, 33u8, - ] - { - let entry = Reports(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The primary structure that holds all offence records keyed by report identifiers."] - pub async fn reports_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Reports<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 159u8, 183u8, 120u8, 137u8, 114u8, 85u8, 18u8, 113u8, 131u8, 156u8, - 32u8, 32u8, 26u8, 47u8, 28u8, 116u8, 237u8, 136u8, 51u8, 176u8, 94u8, - 48u8, 112u8, 87u8, 162u8, 90u8, 25u8, 168u8, 182u8, 198u8, 79u8, 33u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A vector of reports of the same kind that happened at the same time slot."] - pub async fn concurrent_reports_index( - &self, - _0: &[::core::primitive::u8; 16usize], - _1: &[::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::H256>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 110u8, 42u8, 178u8, 19u8, 180u8, 109u8, 26u8, 134u8, 74u8, 223u8, 19u8, - 172u8, 149u8, 194u8, 228u8, 11u8, 205u8, 189u8, 157u8, 52u8, 179u8, - 177u8, 19u8, 65u8, 35u8, 176u8, 62u8, 98u8, 108u8, 236u8, 242u8, 240u8, - ] - { - let entry = ConcurrentReportsIndex(_0, _1); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A vector of reports of the same kind that happened at the same time slot."] - pub async fn concurrent_reports_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ConcurrentReportsIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 110u8, 42u8, 178u8, 19u8, 180u8, 109u8, 26u8, 134u8, 74u8, 223u8, 19u8, - 172u8, 149u8, 194u8, 228u8, 11u8, 205u8, 189u8, 157u8, 52u8, 179u8, - 177u8, 19u8, 65u8, 35u8, 176u8, 62u8, 98u8, 108u8, 236u8, 242u8, 240u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Enumerates all reports of a kind along with the time they happened."] - #[doc = ""] - #[doc = " All reports are sorted by the time of offence."] - #[doc = ""] - #[doc = " Note that the actual type of this mapping is `Vec`, this is because values of"] - #[doc = " different types are not supported at the moment so we are doing the manual serialization."] - pub async fn reports_by_kind_index( - &self, - _0: &[::core::primitive::u8; 16usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, 137u8, - 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, 91u8, 164u8, 20u8, - 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, - 145u8, - ] - { - let entry = ReportsByKindIndex(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Enumerates all reports of a kind along with the time they happened."] - #[doc = ""] - #[doc = " All reports are sorted by the time of offence."] - #[doc = ""] - #[doc = " Note that the actual type of this mapping is `Vec`, this is because values of"] - #[doc = " different types are not supported at the moment so we are doing the manual serialization."] - pub async fn reports_by_kind_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReportsByKindIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, 137u8, - 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, 91u8, 164u8, 20u8, - 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, - 145u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod historical { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct HistoricalSessions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for HistoricalSessions<'_> { - const PALLET: &'static str = "Historical"; - const STORAGE: &'static str = "HistoricalSessions"; - type Value = (::subxt::sp_core::H256, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StoredRange; - impl ::subxt::StorageEntry for StoredRange { - const PALLET: &'static str = "Historical"; - const STORAGE: &'static str = "StoredRange"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Mapping from historical session indices to session-data root hash and validator count."] - pub async fn historical_sessions( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(::subxt::sp_core::H256, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 92u8, 215u8, 143u8, 120u8, 255u8, 80u8, 7u8, 111u8, 104u8, 47u8, 157u8, - 42u8, 5u8, 82u8, 106u8, 157u8, 63u8, 23u8, 166u8, 241u8, 1u8, 170u8, - 112u8, 240u8, 7u8, 118u8, 13u8, 17u8, 24u8, 13u8, 148u8, 18u8, - ] - { - let entry = HistoricalSessions(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Mapping from historical session indices to session-data root hash and validator count."] - pub async fn historical_sessions_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HistoricalSessions<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 92u8, 215u8, 143u8, 120u8, 255u8, 80u8, 7u8, 111u8, 104u8, 47u8, 157u8, - 42u8, 5u8, 82u8, 106u8, 157u8, 63u8, 23u8, 166u8, 241u8, 1u8, 170u8, - 112u8, 240u8, 7u8, 118u8, 13u8, 17u8, 24u8, 13u8, 148u8, 18u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The range of historical sessions we store. [first, last)"] - pub async fn stored_range( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 89u8, 239u8, 197u8, 93u8, 135u8, 62u8, 142u8, 237u8, 64u8, 200u8, - 164u8, 4u8, 130u8, 233u8, 16u8, 238u8, 166u8, 206u8, 71u8, 42u8, 171u8, - 84u8, 8u8, 245u8, 183u8, 216u8, 212u8, 16u8, 190u8, 3u8, 167u8, 189u8, - ] - { - let entry = StoredRange; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod session { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetKeys { - pub keys: runtime_types::rococo_runtime::SessionKeys, - pub proof: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for SetKeys { - const PALLET: &'static str = "Session"; - const FUNCTION: &'static str = "set_keys"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PurgeKeys; - impl ::subxt::Call for PurgeKeys { - const PALLET: &'static str = "Session"; - const FUNCTION: &'static str = "purge_keys"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Sets the session key(s) of the function caller to `keys`."] - #[doc = "Allows an account to set its session key prior to becoming a validator."] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be signed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] - #[doc = " `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] - #[doc = "- DbWrites: `origin account`, `NextKeys`"] - #[doc = "- DbReads per key id: `KeyOwner`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - pub fn set_keys( - &self, - keys: runtime_types::rococo_runtime::SessionKeys, - proof: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetKeys, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 40u8, 220u8, 95u8, 79u8, 180u8, 125u8, 190u8, 230u8, 35u8, 93u8, 108u8, - 88u8, 113u8, 139u8, 41u8, 15u8, 215u8, 70u8, 15u8, 127u8, 121u8, 200u8, - 139u8, 107u8, 122u8, 84u8, 154u8, 133u8, 44u8, 222u8, 11u8, 142u8, - ] - { - let call = SetKeys { keys, proof }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Removes any session key(s) of the function caller."] - #[doc = ""] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] - #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] - #[doc = "means being a controller account) or directly convertible into a validator ID (which"] - #[doc = "usually means being a stash account)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] - #[doc = " of `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] - #[doc = "- DbWrites: `NextKeys`, `origin account`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - pub fn purge_keys( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PurgeKeys, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 200u8, 255u8, 4u8, 213u8, 188u8, 92u8, 99u8, 116u8, 163u8, 152u8, 29u8, - 35u8, 133u8, 119u8, 246u8, 44u8, 91u8, 31u8, 145u8, 23u8, 213u8, 64u8, - 71u8, 242u8, 207u8, 239u8, 231u8, 37u8, 61u8, 63u8, 190u8, 35u8, - ] - { - let call = PurgeKeys {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_session::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - #[doc = "New session has happened. Note that the argument is the session index, not the"] - #[doc = "block number as the type might suggest."] - pub struct NewSession { - pub session_index: ::core::primitive::u32, - } - impl ::subxt::Event for NewSession { - const PALLET: &'static str = "Session"; - const EVENT: &'static str = "NewSession"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Validators; - impl ::subxt::StorageEntry for Validators { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "Validators"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentIndex; - impl ::subxt::StorageEntry for CurrentIndex { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "CurrentIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedChanged; - impl ::subxt::StorageEntry for QueuedChanged { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "QueuedChanged"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct QueuedKeys; - impl ::subxt::StorageEntry for QueuedKeys { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "QueuedKeys"; - type Value = ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::SessionKeys, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DisabledValidators; - impl ::subxt::StorageEntry for DisabledValidators { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "DisabledValidators"; - type Value = ::std::vec::Vec<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextKeys<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for NextKeys<'_> { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "NextKeys"; - type Value = runtime_types::rococo_runtime::SessionKeys; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct KeyOwner<'a>( - pub &'a runtime_types::sp_core::crypto::KeyTypeId, - pub &'a [::core::primitive::u8], - ); - impl ::subxt::StorageEntry for KeyOwner<'_> { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "KeyOwner"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current set of validators."] - pub async fn validators( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 186u8, 248u8, 234u8, 74u8, 245u8, 141u8, 90u8, 152u8, 226u8, 220u8, - 255u8, 104u8, 174u8, 1u8, 37u8, 152u8, 23u8, 208u8, 25u8, 49u8, 33u8, - 253u8, 254u8, 251u8, 141u8, 16u8, 18u8, 175u8, 196u8, 188u8, 163u8, - 209u8, - ] - { - let entry = Validators; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Current index of the session."] - pub async fn current_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 148u8, 179u8, 159u8, 15u8, 197u8, 95u8, 214u8, 30u8, 209u8, 251u8, - 183u8, 231u8, 91u8, 25u8, 181u8, 191u8, 143u8, 252u8, 227u8, 80u8, - 159u8, 66u8, 194u8, 67u8, 113u8, 74u8, 111u8, 91u8, 218u8, 187u8, - 130u8, 40u8, - ] - { - let entry = CurrentIndex; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " True if the underlying economic identities or weighting behind the validators"] - #[doc = " has changed in the queued validator set."] - pub async fn queued_changed( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 105u8, 140u8, 235u8, 218u8, 96u8, 100u8, 252u8, 10u8, 58u8, 221u8, - 244u8, 251u8, 67u8, 91u8, 80u8, 202u8, 152u8, 42u8, 50u8, 113u8, 200u8, - 247u8, 59u8, 213u8, 77u8, 195u8, 1u8, 150u8, 220u8, 18u8, 245u8, 46u8, - ] - { - let entry = QueuedChanged; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The queued keys for the next session. When the next session begins, these keys"] - #[doc = " will be used to determine the validator's session keys."] - pub async fn queued_keys( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::SessionKeys, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 97u8, 113u8, 158u8, 57u8, 33u8, 45u8, 78u8, 218u8, 17u8, 183u8, 74u8, - 1u8, 18u8, 49u8, 129u8, 214u8, 4u8, 199u8, 7u8, 118u8, 62u8, 42u8, - 244u8, 42u8, 211u8, 233u8, 131u8, 208u8, 100u8, 53u8, 14u8, 88u8, - ] - { - let entry = QueuedKeys; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Indices of disabled validators."] - #[doc = ""] - #[doc = " The vec is always kept sorted so that we can find whether a given validator is"] - #[doc = " disabled using binary search. It gets cleared when `on_session_ending` returns"] - #[doc = " a new set of identities."] - pub async fn disabled_validators( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 135u8, 22u8, 22u8, 97u8, 82u8, 217u8, 144u8, 141u8, 121u8, 240u8, - 189u8, 16u8, 176u8, 88u8, 177u8, 31u8, 20u8, 242u8, 73u8, 104u8, 11u8, - 110u8, 214u8, 34u8, 52u8, 217u8, 106u8, 33u8, 174u8, 174u8, 198u8, - 84u8, - ] - { - let entry = DisabledValidators; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The next session keys for a validator."] - pub async fn next_keys( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 67u8, 147u8, 127u8, 129u8, 36u8, 48u8, 79u8, 194u8, 164u8, 59u8, 94u8, - 197u8, 236u8, 139u8, 67u8, 232u8, 69u8, 36u8, 86u8, 82u8, 167u8, 124u8, - 58u8, 171u8, 160u8, 111u8, 130u8, 28u8, 240u8, 53u8, 45u8, 147u8, - ] - { - let entry = NextKeys(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The next session keys for a validator."] - pub async fn next_keys_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, NextKeys<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 67u8, 147u8, 127u8, 129u8, 36u8, 48u8, 79u8, 194u8, 164u8, 59u8, 94u8, - 197u8, 236u8, 139u8, 67u8, 232u8, 69u8, 36u8, 86u8, 82u8, 167u8, 124u8, - 58u8, 171u8, 160u8, 111u8, 130u8, 28u8, 240u8, 53u8, 45u8, 147u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] - pub async fn key_owner( - &self, - _0: &runtime_types::sp_core::crypto::KeyTypeId, - _1: &[::core::primitive::u8], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 49u8, 245u8, 212u8, 141u8, 211u8, 208u8, 109u8, 102u8, 249u8, 161u8, - 41u8, 93u8, 220u8, 230u8, 14u8, 59u8, 251u8, 176u8, 33u8, 127u8, 93u8, - 149u8, 205u8, 229u8, 113u8, 129u8, 162u8, 177u8, 155u8, 216u8, 151u8, - 57u8, - ] - { - let entry = KeyOwner(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] - pub async fn key_owner_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, KeyOwner<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 49u8, 245u8, 212u8, 141u8, 211u8, 208u8, 109u8, 102u8, 249u8, 161u8, - 41u8, 93u8, 220u8, 230u8, 14u8, 59u8, 251u8, 176u8, 33u8, 127u8, 93u8, - 149u8, 205u8, 229u8, 113u8, 129u8, 162u8, 177u8, 155u8, 216u8, 151u8, - 57u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod grandpa { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReportEquivocation { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocation { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, - } - impl ::subxt::Call for ReportEquivocationUnsigned { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation_unsigned"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct NoteStalled { - pub delay: ::core::primitive::u32, - pub best_finalized_block_number: ::core::primitive::u32, - } - impl ::subxt::Call for NoteStalled { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "note_stalled"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - pub fn report_equivocation( - &self, - equivocation_proof: runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocation, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 230u8, 252u8, 24u8, 207u8, 164u8, 127u8, 177u8, 30u8, 113u8, 175u8, - 207u8, 252u8, 230u8, 225u8, 181u8, 190u8, 236u8, 110u8, 145u8, 168u8, - 200u8, 134u8, 88u8, 234u8, 231u8, 45u8, 149u8, 169u8, 155u8, 114u8, - 62u8, 65u8, - ] - { - let call = ReportEquivocation { - equivocation_proof: ::std::boxed::Box::new(equivocation_proof), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - pub fn report_equivocation_unsigned( - &self, - equivocation_proof: runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReportEquivocationUnsigned, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 141u8, 235u8, 27u8, 135u8, 124u8, 124u8, 234u8, 51u8, 100u8, 105u8, - 188u8, 248u8, 133u8, 10u8, 84u8, 14u8, 40u8, 235u8, 14u8, 107u8, 63u8, - 148u8, 107u8, 172u8, 136u8, 159u8, 86u8, 23u8, 145u8, 221u8, 93u8, - 206u8, - ] - { - let call = ReportEquivocationUnsigned { - equivocation_proof: ::std::boxed::Box::new(equivocation_proof), - key_owner_proof, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Note that the current authority set of the GRANDPA finality gadget has"] - #[doc = "stalled. This will trigger a forced authority set change at the beginning"] - #[doc = "of the next session, to be enacted `delay` blocks after that. The delay"] - #[doc = "should be high enough to safely assume that the block signalling the"] - #[doc = "forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters"] - #[doc = "will start the new authority set using the given finalized block as base."] - #[doc = "Only callable by root."] - pub fn note_stalled( - &self, - delay: ::core::primitive::u32, - best_finalized_block_number: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NoteStalled, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 227u8, 98u8, 249u8, 158u8, 96u8, 124u8, 72u8, 188u8, 27u8, 215u8, 73u8, - 62u8, 103u8, 79u8, 38u8, 48u8, 212u8, 88u8, 233u8, 187u8, 11u8, 95u8, - 39u8, 247u8, 55u8, 184u8, 228u8, 102u8, 13u8, 251u8, 52u8, 206u8, - ] - { - let call = NoteStalled { - delay, - best_finalized_block_number, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_grandpa::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "New authority set has been applied."] - pub struct NewAuthorities { - pub authority_set: ::std::vec::Vec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - } - impl ::subxt::Event for NewAuthorities { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "NewAuthorities"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Current authority set has been paused."] - pub struct Paused; - impl ::subxt::Event for Paused { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Paused"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Current authority set has been resumed."] - pub struct Resumed; - impl ::subxt::Event for Resumed { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Resumed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct State; - impl ::subxt::StorageEntry for State { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "State"; - type Value = runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingChange; - impl ::subxt::StorageEntry for PendingChange { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "PendingChange"; - type Value = - runtime_types::pallet_grandpa::StoredPendingChange<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextForced; - impl ::subxt::StorageEntry for NextForced { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "NextForced"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Stalled; - impl ::subxt::StorageEntry for Stalled { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "Stalled"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentSetId; - impl ::subxt::StorageEntry for CurrentSetId { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "CurrentSetId"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SetIdSession<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for SetIdSession<'_> { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "SetIdSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " State of the current authority set."] - pub async fn state( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 159u8, 75u8, 78u8, 23u8, 98u8, 89u8, 239u8, 230u8, 192u8, 67u8, 139u8, - 222u8, 151u8, 237u8, 216u8, 20u8, 235u8, 247u8, 180u8, 24u8, 64u8, - 160u8, 58u8, 15u8, 205u8, 191u8, 120u8, 68u8, 32u8, 5u8, 161u8, 106u8, - ] - { - let entry = State; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Pending change: (signaled at, scheduled change)."] - pub async fn pending_change( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_grandpa::StoredPendingChange<::core::primitive::u32>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 128u8, 176u8, 209u8, 41u8, 231u8, 111u8, 205u8, 198u8, 154u8, 44u8, - 228u8, 231u8, 44u8, 110u8, 74u8, 9u8, 31u8, 86u8, 128u8, 244u8, 112u8, - 21u8, 120u8, 176u8, 50u8, 213u8, 122u8, 46u8, 85u8, 255u8, 40u8, 173u8, - ] - { - let entry = PendingChange; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " next block number where we can force a change."] - pub async fn next_forced( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 99u8, 43u8, 245u8, 201u8, 60u8, 9u8, 122u8, 99u8, 188u8, 29u8, 67u8, - 6u8, 193u8, 133u8, 179u8, 67u8, 202u8, 208u8, 62u8, 179u8, 19u8, 169u8, - 196u8, 119u8, 107u8, 75u8, 100u8, 3u8, 121u8, 18u8, 80u8, 156u8, - ] - { - let entry = NextForced; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " `true` if we are currently stalled."] - pub async fn stalled( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 219u8, 8u8, 37u8, 78u8, 150u8, 55u8, 0u8, 57u8, 201u8, 170u8, 186u8, - 189u8, 56u8, 161u8, 44u8, 15u8, 53u8, 178u8, 224u8, 208u8, 231u8, - 109u8, 14u8, 209u8, 57u8, 205u8, 237u8, 153u8, 231u8, 156u8, 24u8, - 185u8, - ] - { - let entry = Stalled; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of changes (both in terms of keys and underlying economic responsibilities)"] - #[doc = " in the \"set\" of Grandpa validators from genesis."] - pub async fn current_set_id( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 129u8, 7u8, 62u8, 101u8, 199u8, 60u8, 56u8, 33u8, 54u8, 158u8, 20u8, - 178u8, 244u8, 145u8, 189u8, 197u8, 157u8, 163u8, 116u8, 36u8, 105u8, - 52u8, 149u8, 244u8, 108u8, 94u8, 109u8, 111u8, 244u8, 137u8, 7u8, - 108u8, - ] - { - let entry = CurrentSetId; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A mapping from grandpa set ID to the index of the *most recent* session for which its"] - #[doc = " members were responsible."] - #[doc = ""] - #[doc = " TWOX-NOTE: `SetId` is not under user control."] - pub async fn set_id_session( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, 110u8, 11u8, - 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, 157u8, 15u8, 33u8, 234u8, - 108u8, 13u8, 88u8, 115u8, 254u8, 9u8, 145u8, 199u8, 102u8, 47u8, 53u8, - 134u8, - ] - { - let entry = SetIdSession(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A mapping from grandpa set ID to the index of the *most recent* session for which its"] - #[doc = " members were responsible."] - #[doc = ""] - #[doc = " TWOX-NOTE: `SetId` is not under user control."] - pub async fn set_id_session_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SetIdSession<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, 110u8, 11u8, - 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, 157u8, 15u8, 33u8, 234u8, - 108u8, 13u8, 88u8, 115u8, 254u8, 9u8, 145u8, 199u8, 102u8, 47u8, 53u8, - 134u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Max Authorities in use"] - pub fn max_authorities( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Grandpa", "MaxAuthorities")? - == [ - 248u8, 195u8, 131u8, 166u8, 10u8, 50u8, 71u8, 223u8, 41u8, 49u8, 43u8, - 99u8, 251u8, 113u8, 75u8, 193u8, 159u8, 15u8, 77u8, 217u8, 147u8, - 205u8, 165u8, 50u8, 6u8, 166u8, 77u8, 189u8, 102u8, 22u8, 201u8, 19u8, - ] - { - let pallet = locked_metadata.pallet("Grandpa")?; - let constant = pallet.constant("MaxAuthorities")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod im_online { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Heartbeat { - pub heartbeat: runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, - pub signature: runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, - } - impl ::subxt::Call for Heartbeat { - const PALLET: &'static str = "ImOnline"; - const FUNCTION: &'static str = "heartbeat"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "# "] - #[doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] - #[doc = " length of `heartbeat.network_state.external_address`"] - #[doc = " - `O(K)`: decoding of length `K`"] - #[doc = " - `O(E)`: decoding/encoding of length `E`"] - #[doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] - #[doc = " `ReceivedHeartbeats`"] - #[doc = "- DbWrites: `ReceivedHeartbeats`"] - #[doc = "# "] - pub fn heartbeat( - &self, - heartbeat: runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, - signature: runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Heartbeat, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 246u8, 83u8, 28u8, 233u8, 69u8, 55u8, 28u8, 178u8, 82u8, 159u8, 56u8, - 241u8, 111u8, 78u8, 194u8, 15u8, 14u8, 250u8, 172u8, 148u8, 208u8, - 52u8, 33u8, 106u8, 159u8, 210u8, 196u8, 79u8, 138u8, 194u8, 150u8, - 201u8, - ] - { - let call = Heartbeat { - heartbeat, - signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_im_online::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A new heartbeat was received from `AuthorityId`."] - pub struct HeartbeatReceived { - pub authority_id: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - } - impl ::subxt::Event for HeartbeatReceived { - const PALLET: &'static str = "ImOnline"; - const EVENT: &'static str = "HeartbeatReceived"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "At the end of the session, no offence was committed."] - pub struct AllGood; - impl ::subxt::Event for AllGood { - const PALLET: &'static str = "ImOnline"; - const EVENT: &'static str = "AllGood"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "At the end of the session, at least one validator was found to be offline."] - pub struct SomeOffline { - pub offline: ::std::vec::Vec<(::subxt::sp_core::crypto::AccountId32, ())>, - } - impl ::subxt::Event for SomeOffline { - const PALLET: &'static str = "ImOnline"; - const EVENT: &'static str = "SomeOffline"; - } - } - pub mod storage { - use super::runtime_types; - pub struct HeartbeatAfter; - impl ::subxt::StorageEntry for HeartbeatAfter { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "HeartbeatAfter"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Keys; - impl ::subxt::StorageEntry for Keys { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "Keys"; - type Value = - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReceivedHeartbeats<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for ReceivedHeartbeats<'_> { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "ReceivedHeartbeats"; - type Value = runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new(&self.1, ::subxt::StorageHasher::Twox64Concat), - ]) - } - } - pub struct AuthoredBlocks<'a>( - pub &'a ::core::primitive::u32, - pub &'a ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for AuthoredBlocks<'_> { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "AuthoredBlocks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new(&self.1, ::subxt::StorageHasher::Twox64Concat), - ]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The block number after which it's ok to send heartbeats in the current"] - #[doc = " session."] - #[doc = ""] - #[doc = " At the beginning of each session we set this to a value that should fall"] - #[doc = " roughly in the middle of the session duration. The idea is to first wait for"] - #[doc = " the validators to produce a block in the current session, so that the"] - #[doc = " heartbeat later on will not be necessary."] - #[doc = ""] - #[doc = " This value will only be used as a fallback if we fail to get a proper session"] - #[doc = " progress estimate from `NextSessionRotation`, as those estimates should be"] - #[doc = " more accurate then the value we calculate for `HeartbeatAfter`."] - pub async fn heartbeat_after( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 108u8, 100u8, 85u8, 198u8, 226u8, 122u8, 94u8, 225u8, 97u8, 154u8, - 135u8, 95u8, 106u8, 28u8, 185u8, 78u8, 192u8, 196u8, 35u8, 191u8, 12u8, - 19u8, 163u8, 46u8, 232u8, 235u8, 193u8, 81u8, 126u8, 204u8, 25u8, - 228u8, - ] - { - let entry = HeartbeatAfter; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current set of keys that may issue a heartbeat."] - pub async fn keys( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 105u8, 250u8, 99u8, 106u8, 9u8, 29u8, 73u8, 176u8, 158u8, 247u8, 28u8, - 171u8, 95u8, 1u8, 109u8, 11u8, 231u8, 52u8, 54u8, 102u8, 142u8, 105u8, - 209u8, 31u8, 132u8, 60u8, 89u8, 181u8, 89u8, 193u8, 241u8, 130u8, - ] - { - let entry = Keys; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] - #[doc = " `WrapperOpaque`."] - pub async fn received_heartbeats( - &self, - _0: &::core::primitive::u32, - _1: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 29u8, 40u8, 67u8, 222u8, 59u8, 104u8, 24u8, 193u8, 249u8, 200u8, 152u8, - 225u8, 72u8, 243u8, 140u8, 114u8, 121u8, 216u8, 54u8, 145u8, 205u8, - 82u8, 133u8, 128u8, 109u8, 54u8, 153u8, 118u8, 66u8, 147u8, 251u8, - 148u8, - ] - { - let entry = ReceivedHeartbeats(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] - #[doc = " `WrapperOpaque`."] - pub async fn received_heartbeats_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReceivedHeartbeats<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 29u8, 40u8, 67u8, 222u8, 59u8, 104u8, 24u8, 193u8, 249u8, 200u8, 152u8, - 225u8, 72u8, 243u8, 140u8, 114u8, 121u8, 216u8, 54u8, 145u8, 205u8, - 82u8, 133u8, 128u8, 109u8, 54u8, 153u8, 118u8, 66u8, 147u8, 251u8, - 148u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] - #[doc = " number of blocks authored by the given authority."] - pub async fn authored_blocks( - &self, - _0: &::core::primitive::u32, - _1: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 94u8, 193u8, 107u8, 126u8, 3u8, 13u8, 28u8, 151u8, 197u8, 226u8, 224u8, - 48u8, 138u8, 113u8, 31u8, 57u8, 111u8, 184u8, 218u8, 215u8, 185u8, - 83u8, 209u8, 139u8, 114u8, 241u8, 68u8, 110u8, 157u8, 208u8, 16u8, - 22u8, - ] - { - let entry = AuthoredBlocks(_0, _1); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] - #[doc = " number of blocks authored by the given authority."] - pub async fn authored_blocks_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AuthoredBlocks<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 94u8, 193u8, 107u8, 126u8, 3u8, 13u8, 28u8, 151u8, 197u8, 226u8, 224u8, - 48u8, 138u8, 113u8, 31u8, 57u8, 111u8, 184u8, 218u8, 215u8, 185u8, - 83u8, 209u8, 139u8, 114u8, 241u8, 68u8, 110u8, 157u8, 208u8, 16u8, - 22u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " A configuration for base priority of unsigned transactions."] - #[doc = ""] - #[doc = " This is exposed so that it can be tuned for particular runtime, when"] - #[doc = " multiple pallets send unsigned transactions."] - pub fn unsigned_priority( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("ImOnline", "UnsignedPriority")? - == [ - 78u8, 226u8, 84u8, 70u8, 162u8, 23u8, 167u8, 100u8, 156u8, 228u8, - 119u8, 16u8, 28u8, 202u8, 21u8, 71u8, 72u8, 244u8, 3u8, 255u8, 243u8, - 55u8, 109u8, 238u8, 26u8, 180u8, 207u8, 175u8, 221u8, 27u8, 213u8, - 217u8, - ] - { - let pallet = locked_metadata.pallet("ImOnline")?; - let constant = pallet.constant("UnsignedPriority")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod authority_discovery { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct Keys; - impl ::subxt::StorageEntry for Keys { - const PALLET: &'static str = "AuthorityDiscovery"; - const STORAGE: &'static str = "Keys"; - type Value = - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextKeys; - impl ::subxt::StorageEntry for NextKeys { - const PALLET: &'static str = "AuthorityDiscovery"; - const STORAGE: &'static str = "NextKeys"; - type Value = - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Keys of the current authority set."] - pub async fn keys( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 105u8, 250u8, 99u8, 106u8, 9u8, 29u8, 73u8, 176u8, 158u8, 247u8, 28u8, - 171u8, 95u8, 1u8, 109u8, 11u8, 231u8, 52u8, 54u8, 102u8, 142u8, 105u8, - 209u8, 31u8, 132u8, 60u8, 89u8, 181u8, 89u8, 193u8, 241u8, 130u8, - ] - { - let entry = Keys; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Keys of the next authority set."] - pub async fn next_keys( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::sp_authority_discovery::app::Public, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 186u8, 98u8, 143u8, 207u8, 128u8, 186u8, 177u8, 65u8, 61u8, 236u8, - 48u8, 192u8, 150u8, 251u8, 247u8, 193u8, 146u8, 246u8, 27u8, 88u8, - 223u8, 96u8, 46u8, 255u8, 241u8, 36u8, 69u8, 117u8, 220u8, 63u8, 176u8, - 120u8, - ] - { - let entry = NextKeys; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod parachains_origin { - use super::root_mod; - use super::runtime_types; - } - pub mod configuration { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetValidationUpgradeCooldown { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetValidationUpgradeCooldown { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_cooldown"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetValidationUpgradeDelay { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_delay"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetCodeRetentionPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetCodeRetentionPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_code_retention_period"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxCodeSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxCodeSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_code_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxPovSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxPovSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_pov_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxHeadDataSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxHeadDataSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_head_data_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetParathreadCores { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetParathreadCores { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_cores"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetParathreadRetries { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetParathreadRetries { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_retries"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetGroupRotationFrequency { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetGroupRotationFrequency { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_group_rotation_frequency"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetChainAvailabilityPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetChainAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_chain_availability_period"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetThreadAvailabilityPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetThreadAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_thread_availability_period"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetSchedulingLookahead { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetSchedulingLookahead { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_scheduling_lookahead"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetMaxValidatorsPerCore { - pub new: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for SetMaxValidatorsPerCore { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators_per_core"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetMaxValidators { - pub new: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for SetMaxValidators { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetDisputePeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_period"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetDisputePostConclusionAcceptancePeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputePostConclusionAcceptancePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_post_conclusion_acceptance_period"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetDisputeMaxSpamSlots { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputeMaxSpamSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_max_spam_slots"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetDisputeConclusionByTimeOutPeriod { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetDisputeConclusionByTimeOutPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_conclusion_by_time_out_period"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetNoShowSlots { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetNoShowSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_no_show_slots"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetNDelayTranches { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetNDelayTranches { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_n_delay_tranches"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetZerothDelayTrancheWidth { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetZerothDelayTrancheWidth { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_zeroth_delay_tranche_width"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetNeededApprovals { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetNeededApprovals { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_needed_approvals"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetRelayVrfModuloSamples { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetRelayVrfModuloSamples { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_relay_vrf_modulo_samples"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxUpwardQueueCount { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardQueueCount { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_count"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxUpwardQueueSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardQueueSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxDownwardMessageSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxDownwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_downward_message_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetUmpServiceTotalWeight { - pub new: ::core::primitive::u64, - } - impl ::subxt::Call for SetUmpServiceTotalWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_service_total_weight"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxUpwardMessageSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_message_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMaxUpwardMessageNumPerCandidate { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxUpwardMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_message_num_per_candidate"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpOpenRequestTtl { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpOpenRequestTtl { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_open_request_ttl"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpSenderDeposit { - pub new: ::core::primitive::u128, - } - impl ::subxt::Call for SetHrmpSenderDeposit { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_sender_deposit"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpRecipientDeposit { - pub new: ::core::primitive::u128, - } - impl ::subxt::Call for SetHrmpRecipientDeposit { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_recipient_deposit"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpChannelMaxCapacity { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpChannelMaxCapacity { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_capacity"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpChannelMaxTotalSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpChannelMaxTotalSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_total_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpMaxParachainInboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParachainInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_inbound_channels"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpMaxParathreadInboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParathreadInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parathread_inbound_channels"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpChannelMaxMessageSize { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpChannelMaxMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_message_size"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpMaxParachainOutboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParachainOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_outbound_channels"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpMaxParathreadOutboundChannels { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxParathreadOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parathread_outbound_channels"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetHrmpMaxMessageNumPerCandidate { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetHrmpMaxMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_message_num_per_candidate"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetUmpMaxIndividualWeight { - pub new: ::core::primitive::u64, - } - impl ::subxt::Call for SetUmpMaxIndividualWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_max_individual_weight"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetPvfCheckingEnabled { - pub new: ::core::primitive::bool, - } - impl ::subxt::Call for SetPvfCheckingEnabled { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_pvf_checking_enabled"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetPvfVotingTtl { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetPvfVotingTtl { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_pvf_voting_ttl"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct SetMinimumValidationUpgradeDelay { - pub new: ::core::primitive::u32, - } - impl ::subxt::Call for SetMinimumValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_minimum_validation_upgrade_delay"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetBypassConsistencyCheck { - pub new: ::core::primitive::bool, - } - impl ::subxt::Call for SetBypassConsistencyCheck { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_bypass_consistency_check"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the validation upgrade cooldown."] - pub fn set_validation_upgrade_cooldown( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidationUpgradeCooldown, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 60u8, 171u8, 164u8, 241u8, 214u8, 235u8, 141u8, 4u8, 32u8, - 129u8, 253u8, 128u8, 148u8, 185u8, 51u8, 65u8, 34u8, 68u8, 72u8, 202u8, - 159u8, 74u8, 243u8, 35u8, 138u8, 208u8, 26u8, 182u8, 189u8, 41u8, 11u8, - ] - { - let call = SetValidationUpgradeCooldown { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the validation upgrade delay."] - pub fn set_validation_upgrade_delay( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetValidationUpgradeDelay, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 136u8, 220u8, 63u8, 166u8, 202u8, 19u8, 241u8, 32u8, 100u8, 14u8, - 101u8, 244u8, 241u8, 141u8, 144u8, 213u8, 185u8, 88u8, 193u8, 2u8, - 55u8, 154u8, 24u8, 77u8, 66u8, 167u8, 69u8, 245u8, 224u8, 63u8, 196u8, - 200u8, - ] - { - let call = SetValidationUpgradeDelay { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the acceptance period for an included candidate."] - pub fn set_code_retention_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetCodeRetentionPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 94u8, 104u8, 13u8, 127u8, 95u8, 137u8, 66u8, 224u8, 22u8, 53u8, 14u8, - 161u8, 67u8, 85u8, 78u8, 161u8, 92u8, 81u8, 190u8, 213u8, 113u8, 235u8, - 64u8, 19u8, 112u8, 164u8, 71u8, 88u8, 183u8, 234u8, 237u8, 9u8, - ] - { - let call = SetCodeRetentionPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the max validation code size for incoming upgrades."] - pub fn set_max_code_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxCodeSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 74u8, 39u8, 190u8, 155u8, 121u8, 60u8, 233u8, 95u8, 177u8, 57u8, 116u8, - 107u8, 200u8, 44u8, 2u8, 215u8, 209u8, 50u8, 37u8, 112u8, 136u8, 107u8, - 202u8, 142u8, 114u8, 25u8, 43u8, 134u8, 250u8, 15u8, 81u8, 13u8, - ] - { - let call = SetMaxCodeSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the max POV block size for incoming upgrades."] - pub fn set_max_pov_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxPovSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 77u8, 199u8, 18u8, 53u8, 223u8, 107u8, 57u8, 141u8, 8u8, 138u8, 180u8, - 175u8, 73u8, 88u8, 205u8, 185u8, 56u8, 106u8, 43u8, 87u8, 109u8, 9u8, - 103u8, 103u8, 50u8, 158u8, 11u8, 77u8, 162u8, 38u8, 57u8, 27u8, - ] - { - let call = SetMaxPovSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the max head data size for paras."] - pub fn set_max_head_data_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxHeadDataSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 30u8, 132u8, 5u8, 207u8, 126u8, 145u8, 187u8, 129u8, 36u8, 235u8, - 179u8, 61u8, 243u8, 87u8, 178u8, 107u8, 8u8, 21u8, 43u8, 39u8, 119u8, - 138u8, 146u8, 146u8, 109u8, 189u8, 56u8, 160u8, 14u8, 78u8, 230u8, - 149u8, - ] - { - let call = SetMaxHeadDataSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of parathread execution cores."] - pub fn set_parathread_cores( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetParathreadCores, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 5u8, 198u8, 156u8, 226u8, 125u8, 16u8, 2u8, 64u8, 28u8, 189u8, 213u8, - 85u8, 6u8, 112u8, 173u8, 183u8, 174u8, 207u8, 129u8, 110u8, 201u8, - 161u8, 163u8, 191u8, 20u8, 14u8, 65u8, 106u8, 234u8, 203u8, 39u8, 75u8, - ] - { - let call = SetParathreadCores { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of retries for a particular parathread."] - pub fn set_parathread_retries( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetParathreadRetries, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 146u8, 134u8, 204u8, 109u8, 167u8, 35u8, 255u8, 245u8, 98u8, 24u8, - 213u8, 33u8, 144u8, 194u8, 196u8, 196u8, 66u8, 220u8, 168u8, 156u8, - 171u8, 179u8, 154u8, 30u8, 221u8, 45u8, 65u8, 192u8, 194u8, 130u8, - 87u8, 100u8, - ] - { - let call = SetParathreadRetries { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the parachain validator-group rotation frequency"] - pub fn set_group_rotation_frequency( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetGroupRotationFrequency, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 102u8, 192u8, 226u8, 120u8, 69u8, 117u8, 239u8, 156u8, 111u8, 239u8, - 197u8, 191u8, 221u8, 18u8, 140u8, 214u8, 154u8, 212u8, 151u8, 35u8, - 176u8, 2u8, 162u8, 131u8, 115u8, 102u8, 177u8, 106u8, 35u8, 214u8, - 151u8, 227u8, - ] - { - let call = SetGroupRotationFrequency { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the availability period for parachains."] - pub fn set_chain_availability_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetChainAvailabilityPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 3u8, 83u8, 31u8, 241u8, 73u8, 137u8, 18u8, 95u8, 119u8, 143u8, 28u8, - 110u8, 151u8, 229u8, 172u8, 208u8, 50u8, 25u8, 89u8, 222u8, 128u8, - 125u8, 112u8, 25u8, 204u8, 141u8, 175u8, 69u8, 57u8, 161u8, 189u8, - 167u8, - ] - { - let call = SetChainAvailabilityPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the availability period for parathreads."] - pub fn set_thread_availability_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetThreadAvailabilityPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 204u8, 158u8, 5u8, 123u8, 163u8, 6u8, 209u8, 44u8, 73u8, 112u8, - 249u8, 96u8, 160u8, 188u8, 151u8, 107u8, 21u8, 9u8, 100u8, 104u8, - 184u8, 97u8, 77u8, 122u8, 254u8, 88u8, 94u8, 22u8, 15u8, 57u8, 44u8, - ] - { - let call = SetThreadAvailabilityPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] - pub fn set_scheduling_lookahead( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetSchedulingLookahead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 146u8, 149u8, 10u8, 57u8, 122u8, 116u8, 61u8, 181u8, 97u8, 240u8, 87u8, - 37u8, 227u8, 233u8, 123u8, 26u8, 243u8, 58u8, 54u8, 93u8, 111u8, 204u8, - 108u8, 18u8, 167u8, 20u8, 255u8, 173u8, 46u8, 212u8, 246u8, 201u8, - ] - { - let call = SetSchedulingLookahead { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the maximum number of validators to assign to any core."] - pub fn set_max_validators_per_core( - &self, - new: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxValidatorsPerCore, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 27u8, 160u8, 153u8, 252u8, 121u8, 42u8, 94u8, 131u8, 199u8, 216u8, - 15u8, 65u8, 94u8, 69u8, 127u8, 130u8, 179u8, 236u8, 49u8, 32u8, 239u8, - 37u8, 58u8, 0u8, 50u8, 5u8, 255u8, 30u8, 203u8, 230u8, 135u8, 202u8, - ] - { - let call = SetMaxValidatorsPerCore { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the maximum number of validators to use in parachain consensus."] - pub fn set_max_validators( - &self, - new: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxValidators, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 192u8, 156u8, 115u8, 10u8, 225u8, 94u8, 190u8, 180u8, 242u8, 131u8, - 202u8, 13u8, 82u8, 27u8, 8u8, 144u8, 70u8, 92u8, 136u8, 206u8, 205u8, - 3u8, 242u8, 130u8, 77u8, 114u8, 242u8, 111u8, 99u8, 24u8, 238u8, 55u8, - ] - { - let call = SetMaxValidators { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the dispute period, in number of sessions to keep for disputes."] - pub fn set_dispute_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputePeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 232u8, 96u8, 104u8, 249u8, 183u8, 148u8, 126u8, 80u8, 64u8, 39u8, 2u8, - 208u8, 183u8, 189u8, 139u8, 201u8, 61u8, 63u8, 42u8, 155u8, 215u8, - 32u8, 212u8, 158u8, 90u8, 80u8, 159u8, 23u8, 249u8, 204u8, 218u8, - 217u8, - ] - { - let call = SetDisputePeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the dispute post conclusion acceptance period."] - pub fn set_dispute_post_conclusion_acceptance_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputePostConclusionAcceptancePeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 45u8, 140u8, 213u8, 62u8, 212u8, 31u8, 126u8, 94u8, 102u8, 176u8, - 203u8, 240u8, 28u8, 25u8, 116u8, 77u8, 187u8, 147u8, 32u8, 20u8, 25u8, - 124u8, 164u8, 162u8, 246u8, 223u8, 146u8, 28u8, 35u8, 4u8, 174u8, 47u8, - ] - { - let call = SetDisputePostConclusionAcceptancePeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the maximum number of dispute spam slots."] - pub fn set_dispute_max_spam_slots( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputeMaxSpamSlots, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 180u8, 195u8, 6u8, 141u8, 89u8, 252u8, 245u8, 202u8, 36u8, 123u8, - 105u8, 35u8, 161u8, 60u8, 233u8, 213u8, 191u8, 65u8, 68u8, 4u8, 19u8, - 201u8, 226u8, 103u8, 124u8, 181u8, 201u8, 91u8, 84u8, 170u8, 48u8, - 154u8, - ] - { - let call = SetDisputeMaxSpamSlots { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the dispute conclusion by time out period."] - pub fn set_dispute_conclusion_by_time_out_period( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetDisputeConclusionByTimeOutPeriod, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 50u8, 221u8, 129u8, 199u8, 147u8, 98u8, 11u8, 104u8, 133u8, 161u8, - 53u8, 163u8, 100u8, 155u8, 228u8, 167u8, 146u8, 87u8, 186u8, 228u8, - 147u8, 44u8, 142u8, 160u8, 119u8, 146u8, 10u8, 155u8, 5u8, 35u8, 8u8, - 165u8, - ] - { - let call = SetDisputeConclusionByTimeOutPeriod { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the no show slots, in number of number of consensus slots."] - #[doc = "Must be at least 1."] - pub fn set_no_show_slots( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNoShowSlots, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 235u8, 5u8, 35u8, 159u8, 200u8, 58u8, 171u8, 179u8, 78u8, 70u8, 161u8, - 47u8, 237u8, 245u8, 77u8, 81u8, 1u8, 138u8, 145u8, 137u8, 45u8, 126u8, - 255u8, 227u8, 130u8, 217u8, 36u8, 251u8, 72u8, 235u8, 16u8, 231u8, - ] - { - let call = SetNoShowSlots { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the total number of delay tranches."] - pub fn set_n_delay_tranches( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNDelayTranches, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 109u8, 208u8, 13u8, 18u8, 178u8, 117u8, 101u8, 169u8, 162u8, 255u8, - 28u8, 88u8, 199u8, 89u8, 83u8, 59u8, 46u8, 105u8, 186u8, 4u8, 7u8, - 171u8, 78u8, 122u8, 197u8, 110u8, 63u8, 164u8, 140u8, 59u8, 179u8, - 236u8, - ] - { - let call = SetNDelayTranches { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the zeroth delay tranche width."] - pub fn set_zeroth_delay_tranche_width( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetZerothDelayTrancheWidth, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 162u8, 20u8, 162u8, 90u8, 59u8, 194u8, 147u8, 255u8, 198u8, 203u8, - 50u8, 13u8, 134u8, 142u8, 6u8, 156u8, 205u8, 128u8, 222u8, 225u8, - 150u8, 68u8, 198u8, 212u8, 198u8, 238u8, 3u8, 209u8, 224u8, 19u8, - 118u8, 147u8, - ] - { - let call = SetZerothDelayTrancheWidth { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of validators needed to approve a block."] - pub fn set_needed_approvals( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetNeededApprovals, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 83u8, 164u8, 204u8, 168u8, 93u8, 165u8, 118u8, 111u8, 149u8, 129u8, - 126u8, 250u8, 95u8, 148u8, 193u8, 173u8, 239u8, 1u8, 14u8, 102u8, 77u8, - 150u8, 149u8, 55u8, 82u8, 179u8, 2u8, 117u8, 19u8, 34u8, 223u8, 173u8, - ] - { - let call = SetNeededApprovals { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] - pub fn set_relay_vrf_modulo_samples( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetRelayVrfModuloSamples, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 22u8, 11u8, 132u8, 96u8, 58u8, 253u8, 183u8, 31u8, 137u8, 231u8, 187u8, - 145u8, 119u8, 164u8, 55u8, 142u8, 37u8, 151u8, 227u8, 112u8, 113u8, - 18u8, 200u8, 247u8, 238u8, 10u8, 223u8, 74u8, 4u8, 132u8, 115u8, 119u8, - ] - { - let call = SetRelayVrfModuloSamples { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] - pub fn set_max_upward_queue_count( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardQueueCount, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 16u8, 31u8, 245u8, 94u8, 243u8, 122u8, 55u8, 155u8, 161u8, 239u8, 5u8, - 59u8, 186u8, 207u8, 136u8, 253u8, 255u8, 176u8, 135u8, 242u8, 199u8, - 96u8, 226u8, 150u8, 15u8, 160u8, 60u8, 101u8, 66u8, 143u8, 93u8, 104u8, - ] - { - let call = SetMaxUpwardQueueCount { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at once."] - pub fn set_max_upward_queue_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardQueueSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 203u8, 170u8, 21u8, 149u8, 170u8, 246u8, 91u8, 54u8, 197u8, 91u8, 41u8, - 114u8, 210u8, 239u8, 73u8, 236u8, 68u8, 194u8, 157u8, 116u8, 229u8, - 1u8, 34u8, 135u8, 144u8, 191u8, 56u8, 77u8, 13u8, 92u8, 221u8, 4u8, - ] - { - let call = SetMaxUpwardQueueSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the critical downward message size."] - pub fn set_max_downward_message_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxDownwardMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 55u8, 181u8, 6u8, 126u8, 31u8, 154u8, 42u8, 194u8, 64u8, 23u8, 34u8, - 255u8, 151u8, 186u8, 52u8, 32u8, 168u8, 233u8, 44u8, 35u8, 152u8, 78u8, - 230u8, 242u8, 169u8, 85u8, 103u8, 133u8, 177u8, 239u8, 175u8, 119u8, - ] - { - let call = SetMaxDownwardMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the soft limit for the phase of dispatching dispatchable upward messages."] - pub fn set_ump_service_total_weight( - &self, - new: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUmpServiceTotalWeight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 14u8, 179u8, 217u8, 169u8, 84u8, 45u8, 193u8, 3u8, 7u8, 196u8, 56u8, - 209u8, 50u8, 148u8, 32u8, 205u8, 99u8, 202u8, 72u8, 246u8, 151u8, - 230u8, 145u8, 98u8, 188u8, 1u8, 136u8, 241u8, 217u8, 37u8, 6u8, 101u8, - ] - { - let call = SetUmpServiceTotalWeight { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] - pub fn set_max_upward_message_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 134u8, 232u8, 5u8, 70u8, 81u8, 177u8, 81u8, 235u8, 93u8, 145u8, 193u8, - 42u8, 150u8, 61u8, 236u8, 20u8, 38u8, 176u8, 124u8, 170u8, 248u8, - 149u8, 57u8, 88u8, 17u8, 46u8, 202u8, 74u8, 35u8, 82u8, 190u8, 223u8, - ] - { - let call = SetMaxUpwardMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of messages that a candidate can contain."] - pub fn set_max_upward_message_num_per_candidate( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMaxUpwardMessageNumPerCandidate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 14u8, 79u8, 128u8, 66u8, 119u8, 24u8, 26u8, 116u8, 249u8, 254u8, 86u8, - 228u8, 248u8, 75u8, 111u8, 90u8, 101u8, 96u8, 124u8, 25u8, 245u8, - 115u8, 119u8, 14u8, 213u8, 180u8, 224u8, 224u8, 188u8, 172u8, 152u8, - 16u8, - ] - { - let call = SetMaxUpwardMessageNumPerCandidate { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] - pub fn set_hrmp_open_request_ttl( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpOpenRequestTtl, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 168u8, 254u8, 189u8, 22u8, 61u8, 90u8, 131u8, 1u8, 103u8, 208u8, 179u8, - 85u8, 80u8, 215u8, 9u8, 3u8, 34u8, 73u8, 130u8, 19u8, 166u8, 77u8, - 131u8, 148u8, 183u8, 86u8, 186u8, 148u8, 109u8, 173u8, 74u8, 94u8, - ] - { - let call = SetHrmpOpenRequestTtl { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] - pub fn set_hrmp_sender_deposit( - &self, - new: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpSenderDeposit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 250u8, 23u8, 196u8, 206u8, 34u8, 86u8, 28u8, 14u8, 110u8, 189u8, 38u8, - 39u8, 2u8, 16u8, 212u8, 32u8, 65u8, 249u8, 120u8, 163u8, 89u8, 232u8, - 3u8, 49u8, 155u8, 174u8, 96u8, 21u8, 240u8, 185u8, 140u8, 243u8, - ] - { - let call = SetHrmpSenderDeposit { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] - #[doc = "channel."] - pub fn set_hrmp_recipient_deposit( - &self, - new: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpRecipientDeposit, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 104u8, 35u8, 129u8, 31u8, 111u8, 57u8, 190u8, 42u8, 159u8, 220u8, 86u8, - 136u8, 200u8, 4u8, 62u8, 241u8, 141u8, 90u8, 200u8, 132u8, 141u8, - 154u8, 117u8, 206u8, 79u8, 160u8, 124u8, 186u8, 231u8, 250u8, 86u8, - 87u8, - ] - { - let call = SetHrmpRecipientDeposit { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] - pub fn set_hrmp_channel_max_capacity( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxCapacity, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 211u8, 49u8, 82u8, 59u8, 16u8, 97u8, 253u8, 64u8, 185u8, 216u8, 235u8, - 10u8, 84u8, 194u8, 231u8, 115u8, 153u8, 20u8, 31u8, 86u8, 47u8, 226u8, - 245u8, 214u8, 134u8, 194u8, 13u8, 254u8, 230u8, 66u8, 54u8, 240u8, - ] - { - let call = SetHrmpChannelMaxCapacity { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] - pub fn set_hrmp_channel_max_total_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxTotalSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 254u8, 196u8, 171u8, 29u8, 208u8, 179u8, 204u8, 58u8, 64u8, 41u8, 52u8, - 73u8, 153u8, 245u8, 29u8, 132u8, 129u8, 29u8, 94u8, 241u8, 136u8, 20u8, - 12u8, 20u8, 255u8, 244u8, 252u8, 98u8, 136u8, 222u8, 7u8, 19u8, - ] - { - let call = SetHrmpChannelMaxTotalSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] - pub fn set_hrmp_max_parachain_inbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParachainInboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 219u8, 88u8, 3u8, 249u8, 16u8, 182u8, 182u8, 233u8, 152u8, 24u8, 29u8, - 96u8, 227u8, 50u8, 156u8, 98u8, 71u8, 196u8, 158u8, 103u8, 114u8, 55u8, - 65u8, 199u8, 211u8, 225u8, 235u8, 172u8, 218u8, 123u8, 158u8, 57u8, - ] - { - let call = SetHrmpMaxParachainInboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of inbound HRMP channels a parathread is allowed to accept."] - pub fn set_hrmp_max_parathread_inbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParathreadInboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 153u8, 169u8, 153u8, 141u8, 45u8, 21u8, 26u8, 33u8, 207u8, 234u8, - 186u8, 154u8, 12u8, 148u8, 2u8, 226u8, 55u8, 125u8, 58u8, 127u8, 154u8, - 176u8, 3u8, 47u8, 164u8, 63u8, 25u8, 42u8, 66u8, 131u8, 143u8, 254u8, - ] - { - let call = SetHrmpMaxParathreadInboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] - pub fn set_hrmp_channel_max_message_size( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpChannelMaxMessageSize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 237u8, 103u8, 126u8, 197u8, 164u8, 247u8, 67u8, 144u8, 30u8, 192u8, - 161u8, 243u8, 254u8, 26u8, 254u8, 33u8, 59u8, 216u8, 159u8, 105u8, - 166u8, 138u8, 38u8, 124u8, 248u8, 81u8, 11u8, 223u8, 120u8, 75u8, - 176u8, 177u8, - ] - { - let call = SetHrmpChannelMaxMessageSize { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] - pub fn set_hrmp_max_parachain_outbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParachainOutboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 173u8, 184u8, 49u8, 66u8, 158u8, 142u8, 95u8, 225u8, 90u8, 171u8, 4u8, - 20u8, 210u8, 180u8, 54u8, 236u8, 60u8, 5u8, 76u8, 173u8, 226u8, 203u8, - 7u8, 156u8, 54u8, 9u8, 198u8, 171u8, 250u8, 1u8, 120u8, 240u8, - ] - { - let call = SetHrmpMaxParachainOutboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of outbound HRMP channels a parathread is allowed to open."] - pub fn set_hrmp_max_parathread_outbound_channels( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxParathreadOutboundChannels, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 166u8, 73u8, 121u8, 53u8, 27u8, 77u8, 150u8, 115u8, 29u8, 202u8, 34u8, - 4u8, 35u8, 161u8, 113u8, 15u8, 66u8, 60u8, 214u8, 129u8, 157u8, 143u8, - 227u8, 134u8, 213u8, 9u8, 231u8, 224u8, 187u8, 36u8, 16u8, 68u8, - ] - { - let call = SetHrmpMaxParathreadOutboundChannels { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] - pub fn set_hrmp_max_message_num_per_candidate( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetHrmpMaxMessageNumPerCandidate, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 235u8, 47u8, 114u8, 29u8, 87u8, 198u8, 62u8, 200u8, 235u8, 184u8, - 204u8, 35u8, 251u8, 210u8, 88u8, 150u8, 22u8, 61u8, 242u8, 196u8, - 240u8, 76u8, 45u8, 54u8, 155u8, 111u8, 244u8, 31u8, 158u8, 48u8, 68u8, - 233u8, - ] - { - let call = SetHrmpMaxMessageNumPerCandidate { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the maximum amount of weight any individual upward message may consume."] - pub fn set_ump_max_individual_weight( - &self, - new: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetUmpMaxIndividualWeight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 61u8, 174u8, 42u8, 53u8, 120u8, 56u8, 252u8, 117u8, 173u8, 223u8, - 100u8, 141u8, 209u8, 29u8, 173u8, 240u8, 180u8, 113u8, 27u8, 24u8, 4u8, - 157u8, 107u8, 247u8, 235u8, 121u8, 152u8, 6u8, 176u8, 254u8, 18u8, - 70u8, - ] - { - let call = SetUmpMaxIndividualWeight { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Enable or disable PVF pre-checking. Consult the field documentation prior executing."] - pub fn set_pvf_checking_enabled( - &self, - new: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPvfCheckingEnabled, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 224u8, 199u8, 197u8, 208u8, 178u8, 211u8, 14u8, 102u8, 174u8, 205u8, - 207u8, 181u8, 75u8, 125u8, 209u8, 69u8, 85u8, 1u8, 98u8, 251u8, 17u8, - 42u8, 73u8, 9u8, 252u8, 184u8, 81u8, 202u8, 132u8, 236u8, 97u8, 121u8, - ] - { - let call = SetPvfCheckingEnabled { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] - pub fn set_pvf_voting_ttl( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPvfVotingTtl, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 179u8, 71u8, 42u8, 140u8, 187u8, 43u8, 138u8, 16u8, 104u8, 41u8, 30u8, - 220u8, 131u8, 179u8, 200u8, 184u8, 105u8, 58u8, 131u8, 225u8, 169u8, - 253u8, 46u8, 186u8, 102u8, 52u8, 147u8, 244u8, 22u8, 255u8, 41u8, 6u8, - ] - { - let call = SetPvfVotingTtl { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] - #[doc = "upgrade taking place."] - #[doc = ""] - #[doc = "See the field documentation for information and constraints for the new value."] - pub fn set_minimum_validation_upgrade_delay( - &self, - new: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMinimumValidationUpgradeDelay, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 225u8, 178u8, 41u8, 194u8, 154u8, 222u8, 247u8, 129u8, 35u8, 102u8, - 248u8, 144u8, 21u8, 74u8, 42u8, 239u8, 135u8, 205u8, 173u8, 190u8, - 112u8, 30u8, 240u8, 106u8, 10u8, 217u8, 208u8, 11u8, 79u8, 47u8, 198u8, - 37u8, - ] - { - let call = SetMinimumValidationUpgradeDelay { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Setting this to true will disable consistency checks for the configuration setters."] - #[doc = "Use with caution."] - pub fn set_bypass_consistency_check( - &self, - new: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetBypassConsistencyCheck, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 5u8, 54u8, 178u8, 218u8, 46u8, 61u8, 99u8, 23u8, 227u8, 202u8, 201u8, - 164u8, 121u8, 226u8, 65u8, 253u8, 29u8, 164u8, 170u8, 130u8, 32u8, - 85u8, 222u8, 10u8, 232u8, 252u8, 73u8, 23u8, 69u8, 30u8, 1u8, 87u8, - ] - { - let call = SetBypassConsistencyCheck { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct ActiveConfig; - impl ::subxt::StorageEntry for ActiveConfig { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "ActiveConfig"; - type Value = - runtime_types::polkadot_runtime_parachains::configuration::HostConfiguration< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingConfigs; - impl ::subxt::StorageEntry for PendingConfigs { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "PendingConfigs"; - type Value = ::std::vec::Vec<( - ::core::primitive::u32, - runtime_types::polkadot_runtime_parachains::configuration::HostConfiguration< - ::core::primitive::u32, - >, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BypassConsistencyCheck; - impl ::subxt::StorageEntry for BypassConsistencyCheck { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "BypassConsistencyCheck"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The active configuration for the current session."] - pub async fn active_config( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_runtime_parachains::configuration::HostConfiguration< - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 6u8, 31u8, 218u8, 51u8, 202u8, 166u8, 183u8, 192u8, 151u8, 184u8, - 103u8, 73u8, 239u8, 78u8, 183u8, 38u8, 192u8, 201u8, 27u8, 128u8, 59u8, - 48u8, 197u8, 23u8, 43u8, 39u8, 158u8, 35u8, 194u8, 23u8, 151u8, 145u8, - ] - { - let entry = ActiveConfig; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Pending configuration changes."] - #[doc = ""] - #[doc = " This is a list of configuration changes, each with a session index at which it should"] - #[doc = " be applied."] - #[doc = ""] - #[doc = " The list is sorted ascending by session index. Also, this list can only contain at most"] - #[doc = " 2 items: for the next session and for the `scheduled_session`."] pub async fn pending_configs (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < (:: core :: primitive :: u32 , runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > ,) > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 198u8, 168u8, 227u8, 228u8, 110u8, 98u8, 34u8, 21u8, 159u8, 114u8, - 202u8, 135u8, 39u8, 190u8, 40u8, 214u8, 170u8, 126u8, 203u8, 10u8, - 44u8, 114u8, 254u8, 208u8, 133u8, 129u8, 8u8, 112u8, 168u8, 135u8, - 196u8, 43u8, - ] - { - let entry = PendingConfigs; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " If this is set, then the configuration setters will bypass the consistency checks. This"] - #[doc = " is meant to be used only as the last resort."] - pub async fn bypass_consistency_check( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 42u8, 191u8, 122u8, 163u8, 112u8, 2u8, 148u8, 59u8, 79u8, 219u8, 184u8, - 172u8, 246u8, 136u8, 185u8, 251u8, 189u8, 226u8, 83u8, 129u8, 162u8, - 109u8, 148u8, 75u8, 120u8, 216u8, 44u8, 28u8, 221u8, 78u8, 177u8, 94u8, - ] - { - let entry = BypassConsistencyCheck; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod paras_shared { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct CurrentSessionIndex; - impl ::subxt::StorageEntry for CurrentSessionIndex { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "CurrentSessionIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveValidatorIndices; - impl ::subxt::StorageEntry for ActiveValidatorIndices { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "ActiveValidatorIndices"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveValidatorKeys; - impl ::subxt::StorageEntry for ActiveValidatorKeys { - const PALLET: &'static str = "ParasShared"; - const STORAGE: &'static str = "ActiveValidatorKeys"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current session index."] - pub async fn current_session_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 83u8, 15u8, 20u8, 55u8, 103u8, 65u8, 76u8, 202u8, 69u8, 14u8, 221u8, - 93u8, 38u8, 163u8, 167u8, 83u8, 18u8, 245u8, 33u8, 175u8, 7u8, 97u8, - 67u8, 186u8, 96u8, 57u8, 147u8, 120u8, 107u8, 91u8, 147u8, 64u8, - ] - { - let entry = CurrentSessionIndex; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All the validators actively participating in parachain consensus."] - #[doc = " Indices are into the broader validator set."] - pub async fn active_validator_indices( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 128u8, 98u8, 186u8, 22u8, 178u8, 51u8, 151u8, 235u8, 201u8, 2u8, 245u8, - 177u8, 4u8, 125u8, 1u8, 245u8, 56u8, 102u8, 166u8, 129u8, 211u8, 189u8, - 137u8, 149u8, 234u8, 252u8, 97u8, 139u8, 151u8, 16u8, 129u8, 24u8, - ] - { - let entry = ActiveValidatorIndices; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The parachain attestation keys of the validators actively participating in parachain consensus."] - #[doc = " This should be the same length as `ActiveValidatorIndices`."] - pub async fn active_validator_keys( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 130u8, 19u8, 46u8, 117u8, 211u8, 113u8, 90u8, 42u8, 173u8, 87u8, 209u8, - 185u8, 102u8, 142u8, 161u8, 60u8, 118u8, 246u8, 161u8, 183u8, 103u8, - 255u8, 75u8, 180u8, 250u8, 35u8, 235u8, 102u8, 216u8, 196u8, 190u8, - 129u8, - ] - { - let entry = ActiveValidatorKeys; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod para_inclusion { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A candidate was backed. `[candidate, head_data]`"] - pub struct CandidateBacked( - pub runtime_types::polkadot_primitives::v2::CandidateReceipt<::subxt::sp_core::H256>, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v2::CoreIndex, - pub runtime_types::polkadot_primitives::v2::GroupIndex, - ); - impl ::subxt::Event for CandidateBacked { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateBacked"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A candidate was included. `[candidate, head_data]`"] - pub struct CandidateIncluded( - pub runtime_types::polkadot_primitives::v2::CandidateReceipt<::subxt::sp_core::H256>, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v2::CoreIndex, - pub runtime_types::polkadot_primitives::v2::GroupIndex, - ); - impl ::subxt::Event for CandidateIncluded { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateIncluded"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A candidate timed out. `[candidate, head_data]`"] - pub struct CandidateTimedOut( - pub runtime_types::polkadot_primitives::v2::CandidateReceipt<::subxt::sp_core::H256>, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v2::CoreIndex, - ); - impl ::subxt::Event for CandidateTimedOut { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateTimedOut"; - } - } - pub mod storage { - use super::runtime_types; - pub struct AvailabilityBitfields<'a>( - pub &'a runtime_types::polkadot_primitives::v2::ValidatorIndex, - ); - impl ::subxt::StorageEntry for AvailabilityBitfields<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "AvailabilityBitfields"; - type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailability<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingAvailability<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "PendingAvailability"; - type Value = runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailabilityCommitments<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PendingAvailabilityCommitments<'_> { - const PALLET: &'static str = "ParaInclusion"; - const STORAGE: &'static str = "PendingAvailabilityCommitments"; - type Value = runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] pub async fn availability_bitfields (& self , _0 : & runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 223u8, 74u8, 17u8, 152u8, 136u8, 20u8, 241u8, 47u8, 169u8, 34u8, 128u8, - 78u8, 121u8, 47u8, 165u8, 35u8, 222u8, 15u8, 236u8, 90u8, 215u8, 160u8, - 10u8, 18u8, 152u8, 69u8, 38u8, 97u8, 122u8, 247u8, 241u8, 255u8, - ] - { - let entry = AvailabilityBitfields(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The latest bitfield for each validator, referred to by their index in the validator set."] - pub async fn availability_bitfields_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AvailabilityBitfields<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 223u8, 74u8, 17u8, 152u8, 136u8, 20u8, 241u8, 47u8, 169u8, 34u8, 128u8, - 78u8, 121u8, 47u8, 165u8, 35u8, 222u8, 15u8, 236u8, 90u8, 215u8, 160u8, - 10u8, 18u8, 152u8, 69u8, 38u8, 97u8, 122u8, 247u8, 241u8, 255u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Candidates pending availability by `ParaId`."] pub async fn pending_availability (& self , _0 : & runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 201u8, 235u8, 244u8, 21u8, 107u8, 106u8, 50u8, 211u8, 165u8, 102u8, - 113u8, 3u8, 54u8, 155u8, 159u8, 255u8, 117u8, 107u8, 68u8, 174u8, 86u8, - 90u8, 172u8, 181u8, 164u8, 171u8, 215u8, 238u8, 118u8, 111u8, 25u8, - 111u8, - ] - { - let entry = PendingAvailability(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Candidates pending availability by `ParaId`."] - pub async fn pending_availability_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingAvailability<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 201u8, 235u8, 244u8, 21u8, 107u8, 106u8, 50u8, 211u8, 165u8, 102u8, - 113u8, 3u8, 54u8, 155u8, 159u8, 255u8, 117u8, 107u8, 68u8, 174u8, 86u8, - 90u8, 172u8, 181u8, 164u8, 171u8, 215u8, 238u8, 118u8, 111u8, 25u8, - 111u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The commitments of candidates pending availability, by `ParaId`."] - pub async fn pending_availability_commitments( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 164u8, 245u8, 130u8, 208u8, 141u8, 88u8, 99u8, 247u8, 90u8, 215u8, - 40u8, 99u8, 239u8, 7u8, 231u8, 13u8, 233u8, 204u8, 223u8, 137u8, 158u8, - 250u8, 24u8, 107u8, 152u8, 240u8, 195u8, 28u8, 170u8, 219u8, 174u8, - 213u8, - ] - { - let entry = PendingAvailabilityCommitments(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The commitments of candidates pending availability, by `ParaId`."] - pub async fn pending_availability_commitments_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingAvailabilityCommitments<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 164u8, 245u8, 130u8, 208u8, 141u8, 88u8, 99u8, 247u8, 90u8, 215u8, - 40u8, 99u8, 239u8, 7u8, 231u8, 13u8, 233u8, 204u8, 223u8, 137u8, 158u8, - 250u8, 24u8, 107u8, 152u8, 240u8, 195u8, 28u8, 170u8, 219u8, 174u8, - 213u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod para_inherent { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Enter { - pub data: runtime_types::polkadot_primitives::v2::InherentData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for Enter { - const PALLET: &'static str = "ParaInherent"; - const FUNCTION: &'static str = "enter"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] - pub fn enter( - &self, - data: runtime_types::polkadot_primitives::v2::InherentData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Enter, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 208u8, 134u8, 126u8, 30u8, 50u8, 219u8, 225u8, 133u8, 3u8, 2u8, 121u8, - 154u8, 133u8, 141u8, 159u8, 193u8, 66u8, 252u8, 236u8, 234u8, 38u8, - 169u8, 202u8, 154u8, 28u8, 171u8, 248u8, 77u8, 31u8, 114u8, 21u8, - 215u8, - ] - { - let call = Enter { data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Included; - impl ::subxt::StorageEntry for Included { - const PALLET: &'static str = "ParaInherent"; - const STORAGE: &'static str = "Included"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct OnChainVotes; - impl ::subxt::StorageEntry for OnChainVotes { - const PALLET: &'static str = "ParaInherent"; - const STORAGE: &'static str = "OnChainVotes"; - type Value = runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Whether the paras inherent was included within this block."] - #[doc = ""] - #[doc = " The `Option<()>` is effectively a `bool`, but it never hits storage in the `None` variant"] - #[doc = " due to the guarantees of FRAME's storage APIs."] - #[doc = ""] - #[doc = " If this is `None` at the end of the block, we panic and render the block invalid."] - pub async fn included( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 208u8, 213u8, 76u8, 64u8, 90u8, 141u8, 144u8, 52u8, 220u8, 35u8, 143u8, - 171u8, 45u8, 59u8, 9u8, 218u8, 29u8, 186u8, 139u8, 203u8, 205u8, 12u8, - 10u8, 2u8, 27u8, 167u8, 182u8, 244u8, 167u8, 220u8, 44u8, 16u8, - ] - { - let entry = Included; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Scraped on chain data for extracting resolved disputes as well as backing votes."] - pub async fn on_chain_votes( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< - ::subxt::sp_core::H256, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 163u8, 22u8, 172u8, 81u8, 10u8, 19u8, 149u8, 111u8, 22u8, 92u8, 203u8, - 33u8, 225u8, 124u8, 69u8, 70u8, 66u8, 188u8, 33u8, 24u8, 132u8, 234u8, - 106u8, 51u8, 248u8, 57u8, 169u8, 115u8, 164u8, 253u8, 112u8, 235u8, - ] - { - let entry = OnChainVotes; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod para_scheduler { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct ValidatorGroups; - impl ::subxt::StorageEntry for ValidatorGroups { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ValidatorGroups"; - type Value = ::std::vec::Vec< - ::std::vec::Vec, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParathreadQueue; - impl ::subxt::StorageEntry for ParathreadQueue { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ParathreadQueue"; - type Value = - runtime_types::polkadot_runtime_parachains::scheduler::ParathreadClaimQueue; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AvailabilityCores; - impl ::subxt::StorageEntry for AvailabilityCores { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "AvailabilityCores"; - type Value = ::std::vec::Vec< - ::core::option::Option, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParathreadClaimIndex; - impl ::subxt::StorageEntry for ParathreadClaimIndex { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ParathreadClaimIndex"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SessionStartBlock; - impl ::subxt::StorageEntry for SessionStartBlock { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "SessionStartBlock"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Scheduled; - impl ::subxt::StorageEntry for Scheduled { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "Scheduled"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::scheduler::CoreAssignment, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " All the validator groups. One for each core. Indices are into `ActiveValidators` - not the"] - #[doc = " broader set of Polkadot validators, but instead just the subset used for parachains during"] - #[doc = " this session."] - #[doc = ""] - #[doc = " Bound: The number of cores is the sum of the numbers of parachains and parathread multiplexers."] - #[doc = " Reasonably, 100-1000. The dominant factor is the number of validators: safe upper bound at 10k."] - pub async fn validator_groups( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::std::vec::Vec, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 84u8, 195u8, 53u8, 111u8, 186u8, 61u8, 3u8, 36u8, 10u8, 9u8, 66u8, - 119u8, 116u8, 213u8, 86u8, 153u8, 18u8, 149u8, 83u8, 92u8, 232u8, - 212u8, 175u8, 52u8, 74u8, 135u8, 137u8, 34u8, 123u8, 232u8, 131u8, - 22u8, - ] - { - let entry = ValidatorGroups; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A queue of upcoming claims and which core they should be mapped onto."] - #[doc = ""] - #[doc = " The number of queued claims is bounded at the `scheduling_lookahead`"] - #[doc = " multiplied by the number of parathread multiplexer cores. Reasonably, 10 * 50 = 500."] - pub async fn parathread_queue( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_runtime_parachains::scheduler::ParathreadClaimQueue, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 55u8, 142u8, 211u8, 227u8, 167u8, 35u8, 168u8, 23u8, 227u8, 185u8, 5u8, - 154u8, 147u8, 237u8, 137u8, 133u8, 81u8, 121u8, 70u8, 159u8, 206u8, - 56u8, 20u8, 17u8, 79u8, 19u8, 238u8, 114u8, 60u8, 96u8, 1u8, 20u8, - ] - { - let entry = ParathreadQueue; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " One entry for each availability core. Entries are `None` if the core is not currently occupied. Can be"] - #[doc = " temporarily `Some` if scheduled but not occupied."] - #[doc = " The i'th parachain belongs to the i'th core, with the remaining cores all being"] - #[doc = " parathread-multiplexers."] - #[doc = ""] - #[doc = " Bounded by the maximum of either of these two values:"] - #[doc = " * The number of parachains and parathread multiplexers"] - #[doc = " * The number of validators divided by `configuration.max_validators_per_core`."] - pub async fn availability_cores( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::CoreOccupied, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 170u8, 116u8, 249u8, 112u8, 156u8, 147u8, 94u8, 44u8, 114u8, 10u8, - 32u8, 91u8, 229u8, 56u8, 60u8, 222u8, 212u8, 176u8, 107u8, 159u8, - 143u8, 217u8, 200u8, 158u8, 86u8, 88u8, 220u8, 204u8, 162u8, 148u8, - 207u8, 150u8, - ] - { - let entry = AvailabilityCores; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " An index used to ensure that only one claim on a parathread exists in the queue or is"] - #[doc = " currently being handled by an occupied core."] - #[doc = ""] - #[doc = " Bounded by the number of parathread cores and scheduling lookahead. Reasonably, 10 * 50 = 500."] - pub async fn parathread_claim_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 187u8, 105u8, 221u8, 0u8, 103u8, 9u8, 52u8, 127u8, 47u8, 155u8, 147u8, - 84u8, 249u8, 213u8, 140u8, 75u8, 99u8, 238u8, 220u8, 242u8, 220u8, - 99u8, 204u8, 178u8, 153u8, 170u8, 72u8, 34u8, 83u8, 238u8, 211u8, - 150u8, - ] - { - let entry = ParathreadClaimIndex; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The block number where the session start occurred. Used to track how many group rotations have occurred."] - #[doc = ""] - #[doc = " Note that in the context of parachains modules the session change is signaled during"] - #[doc = " the block and enacted at the end of the block (at the finalization stage, to be exact)."] - #[doc = " Thus for all intents and purposes the effect of the session change is observed at the"] - #[doc = " block following the session change, block number of which we save in this storage value."] - pub async fn session_start_block( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 122u8, 37u8, 150u8, 1u8, 185u8, 201u8, 168u8, 67u8, 55u8, 17u8, 101u8, - 18u8, 133u8, 212u8, 6u8, 73u8, 191u8, 204u8, 229u8, 22u8, 185u8, 120u8, - 24u8, 245u8, 121u8, 215u8, 124u8, 210u8, 49u8, 28u8, 26u8, 80u8, - ] - { - let entry = SessionStartBlock; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Currently scheduled cores - free but up to be occupied."] - #[doc = ""] - #[doc = " Bounded by the number of cores: one for each parachain and parathread multiplexer."] - #[doc = ""] - #[doc = " The value contained here will not be valid after the end of a block. Runtime APIs should be used to determine scheduled cores/"] - #[doc = " for the upcoming block."] - pub async fn scheduled( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::scheduler::CoreAssignment, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 29u8, 43u8, 158u8, 142u8, 50u8, 67u8, 4u8, 30u8, 158u8, 99u8, 47u8, - 13u8, 151u8, 141u8, 163u8, 63u8, 140u8, 179u8, 247u8, 106u8, 53u8, - 66u8, 90u8, 107u8, 95u8, 174u8, 63u8, 123u8, 176u8, 68u8, 90u8, 232u8, - ] - { - let entry = Scheduled; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod paras { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceSetCurrentCode { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for ForceSetCurrentCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_set_current_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceSetCurrentHead { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, - } - impl ::subxt::Call for ForceSetCurrentHead { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_set_current_head"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceScheduleCodeUpgrade { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - pub relay_parent_number: ::core::primitive::u32, - } - impl ::subxt::Call for ForceScheduleCodeUpgrade { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_schedule_code_upgrade"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceNoteNewHead { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, - } - impl ::subxt::Call for ForceNoteNewHead { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_note_new_head"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceQueueAction { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for ForceQueueAction { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_queue_action"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AddTrustedValidationCode { - pub validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for AddTrustedValidationCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "add_trusted_validation_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PokeUnusedValidationCode { - pub validation_code_hash: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - } - impl ::subxt::Call for PokeUnusedValidationCode { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "poke_unused_validation_code"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct IncludePvfCheckStatement { - pub stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, - pub signature: runtime_types::polkadot_primitives::v2::validator_app::Signature, - } - impl ::subxt::Call for IncludePvfCheckStatement { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "include_pvf_check_statement"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the storage for the parachain validation code immediately."] - pub fn force_set_current_code( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSetCurrentCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 100u8, 36u8, 105u8, 246u8, 77u8, 252u8, 162u8, 139u8, 60u8, 37u8, 12u8, - 148u8, 206u8, 160u8, 134u8, 105u8, 50u8, 52u8, 156u8, 252u8, 217u8, - 174u8, 211u8, 208u8, 88u8, 81u8, 236u8, 66u8, 27u8, 59u8, 126u8, 5u8, - ] - { - let call = ForceSetCurrentCode { para, new_code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the storage for the current parachain head data immediately."] - pub fn force_set_current_head( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSetCurrentHead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 119u8, 46u8, 120u8, 202u8, 138u8, 190u8, 179u8, 78u8, 155u8, 167u8, - 220u8, 233u8, 170u8, 248u8, 202u8, 92u8, 73u8, 246u8, 224u8, 56u8, - 208u8, 124u8, 215u8, 19u8, 235u8, 246u8, 89u8, 189u8, 19u8, 205u8, - 22u8, 70u8, - ] - { - let call = ForceSetCurrentHead { para, new_head }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] - pub fn force_schedule_code_upgrade( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - relay_parent_number: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceScheduleCodeUpgrade, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 254u8, 60u8, 105u8, 37u8, 116u8, 190u8, 30u8, 255u8, 210u8, 24u8, - 120u8, 99u8, 174u8, 215u8, 233u8, 83u8, 57u8, 200u8, 24u8, 49u8, 220u8, - 12u8, 103u8, 30u8, 165u8, 10u8, 125u8, 255u8, 88u8, 134u8, 199u8, 3u8, - ] - { - let call = ForceScheduleCodeUpgrade { - para, - new_code, - relay_parent_number, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Note a new block head for para within the context of the current block."] - pub fn force_note_new_head( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceNoteNewHead, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 203u8, 31u8, 68u8, 125u8, 105u8, 218u8, 177u8, 205u8, 248u8, 131u8, - 25u8, 170u8, 140u8, 56u8, 183u8, 106u8, 2u8, 118u8, 79u8, 22u8, 228u8, - 91u8, 33u8, 66u8, 245u8, 144u8, 147u8, 142u8, 14u8, 171u8, 125u8, - 233u8, - ] - { - let call = ForceNoteNewHead { para, new_head }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Put a parachain directly into the next session's action queue."] - #[doc = "We can't queue it any sooner than this without going into the"] - #[doc = "initializer..."] - pub fn force_queue_action( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceQueueAction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 141u8, 235u8, 245u8, 93u8, 24u8, 155u8, 106u8, 136u8, 190u8, 236u8, - 216u8, 131u8, 245u8, 5u8, 186u8, 131u8, 159u8, 240u8, 95u8, 139u8, - 231u8, 12u8, 255u8, 74u8, 194u8, 13u8, 112u8, 78u8, 110u8, 95u8, 26u8, - 133u8, - ] - { - let call = ForceQueueAction { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Adds the validation code to the storage."] - #[doc = ""] - #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] - #[doc = "is running for that code, it will be instantly accepted."] - #[doc = ""] - #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] - #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] - #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] - #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] - #[doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] - #[doc = ""] - #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] - #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] - pub fn add_trusted_validation_code( - &self, - validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddTrustedValidationCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 110u8, 255u8, 249u8, 176u8, 109u8, 54u8, 87u8, 19u8, 7u8, 62u8, 220u8, - 143u8, 196u8, 99u8, 66u8, 49u8, 18u8, 225u8, 14u8, 42u8, 243u8, 228u8, - 232u8, 207u8, 246u8, 34u8, 179u8, 127u8, 246u8, 239u8, 30u8, 214u8, - ] - { - let call = AddTrustedValidationCode { validation_code }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the validation code from the storage iff the reference count is 0."] - #[doc = ""] - #[doc = "This is better than removing the storage directly, because it will not remove the code"] - #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] - #[doc = "dispatching."] - pub fn poke_unused_validation_code( - &self, - validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - PokeUnusedValidationCode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 159u8, 142u8, 14u8, 7u8, 29u8, 74u8, 213u8, 165u8, 206u8, 45u8, 135u8, - 121u8, 0u8, 146u8, 217u8, 59u8, 189u8, 120u8, 169u8, 227u8, 225u8, - 135u8, 15u8, 45u8, 197u8, 201u8, 29u8, 128u8, 49u8, 165u8, 106u8, 80u8, - ] - { - let call = PokeUnusedValidationCode { - validation_code_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] - #[doc = "enacts the results if that was the last vote before achieving the supermajority."] - pub fn include_pvf_check_statement( - &self, - stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, - signature: runtime_types::polkadot_primitives::v2::validator_app::Signature, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - IncludePvfCheckStatement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 187u8, 231u8, 113u8, 29u8, 177u8, 92u8, 2u8, 116u8, 88u8, 114u8, 19u8, - 170u8, 167u8, 254u8, 149u8, 142u8, 24u8, 57u8, 187u8, 210u8, 72u8, - 239u8, 32u8, 75u8, 39u8, 47u8, 158u8, 205u8, 82u8, 50u8, 175u8, 31u8, - ] - { - let call = IncludePvfCheckStatement { stmt, signature }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Current code has been updated for a Para. `para_id`"] - pub struct CurrentCodeUpdated(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for CurrentCodeUpdated { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CurrentCodeUpdated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Current head has been updated for a Para. `para_id`"] - pub struct CurrentHeadUpdated(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for CurrentHeadUpdated { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CurrentHeadUpdated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A code upgrade has been scheduled for a Para. `para_id`"] - pub struct CodeUpgradeScheduled(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for CodeUpgradeScheduled { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "CodeUpgradeScheduled"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A new head has been noted for a Para. `para_id`"] - pub struct NewHeadNoted(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for NewHeadNoted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "NewHeadNoted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A para has been queued to execute pending actions. `para_id`"] - pub struct ActionQueued( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for ActionQueued { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "ActionQueued"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given para either initiated or subscribed to a PVF check for the given validation"] - #[doc = "code. `code_hash` `para_id`"] - pub struct PvfCheckStarted( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckStarted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckStarted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given validation code was accepted by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - pub struct PvfCheckAccepted( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckAccepted { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckAccepted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given validation code was rejected by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - pub struct PvfCheckRejected( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for PvfCheckRejected { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "PvfCheckRejected"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PvfActiveVoteMap<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for PvfActiveVoteMap<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PvfActiveVoteMap"; - type Value = - runtime_types::polkadot_runtime_parachains::paras::PvfCheckActiveVoteState< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PvfActiveVoteList; - impl ::subxt::StorageEntry for PvfActiveVoteList { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PvfActiveVoteList"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Parachains; - impl ::subxt::StorageEntry for Parachains { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "Parachains"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ParaLifecycles<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for ParaLifecycles<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "ParaLifecycles"; - type Value = runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Heads<'a>(pub &'a runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::StorageEntry for Heads<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "Heads"; - type Value = runtime_types::polkadot_parachain::primitives::HeadData; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CurrentCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for CurrentCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CurrentCodeHash"; - type Value = runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - pub &'a ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for PastCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodeHash"; - type Value = runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodeMeta<'a>(pub &'a runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::StorageEntry for PastCodeMeta<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodeMeta"; - type Value = runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodePruning; - impl ::subxt::StorageEntry for PastCodePruning { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "PastCodePruning"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct FutureCodeUpgrades<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for FutureCodeUpgrades<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "FutureCodeUpgrades"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct FutureCodeHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for FutureCodeHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "FutureCodeHash"; - type Value = runtime_types::polkadot_parachain::primitives::ValidationCodeHash; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeGoAheadSignal<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpgradeGoAheadSignal<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeGoAheadSignal"; - type Value = runtime_types::polkadot_primitives::v2::UpgradeGoAhead; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeRestrictionSignal<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpgradeRestrictionSignal<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeRestrictionSignal"; - type Value = runtime_types::polkadot_primitives::v2::UpgradeRestriction; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeCooldowns; - impl ::subxt::StorageEntry for UpgradeCooldowns { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpgradeCooldowns"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpcomingUpgrades; - impl ::subxt::StorageEntry for UpcomingUpgrades { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpcomingUpgrades"; - type Value = ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActionsQueue<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ActionsQueue<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "ActionsQueue"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpcomingParasGenesis<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for UpcomingParasGenesis<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "UpcomingParasGenesis"; - type Value = runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct CodeByHashRefs<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for CodeByHashRefs<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CodeByHashRefs"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct CodeByHash<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for CodeByHash<'_> { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CodeByHash"; - type Value = runtime_types::polkadot_parachain::primitives::ValidationCode; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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 async fn pvf_active_vote_map( - &self, - _0: &runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::paras::PvfCheckActiveVoteState< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 113u8, 142u8, 66u8, 141u8, 249u8, 227u8, 84u8, 128u8, 137u8, 111u8, - 215u8, 93u8, 246u8, 49u8, 126u8, 213u8, 77u8, 139u8, 7u8, 19u8, 254u8, - 84u8, 72u8, 96u8, 89u8, 114u8, 199u8, 150u8, 122u8, 160u8, 222u8, - 181u8, - ] - { - let entry = PvfActiveVoteMap(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn pvf_active_vote_map_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PvfActiveVoteMap<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 113u8, 142u8, 66u8, 141u8, 249u8, 227u8, 84u8, 128u8, 137u8, 111u8, - 215u8, 93u8, 246u8, 49u8, 126u8, 213u8, 77u8, 139u8, 7u8, 19u8, 254u8, - 84u8, 72u8, 96u8, 89u8, 114u8, 199u8, 150u8, 122u8, 160u8, 222u8, - 181u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The list of all currently active PVF votes. Auxiliary to `PvfActiveVoteMap`."] - pub async fn pvf_active_vote_list( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 30u8, 117u8, 174u8, 227u8, 251u8, 95u8, 176u8, 153u8, 151u8, 188u8, - 89u8, 252u8, 168u8, 203u8, 174u8, 241u8, 209u8, 45u8, 96u8, 77u8, - 117u8, 159u8, 33u8, 1u8, 55u8, 111u8, 50u8, 189u8, 246u8, 209u8, 42u8, - 155u8, - ] - { - let entry = PvfActiveVoteList; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All parachains. Ordered ascending by `ParaId`. Parathreads are not included."] - #[doc = ""] - #[doc = " Consider using the [`ParachainsCache`] type of modifying."] - pub async fn parachains( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 174u8, 146u8, 170u8, 102u8, 125u8, 176u8, 74u8, 177u8, 28u8, 54u8, - 13u8, 73u8, 188u8, 248u8, 78u8, 144u8, 88u8, 183u8, 224u8, 69u8, 224u8, - 31u8, 30u8, 115u8, 191u8, 166u8, 252u8, 218u8, 114u8, 241u8, 110u8, - 39u8, - ] - { - let entry = Parachains; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current lifecycle of a all known Para IDs."] - pub async fn para_lifecycles( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 38u8, 31u8, 0u8, 253u8, 63u8, 27u8, 13u8, 12u8, 247u8, 34u8, 21u8, - 166u8, 166u8, 236u8, 178u8, 217u8, 230u8, 117u8, 215u8, 8u8, 149u8, - 37u8, 231u8, 160u8, 226u8, 89u8, 12u8, 162u8, 197u8, 237u8, 235u8, - 127u8, - ] - { - let entry = ParaLifecycles(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current lifecycle of a all known Para IDs."] - pub async fn para_lifecycles_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ParaLifecycles<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 38u8, 31u8, 0u8, 253u8, 63u8, 27u8, 13u8, 12u8, 247u8, 34u8, 21u8, - 166u8, 166u8, 236u8, 178u8, 217u8, 230u8, 117u8, 215u8, 8u8, 149u8, - 37u8, 231u8, 160u8, 226u8, 89u8, 12u8, 162u8, 197u8, 237u8, 235u8, - 127u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The head-data of every registered para."] - pub async fn heads( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 242u8, 145u8, 237u8, 33u8, 204u8, 183u8, 18u8, 135u8, 182u8, 47u8, - 220u8, 187u8, 118u8, 79u8, 163u8, 122u8, 227u8, 215u8, 43u8, 70u8, - 24u8, 33u8, 74u8, 113u8, 67u8, 25u8, 47u8, 210u8, 136u8, 236u8, 83u8, - 148u8, - ] - { - let entry = Heads(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The head-data of every registered para."] - pub async fn heads_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Heads<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 242u8, 145u8, 237u8, 33u8, 204u8, 183u8, 18u8, 135u8, 182u8, 47u8, - 220u8, 187u8, 118u8, 79u8, 163u8, 122u8, 227u8, 215u8, 43u8, 70u8, - 24u8, 33u8, 74u8, 113u8, 67u8, 25u8, 47u8, 210u8, 136u8, 236u8, 83u8, - 148u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The validation code hash of every live para."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn current_code_hash( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 146u8, 139u8, 159u8, 78u8, 13u8, 151u8, 18u8, 117u8, 15u8, 107u8, - 251u8, 200u8, 100u8, 200u8, 170u8, 50u8, 250u8, 189u8, 162u8, 128u8, - 253u8, 51u8, 192u8, 174u8, 190u8, 48u8, 96u8, 214u8, 33u8, 117u8, 82u8, - 247u8, - ] - { - let entry = CurrentCodeHash(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The validation code hash of every live para."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn current_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CurrentCodeHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 146u8, 139u8, 159u8, 78u8, 13u8, 151u8, 18u8, 117u8, 15u8, 107u8, - 251u8, 200u8, 100u8, 200u8, 170u8, 50u8, 250u8, 189u8, 162u8, 128u8, - 253u8, 51u8, 192u8, 174u8, 190u8, 48u8, 96u8, 214u8, 33u8, 117u8, 82u8, - 247u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Actual past code hash, indicated by the para id as well as the block number at which it"] - #[doc = " became outdated."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn past_code_hash( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - _1: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 158u8, 40u8, 107u8, 17u8, 201u8, 114u8, 104u8, 4u8, 50u8, 4u8, 245u8, - 186u8, 104u8, 25u8, 142u8, 118u8, 196u8, 165u8, 252u8, 88u8, 251u8, - 92u8, 41u8, 51u8, 222u8, 217u8, 213u8, 18u8, 114u8, 245u8, 247u8, - 188u8, - ] - { - let entry = PastCodeHash(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Actual past code hash, indicated by the para id as well as the block number at which it"] - #[doc = " became outdated."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn past_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PastCodeHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 158u8, 40u8, 107u8, 17u8, 201u8, 114u8, 104u8, 4u8, 50u8, 4u8, 245u8, - 186u8, 104u8, 25u8, 142u8, 118u8, 196u8, 165u8, 252u8, 88u8, 251u8, - 92u8, 41u8, 51u8, 222u8, 217u8, 213u8, 18u8, 114u8, 245u8, 247u8, - 188u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 secondary checkers."] - pub async fn past_code_meta( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - ::core::primitive::u32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 121u8, 14u8, 91u8, 135u8, 231u8, 67u8, 189u8, 66u8, 108u8, 27u8, 241u8, - 117u8, 101u8, 34u8, 24u8, 16u8, 52u8, 198u8, 205u8, 155u8, 138u8, 9u8, - 140u8, 207u8, 27u8, 172u8, 212u8, 217u8, 47u8, 134u8, 122u8, 162u8, - ] - { - let entry = PastCodeMeta(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 secondary checkers."] - pub async fn past_code_meta_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PastCodeMeta<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 121u8, 14u8, 91u8, 135u8, 231u8, 67u8, 189u8, 66u8, 108u8, 27u8, 241u8, - 117u8, 101u8, 34u8, 24u8, 16u8, 52u8, 198u8, 205u8, 155u8, 138u8, 9u8, - 140u8, 207u8, 27u8, 172u8, 212u8, 217u8, 47u8, 134u8, 122u8, 162u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Which paras have past code that needs pruning and the relay-chain block at which the code was replaced."] - #[doc = " Note that this is the actual height of the included block, not the expected height at which the"] - #[doc = " code upgrade would be applied, although they may be equal."] - #[doc = " This is to ensure the entire acceptance period is covered, not an offset acceptance period starting"] - #[doc = " from the time at which the parachain perceives a code upgrade as having occurred."] - #[doc = " Multiple entries for a single para are permitted. Ordered ascending by block number."] - pub async fn past_code_pruning( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 142u8, 32u8, 134u8, 51u8, 34u8, 214u8, 75u8, 69u8, 77u8, 178u8, 103u8, - 117u8, 180u8, 105u8, 249u8, 178u8, 143u8, 25u8, 212u8, 207u8, 28u8, - 28u8, 175u8, 193u8, 43u8, 58u8, 51u8, 149u8, 155u8, 204u8, 37u8, 153u8, - ] - { - let entry = PastCodePruning; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The block number at which the planned code change is expected for a para."] - #[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 async fn future_code_upgrades( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 211u8, 254u8, 201u8, 63u8, 89u8, 112u8, 57u8, 82u8, 255u8, 163u8, 49u8, - 246u8, 197u8, 154u8, 55u8, 10u8, 65u8, 188u8, 172u8, 110u8, 194u8, - 155u8, 37u8, 44u8, 250u8, 154u8, 4u8, 184u8, 225u8, 79u8, 248u8, 80u8, - ] - { - let entry = FutureCodeUpgrades(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The block number at which the planned code change is expected for a para."] - #[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 async fn future_code_upgrades_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, FutureCodeUpgrades<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 211u8, 254u8, 201u8, 63u8, 89u8, 112u8, 57u8, 82u8, 255u8, 163u8, 49u8, - 246u8, 197u8, 154u8, 55u8, 10u8, 65u8, 188u8, 172u8, 110u8, 194u8, - 155u8, 37u8, 44u8, 250u8, 154u8, 4u8, 184u8, 225u8, 79u8, 248u8, 80u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The actual future code hash of a para."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn future_code_hash( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 221u8, 2u8, 237u8, 170u8, 64u8, 60u8, 98u8, 146u8, 135u8, 69u8, 6u8, - 38u8, 2u8, 239u8, 22u8, 94u8, 180u8, 163u8, 76u8, 137u8, 143u8, 124u8, - 5u8, 210u8, 129u8, 207u8, 78u8, 192u8, 144u8, 39u8, 206u8, 195u8, - ] - { - let entry = FutureCodeHash(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The actual future code hash of a para."] - #[doc = ""] - #[doc = " Corresponding code can be retrieved with [`CodeByHash`]."] - pub async fn future_code_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, FutureCodeHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 221u8, 2u8, 237u8, 170u8, 64u8, 60u8, 98u8, 146u8, 135u8, 69u8, 6u8, - 38u8, 2u8, 239u8, 22u8, 94u8, 180u8, 163u8, 76u8, 137u8, 143u8, 124u8, - 5u8, 210u8, 129u8, 207u8, 78u8, 192u8, 144u8, 39u8, 206u8, 195u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade 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 parachain"] - #[doc = " can switch its upgrade function. As soon as the parachain's block is included, the value"] - #[doc = " 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 async fn upgrade_go_ahead_signal( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 100u8, 87u8, 135u8, 185u8, 95u8, 13u8, 74u8, 134u8, 19u8, 97u8, 80u8, - 104u8, 177u8, 30u8, 82u8, 145u8, 171u8, 250u8, 99u8, 214u8, 26u8, - 243u8, 118u8, 118u8, 19u8, 188u8, 187u8, 142u8, 138u8, 68u8, 54u8, - 114u8, - ] - { - let entry = UpgradeGoAheadSignal(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " This is used by the relay-chain to communicate to a parachain a go-ahead with in the upgrade 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 parachain"] - #[doc = " can switch its upgrade function. As soon as the parachain's block is included, the value"] - #[doc = " 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 async fn upgrade_go_ahead_signal_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UpgradeGoAheadSignal<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 100u8, 87u8, 135u8, 185u8, 95u8, 13u8, 74u8, 134u8, 19u8, 97u8, 80u8, - 104u8, 177u8, 30u8, 82u8, 145u8, 171u8, 250u8, 99u8, 214u8, 26u8, - 243u8, 118u8, 118u8, 19u8, 188u8, 187u8, 142u8, 138u8, 68u8, 54u8, - 114u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn upgrade_restriction_signal( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::UpgradeRestriction, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 173u8, 198u8, 89u8, 108u8, 43u8, 93u8, 143u8, 224u8, 141u8, 248u8, - 238u8, 221u8, 237u8, 220u8, 140u8, 24u8, 7u8, 14u8, 136u8, 251u8, - 159u8, 190u8, 70u8, 98u8, 100u8, 118u8, 24u8, 212u8, 82u8, 96u8, 120u8, - 206u8, - ] - { - let entry = UpgradeRestrictionSignal(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn upgrade_restriction_signal_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UpgradeRestrictionSignal<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 173u8, 198u8, 89u8, 108u8, 43u8, 93u8, 143u8, 224u8, 141u8, 248u8, - 238u8, 221u8, 237u8, 220u8, 140u8, 24u8, 7u8, 14u8, 136u8, 251u8, - 159u8, 190u8, 70u8, 98u8, 100u8, 118u8, 24u8, 212u8, 82u8, 96u8, 120u8, - 206u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The list of parachains that are awaiting for their upgrade restriction to cooldown."] - #[doc = ""] - #[doc = " Ordered ascending by block number."] - pub async fn upgrade_cooldowns( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 120u8, 214u8, 165u8, 35u8, 125u8, 56u8, 152u8, 76u8, 124u8, 159u8, - 160u8, 93u8, 16u8, 30u8, 208u8, 199u8, 162u8, 74u8, 124u8, 141u8, - 137u8, 237u8, 229u8, 61u8, 62u8, 71u8, 54u8, 92u8, 243u8, 208u8, 114u8, - 19u8, - ] - { - let entry = UpgradeCooldowns; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The list of upcoming code upgrades. Each item is a pair of which para performs a code"] - #[doc = " upgrade and at which relay-chain block it is expected at."] - #[doc = ""] - #[doc = " Ordered ascending by block number."] - pub async fn upcoming_upgrades( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 16u8, 74u8, 254u8, 39u8, 241u8, 98u8, 106u8, 203u8, 189u8, 157u8, 66u8, - 99u8, 164u8, 176u8, 20u8, 206u8, 15u8, 212u8, 229u8, 9u8, 117u8, 214u8, - 250u8, 8u8, 51u8, 80u8, 35u8, 236u8, 120u8, 4u8, 246u8, 62u8, - ] - { - let entry = UpcomingUpgrades; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The actions to perform during the start of a specific session index."] - pub async fn actions_queue( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 103u8, 197u8, 76u8, 84u8, 133u8, 3u8, 67u8, 57u8, 107u8, 31u8, 87u8, - 33u8, 196u8, 130u8, 119u8, 93u8, 171u8, 173u8, 76u8, 242u8, 22u8, 15u8, - 133u8, 193u8, 122u8, 0u8, 112u8, 121u8, 233u8, 29u8, 17u8, 185u8, - ] - { - let entry = ActionsQueue(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The actions to perform during the start of a specific session index."] - pub async fn actions_queue_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ActionsQueue<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 103u8, 197u8, 76u8, 84u8, 133u8, 3u8, 67u8, 57u8, 107u8, 31u8, 87u8, - 33u8, 196u8, 130u8, 119u8, 93u8, 171u8, 173u8, 76u8, 242u8, 22u8, 15u8, - 133u8, 193u8, 122u8, 0u8, 112u8, 121u8, 233u8, 29u8, 17u8, 185u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn upcoming_paras_genesis( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 98u8, 249u8, 92u8, 177u8, 21u8, 84u8, 199u8, 194u8, 150u8, 213u8, - 143u8, 107u8, 99u8, 194u8, 141u8, 225u8, 55u8, 94u8, 44u8, 147u8, - 209u8, 144u8, 118u8, 66u8, 139u8, 170u8, 68u8, 62u8, 45u8, 137u8, 91u8, - 8u8, - ] - { - let entry = UpcomingParasGenesis(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn upcoming_paras_genesis_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UpcomingParasGenesis<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 98u8, 249u8, 92u8, 177u8, 21u8, 84u8, 199u8, 194u8, 150u8, 213u8, - 143u8, 107u8, 99u8, 194u8, 141u8, 225u8, 55u8, 94u8, 44u8, 147u8, - 209u8, 144u8, 118u8, 66u8, 139u8, 170u8, 68u8, 62u8, 45u8, 137u8, 91u8, - 8u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] - pub async fn code_by_hash_refs( - &self, - _0: &runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 194u8, 100u8, 213u8, 115u8, 143u8, 181u8, 255u8, 227u8, 232u8, 163u8, - 209u8, 99u8, 2u8, 138u8, 118u8, 169u8, 210u8, 202u8, 190u8, 194u8, - 221u8, 145u8, 171u8, 78u8, 212u8, 17u8, 245u8, 107u8, 99u8, 5u8, 54u8, - 118u8, - ] - { - let entry = CodeByHashRefs(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of reference on the validation code in [`CodeByHash`] storage."] - pub async fn code_by_hash_refs_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeByHashRefs<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 194u8, 100u8, 213u8, 115u8, 143u8, 181u8, 255u8, 227u8, 232u8, 163u8, - 209u8, 99u8, 2u8, 138u8, 118u8, 169u8, 210u8, 202u8, 190u8, 194u8, - 221u8, 145u8, 171u8, 78u8, 212u8, 17u8, 245u8, 107u8, 99u8, 5u8, 54u8, - 118u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Validation code stored by its hash."] - #[doc = ""] - #[doc = " This storage is consistent with [`FutureCodeHash`], [`CurrentCodeHash`] and"] - #[doc = " [`PastCodeHash`]."] - pub async fn code_by_hash( - &self, - _0: &runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCode, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 41u8, 242u8, 100u8, 156u8, 32u8, 20u8, 72u8, 228u8, 143u8, 3u8, 169u8, - 169u8, 27u8, 111u8, 119u8, 135u8, 155u8, 17u8, 222u8, 146u8, 43u8, - 243u8, 2u8, 32u8, 102u8, 143u8, 143u8, 55u8, 191u8, 129u8, 128u8, 35u8, - ] - { - let entry = CodeByHash(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Validation code stored by its hash."] - #[doc = ""] - #[doc = " This storage is consistent with [`FutureCodeHash`], [`CurrentCodeHash`] and"] - #[doc = " [`PastCodeHash`]."] - pub async fn code_by_hash_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeByHash<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 41u8, 242u8, 100u8, 156u8, 32u8, 20u8, 72u8, 228u8, 143u8, 3u8, 169u8, - 169u8, 27u8, 111u8, 119u8, 135u8, 155u8, 17u8, 222u8, 146u8, 43u8, - 243u8, 2u8, 32u8, 102u8, 143u8, 143u8, 55u8, 191u8, 129u8, 128u8, 35u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn unsigned_priority( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Paras", "UnsignedPriority")? - == [ - 78u8, 226u8, 84u8, 70u8, 162u8, 23u8, 167u8, 100u8, 156u8, 228u8, - 119u8, 16u8, 28u8, 202u8, 21u8, 71u8, 72u8, 244u8, 3u8, 255u8, 243u8, - 55u8, 109u8, 238u8, 26u8, 180u8, 207u8, 175u8, 221u8, 27u8, 213u8, - 217u8, - ] - { - let pallet = locked_metadata.pallet("Paras")?; - let constant = pallet.constant("UnsignedPriority")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod initializer { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct ForceApprove { - pub up_to: ::core::primitive::u32, - } - impl ::subxt::Call for ForceApprove { - const PALLET: &'static str = "Initializer"; - const FUNCTION: &'static str = "force_approve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] - #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] - #[doc = "chain are valid and should be finalized."] - pub fn force_approve( - &self, - up_to: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceApprove, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 61u8, 29u8, 75u8, 222u8, 82u8, 250u8, 124u8, 164u8, 70u8, 114u8, 150u8, - 28u8, 103u8, 53u8, 185u8, 147u8, 168u8, 239u8, 207u8, 197u8, 23u8, - 158u8, 16u8, 255u8, 139u8, 18u8, 214u8, 174u8, 53u8, 191u8, 49u8, 73u8, - ] - { - let call = ForceApprove { up_to }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct HasInitialized; - impl ::subxt::StorageEntry for HasInitialized { - const PALLET: &'static str = "Initializer"; - const STORAGE: &'static str = "HasInitialized"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BufferedSessionChanges; - impl ::subxt::StorageEntry for BufferedSessionChanges { - const PALLET: &'static str = "Initializer"; - const STORAGE: &'static str = "BufferedSessionChanges"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::initializer::BufferedSessionChange, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Whether the parachains modules have been initialized within this block."] - #[doc = ""] - #[doc = " Semantically a `bool`, but this guarantees it should never hit the trie,"] - #[doc = " as this is cleared in `on_finalize` and Frame optimizes `None` values to be empty values."] - #[doc = ""] - #[doc = " As a `bool`, `set(false)` and `remove()` both lead to the next `get()` being false, but one of"] - #[doc = " them writes to the trie and one does not. This confusion makes `Option<()>` more suitable for"] - #[doc = " the semantics of this variable."] - pub async fn has_initialized( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 251u8, 135u8, 247u8, 61u8, 139u8, 102u8, 12u8, 122u8, 227u8, 123u8, - 11u8, 232u8, 120u8, 80u8, 81u8, 48u8, 216u8, 115u8, 159u8, 131u8, - 133u8, 105u8, 200u8, 122u8, 114u8, 6u8, 109u8, 4u8, 164u8, 204u8, - 214u8, 111u8, - ] - { - let entry = HasInitialized; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Buffered session changes along with the block number at which they should be applied."] - #[doc = ""] - #[doc = " Typically this will be empty or one element long. Apart from that this item never hits"] - #[doc = " the storage."] - #[doc = ""] - #[doc = " However this is a `Vec` regardless to handle various edge cases that may occur at runtime"] - #[doc = " upgrade boundaries or if governance intervenes."] pub async fn buffered_session_changes (& self , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 79u8, 184u8, 104u8, 7u8, 11u8, 216u8, 205u8, 95u8, 155u8, 51u8, 17u8, - 160u8, 239u8, 14u8, 38u8, 99u8, 206u8, 87u8, 87u8, 67u8, 207u8, 142u8, - 1u8, 159u8, 54u8, 36u8, 194u8, 77u8, 86u8, 124u8, 164u8, 251u8, - ] - { - let entry = BufferedSessionChanges; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod dmp { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct DownwardMessageQueues<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for DownwardMessageQueues<'_> { - const PALLET: &'static str = "Dmp"; - const STORAGE: &'static str = "DownwardMessageQueues"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct DownwardMessageQueueHeads<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for DownwardMessageQueueHeads<'_> { - const PALLET: &'static str = "Dmp"; - const STORAGE: &'static str = "DownwardMessageQueueHeads"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The downward messages addressed for a certain para."] - pub async fn downward_message_queues( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 104u8, 117u8, 177u8, 125u8, 208u8, 212u8, 216u8, 171u8, 212u8, 235u8, - 43u8, 255u8, 146u8, 230u8, 243u8, 27u8, 133u8, 109u8, 129u8, 162u8, - 247u8, 23u8, 195u8, 9u8, 219u8, 235u8, 119u8, 220u8, 179u8, 198u8, - 130u8, 4u8, - ] - { - let entry = DownwardMessageQueues(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The downward messages addressed for a certain para."] - pub async fn downward_message_queues_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DownwardMessageQueues<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 104u8, 117u8, 177u8, 125u8, 208u8, 212u8, 216u8, 171u8, 212u8, 235u8, - 43u8, 255u8, 146u8, 230u8, 243u8, 27u8, 133u8, 109u8, 129u8, 162u8, - 247u8, 23u8, 195u8, 9u8, 219u8, 235u8, 119u8, 220u8, 179u8, 198u8, - 130u8, 4u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn downward_message_queue_heads( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 88u8, 45u8, 62u8, 250u8, 186u8, 97u8, 121u8, 56u8, 136u8, 216u8, 73u8, - 65u8, 253u8, 81u8, 94u8, 162u8, 132u8, 217u8, 78u8, 126u8, 179u8, - 188u8, 167u8, 220u8, 184u8, 217u8, 138u8, 244u8, 98u8, 158u8, 25u8, - 118u8, - ] - { - let entry = DownwardMessageQueueHeads(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn downward_message_queue_heads_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DownwardMessageQueueHeads<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 88u8, 45u8, 62u8, 250u8, 186u8, 97u8, 121u8, 56u8, 136u8, 216u8, 73u8, - 65u8, 253u8, 81u8, 94u8, 162u8, 132u8, 217u8, 78u8, 126u8, 179u8, - 188u8, 167u8, 220u8, 184u8, 217u8, 138u8, 244u8, 98u8, 158u8, 25u8, - 118u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod ump { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ServiceOverweight { - pub index: ::core::primitive::u64, - pub weight_limit: ::core::primitive::u64, - } - impl ::subxt::Call for ServiceOverweight { - const PALLET: &'static str = "Ump"; - const FUNCTION: &'static str = "service_overweight"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Service a single overweight upward message."] - #[doc = ""] - #[doc = "- `origin`: Must pass `ExecuteOverweightOrigin`."] - #[doc = "- `index`: The index of the overweight message to service."] - #[doc = "- `weight_limit`: The amount of weight that message execution may take."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `UnknownMessageIndex`: Message of `index` is unknown."] - #[doc = "- `WeightOverLimit`: Message execution may use greater than `weight_limit`."] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OverweightServiced`: On success."] - pub fn service_overweight( - &self, - index: ::core::primitive::u64, - weight_limit: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ServiceOverweight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 229u8, 167u8, 106u8, 63u8, 141u8, 80u8, 8u8, 201u8, 156u8, 34u8, 47u8, - 104u8, 116u8, 57u8, 35u8, 216u8, 132u8, 3u8, 201u8, 169u8, 38u8, 107u8, - 149u8, 120u8, 42u8, 130u8, 100u8, 133u8, 214u8, 48u8, 99u8, 146u8, - ] - { - let call = ServiceOverweight { - index, - weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Upward message is invalid XCM."] - #[doc = "\\[ id \\]"] - pub struct InvalidFormat(pub [::core::primitive::u8; 32usize]); - impl ::subxt::Event for InvalidFormat { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "InvalidFormat"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Upward message is unsupported version of XCM."] - #[doc = "\\[ id \\]"] - pub struct UnsupportedVersion(pub [::core::primitive::u8; 32usize]); - impl ::subxt::Event for UnsupportedVersion { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "UnsupportedVersion"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Upward message executed with the given outcome."] - #[doc = "\\[ id, outcome \\]"] - pub struct ExecutedUpward( - pub [::core::primitive::u8; 32usize], - pub runtime_types::xcm::v2::traits::Outcome, - ); - impl ::subxt::Event for ExecutedUpward { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "ExecutedUpward"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The weight limit for handling upward messages was reached."] - #[doc = "\\[ id, remaining, required \\]"] - pub struct WeightExhausted( - pub [::core::primitive::u8; 32usize], - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for WeightExhausted { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "WeightExhausted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some upward messages have been received and will be processed."] - #[doc = "\\[ para, count, size \\]"] - pub struct UpwardMessagesReceived( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for UpwardMessagesReceived { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "UpwardMessagesReceived"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The weight budget was exceeded for an individual upward message."] - #[doc = ""] - #[doc = "This message can be later dispatched manually using `service_overweight` dispatchable"] - #[doc = "using the assigned `overweight_index`."] - #[doc = ""] - #[doc = "\\[ para, id, overweight_index, required \\]"] - pub struct OverweightEnqueued( - pub runtime_types::polkadot_parachain::primitives::Id, - pub [::core::primitive::u8; 32usize], - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for OverweightEnqueued { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "OverweightEnqueued"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Upward message from the overweight queue was executed with the given actual weight"] - #[doc = "used."] - #[doc = ""] - #[doc = "\\[ overweight_index, used \\]"] - pub struct OverweightServiced(pub ::core::primitive::u64, pub ::core::primitive::u64); - impl ::subxt::Event for OverweightServiced { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "OverweightServiced"; - } - } - pub mod storage { - use super::runtime_types; - pub struct RelayDispatchQueues<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueues<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueues"; - type Value = ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct RelayDispatchQueueSize<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueueSize<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueueSize"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NeedsDispatch; - impl ::subxt::StorageEntry for NeedsDispatch { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "NeedsDispatch"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextDispatchRoundStartWith; - impl ::subxt::StorageEntry for NextDispatchRoundStartWith { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "NextDispatchRoundStartWith"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Overweight<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Overweight<'_> { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "Overweight"; - type Value = ( - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct OverweightCount; - impl ::subxt::StorageEntry for OverweightCount { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "OverweightCount"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] - #[doc = ""] - #[doc = " Note that some upward messages might have been already processed by the inclusion logic. E.g."] - #[doc = " channel management messages."] - #[doc = ""] - #[doc = " The messages are processed in FIFO order."] - pub async fn relay_dispatch_queues( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 22u8, 48u8, 215u8, 37u8, 42u8, 115u8, 27u8, 8u8, 249u8, 65u8, 47u8, - 61u8, 96u8, 1u8, 196u8, 143u8, 53u8, 7u8, 241u8, 126u8, 4u8, 242u8, - 42u8, 171u8, 66u8, 162u8, 203u8, 200u8, 239u8, 50u8, 87u8, 72u8, - ] - { - let entry = RelayDispatchQueues(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The messages waiting to be handled by the relay-chain originating from a certain parachain."] - #[doc = ""] - #[doc = " Note that some upward messages might have been already processed by the inclusion logic. E.g."] - #[doc = " channel management messages."] - #[doc = ""] - #[doc = " The messages are processed in FIFO order."] - pub async fn relay_dispatch_queues_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, RelayDispatchQueues<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 22u8, 48u8, 215u8, 37u8, 42u8, 115u8, 27u8, 8u8, 249u8, 65u8, 47u8, - 61u8, 96u8, 1u8, 196u8, 143u8, 53u8, 7u8, 241u8, 126u8, 4u8, 242u8, - 42u8, 171u8, 66u8, 162u8, 203u8, 200u8, 239u8, 50u8, 87u8, 72u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] - #[doc = ""] - #[doc = " First item in the tuple is the count of messages and second"] - #[doc = " is the total length (in bytes) of the message payloads."] - #[doc = ""] - #[doc = " Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of"] - #[doc = " messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of"] - #[doc = " loading the whole message queue if only the total size and count are required."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - The set of keys should exactly match the set of keys of `RelayDispatchQueues`."] - pub async fn relay_dispatch_queue_size( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - (::core::primitive::u32, ::core::primitive::u32), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 8u8, 0u8, 54u8, 33u8, 185u8, 112u8, 21u8, 174u8, 15u8, 147u8, 134u8, - 184u8, 108u8, 144u8, 55u8, 138u8, 24u8, 66u8, 255u8, 197u8, 131u8, - 229u8, 35u8, 107u8, 251u8, 226u8, 78u8, 218u8, 41u8, 251u8, 155u8, - 79u8, - ] - { - let entry = RelayDispatchQueueSize(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`."] - #[doc = ""] - #[doc = " First item in the tuple is the count of messages and second"] - #[doc = " is the total length (in bytes) of the message payloads."] - #[doc = ""] - #[doc = " Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of"] - #[doc = " messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of"] - #[doc = " loading the whole message queue if only the total size and count are required."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - The set of keys should exactly match the set of keys of `RelayDispatchQueues`."] - pub async fn relay_dispatch_queue_size_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, RelayDispatchQueueSize<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 8u8, 0u8, 54u8, 33u8, 185u8, 112u8, 21u8, 174u8, 15u8, 147u8, 134u8, - 184u8, 108u8, 144u8, 55u8, 138u8, 24u8, 66u8, 255u8, 197u8, 131u8, - 229u8, 35u8, 107u8, 251u8, 226u8, 78u8, 218u8, 41u8, 251u8, 155u8, - 79u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The ordered list of `ParaId`s that have a `RelayDispatchQueue` entry."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - The set of items from this vector should be exactly the set of the keys in"] - #[doc = " `RelayDispatchQueues` and `RelayDispatchQueueSize`."] - pub async fn needs_dispatch( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 75u8, 38u8, 232u8, 83u8, 71u8, 101u8, 248u8, 170u8, 5u8, 32u8, 209u8, - 97u8, 190u8, 31u8, 241u8, 1u8, 98u8, 87u8, 64u8, 208u8, 26u8, 100u8, - 93u8, 79u8, 61u8, 114u8, 11u8, 172u8, 112u8, 164u8, 171u8, 237u8, - ] - { - let entry = NeedsDispatch; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " This is the para that gets will get dispatched first during the next upward dispatchable queue"] - #[doc = " execution round."] - #[doc = ""] - #[doc = " Invariant:"] - #[doc = " - If `Some(para)`, then `para` must be present in `NeedsDispatch`."] - pub async fn next_dispatch_round_start_with( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 102u8, 165u8, 118u8, 140u8, 84u8, 122u8, 91u8, 169u8, 232u8, 125u8, - 52u8, 228u8, 15u8, 228u8, 91u8, 79u8, 218u8, 62u8, 93u8, 42u8, 204u8, - 6u8, 34u8, 185u8, 218u8, 150u8, 7u8, 250u8, 79u8, 142u8, 211u8, 0u8, - ] - { - let entry = NextDispatchRoundStartWith; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The messages that exceeded max individual message weight budget."] - #[doc = ""] - #[doc = " These messages stay there until manually dispatched."] - pub async fn overweight( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 223u8, 155u8, 1u8, 100u8, 77u8, 13u8, 92u8, 235u8, 64u8, 30u8, 199u8, - 178u8, 149u8, 66u8, 155u8, 201u8, 84u8, 26u8, 81u8, 183u8, 0u8, 113u8, - 182u8, 37u8, 69u8, 66u8, 240u8, 151u8, 254u8, 249u8, 134u8, 51u8, - ] - { - let entry = Overweight(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The messages that exceeded max individual message weight budget."] - #[doc = ""] - #[doc = " These messages stay there until manually dispatched."] - pub async fn overweight_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Overweight<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 223u8, 155u8, 1u8, 100u8, 77u8, 13u8, 92u8, 235u8, 64u8, 30u8, 199u8, - 178u8, 149u8, 66u8, 155u8, 201u8, 84u8, 26u8, 81u8, 183u8, 0u8, 113u8, - 182u8, 37u8, 69u8, 66u8, 240u8, 151u8, 254u8, 249u8, 134u8, 51u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of overweight messages ever recorded in `Overweight` (and thus the lowest free"] - #[doc = " index)."] - pub async fn overweight_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 102u8, 180u8, 196u8, 148u8, 115u8, 62u8, 46u8, 238u8, 97u8, 116u8, - 117u8, 42u8, 14u8, 5u8, 72u8, 237u8, 230u8, 46u8, 150u8, 126u8, 89u8, - 64u8, 233u8, 166u8, 180u8, 137u8, 52u8, 233u8, 252u8, 255u8, 36u8, - 20u8, - ] - { - let entry = OverweightCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod hrmp { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HrmpInitOpenChannel { - pub recipient: runtime_types::polkadot_parachain::primitives::Id, - pub proposed_max_capacity: ::core::primitive::u32, - pub proposed_max_message_size: ::core::primitive::u32, - } - impl ::subxt::Call for HrmpInitOpenChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_init_open_channel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HrmpAcceptOpenChannel { - pub sender: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for HrmpAcceptOpenChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_accept_open_channel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HrmpCloseChannel { - pub channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, - } - impl ::subxt::Call for HrmpCloseChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_close_channel"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceCleanHrmp { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub inbound: ::core::primitive::u32, - pub outbound: ::core::primitive::u32, - } - impl ::subxt::Call for ForceCleanHrmp { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_clean_hrmp"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct ForceProcessHrmpOpen { - pub channels: ::core::primitive::u32, - } - impl ::subxt::Call for ForceProcessHrmpOpen { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_open"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct ForceProcessHrmpClose { - pub channels: ::core::primitive::u32, - } - impl ::subxt::Call for ForceProcessHrmpClose { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_close"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HrmpCancelOpenRequest { - pub channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, - pub open_requests: ::core::primitive::u32, - } - impl ::subxt::Call for HrmpCancelOpenRequest { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_cancel_open_request"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] - #[doc = "parameters."] - #[doc = ""] - #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] - #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] - #[doc = ""] - #[doc = "These numbers are a subject to the relay-chain configuration limits."] - #[doc = ""] - #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] - #[doc = "change."] - pub fn hrmp_init_open_channel( - &self, - recipient: runtime_types::polkadot_parachain::primitives::Id, - proposed_max_capacity: ::core::primitive::u32, - proposed_max_message_size: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpInitOpenChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 244u8, 142u8, 161u8, 144u8, 109u8, 104u8, 164u8, 198u8, 201u8, 79u8, - 178u8, 136u8, 107u8, 104u8, 83u8, 11u8, 167u8, 164u8, 223u8, 147u8, - 135u8, 35u8, 133u8, 176u8, 236u8, 112u8, 107u8, 131u8, 184u8, 105u8, - 174u8, 12u8, - ] - { - let call = HrmpInitOpenChannel { - recipient, - proposed_max_capacity, - proposed_max_message_size, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Accept a pending open channel request from the given sender."] - #[doc = ""] - #[doc = "The channel will be opened only on the next session boundary."] - pub fn hrmp_accept_open_channel( - &self, - sender: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpAcceptOpenChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 95u8, 196u8, 155u8, 220u8, 235u8, 120u8, 67u8, 247u8, 245u8, 20u8, - 162u8, 41u8, 4u8, 204u8, 125u8, 16u8, 224u8, 72u8, 198u8, 237u8, 84u8, - 46u8, 201u8, 17u8, 172u8, 55u8, 115u8, 51u8, 16u8, 140u8, 4u8, 253u8, - ] - { - let call = HrmpAcceptOpenChannel { sender }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] - #[doc = "recipient in the channel being closed."] - #[doc = ""] - #[doc = "The closure can only happen on a session change."] - pub fn hrmp_close_channel( - &self, - channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpCloseChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 199u8, 9u8, 55u8, 184u8, 196u8, 45u8, 46u8, 251u8, 48u8, 23u8, 132u8, - 74u8, 188u8, 121u8, 41u8, 18u8, 71u8, 65u8, 129u8, 14u8, 38u8, 48u8, - 253u8, 119u8, 171u8, 202u8, 9u8, 65u8, 250u8, 98u8, 185u8, 220u8, - ] - { - let call = HrmpCloseChannel { channel_id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] - #[doc = "a para may have. Normally this happens once per session, but this allows"] - #[doc = "you to trigger the cleanup immediately for a specific parachain."] - #[doc = ""] - #[doc = "Origin must be Root."] - #[doc = ""] - #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] - pub fn force_clean_hrmp( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - inbound: ::core::primitive::u32, - outbound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceCleanHrmp, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 182u8, 231u8, 99u8, 129u8, 130u8, 109u8, 97u8, 108u8, 37u8, 107u8, - 203u8, 70u8, 133u8, 106u8, 226u8, 77u8, 110u8, 189u8, 227u8, 26u8, - 129u8, 189u8, 234u8, 215u8, 112u8, 22u8, 127u8, 185u8, 152u8, 157u8, - 14u8, 66u8, - ] - { - let call = ForceCleanHrmp { - para, - inbound, - outbound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force process HRMP open channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP open channel requests, you can use this"] - #[doc = "function process all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of opening channels must be provided as witness data of weighing."] - pub fn force_process_hrmp_open( - &self, - channels: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceProcessHrmpOpen, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 162u8, 53u8, 194u8, 175u8, 117u8, 32u8, 217u8, 177u8, 9u8, 255u8, 88u8, - 40u8, 8u8, 174u8, 8u8, 11u8, 26u8, 82u8, 213u8, 40u8, 20u8, 89u8, - 227u8, 209u8, 95u8, 162u8, 221u8, 97u8, 230u8, 98u8, 110u8, 85u8, - ] - { - let call = ForceProcessHrmpOpen { channels }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force process HRMP close channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP close channel requests, you can use this"] - #[doc = "function process all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of closing channels must be provided as witness data of weighing."] - pub fn force_process_hrmp_close( - &self, - channels: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceProcessHrmpClose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 128u8, 141u8, 191u8, 255u8, 204u8, 137u8, 27u8, 170u8, 180u8, 166u8, - 93u8, 144u8, 70u8, 56u8, 132u8, 100u8, 5u8, 114u8, 252u8, 163u8, 164u8, - 246u8, 234u8, 152u8, 193u8, 79u8, 89u8, 137u8, 46u8, 171u8, 32u8, - 119u8, - ] - { - let call = ForceProcessHrmpClose { channels }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] - #[doc = "or the recipient for that request. The origin must be either of those."] - #[doc = ""] - #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] - #[doc = "already accepted."] - #[doc = ""] - #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] - #[doc = "witness data."] - pub fn hrmp_cancel_open_request( - &self, - channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, - open_requests: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - HrmpCancelOpenRequest, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 8u8, 83u8, 32u8, 187u8, 220u8, 1u8, 212u8, 226u8, 72u8, 61u8, 110u8, - 211u8, 238u8, 119u8, 95u8, 48u8, 150u8, 51u8, 177u8, 182u8, 209u8, - 174u8, 245u8, 25u8, 194u8, 199u8, 212u8, 131u8, 77u8, 72u8, 9u8, 120u8, - ] - { - let call = HrmpCancelOpenRequest { - channel_id, - open_requests, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Open HRMP channel requested."] - #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] - pub struct OpenChannelRequested( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for OpenChannelRequested { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelRequested"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] - #[doc = "`[by_parachain, channel_id]`"] - pub struct OpenChannelCanceled( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::Event for OpenChannelCanceled { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelCanceled"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Open HRMP channel accepted. `[sender, recipient]`"] - pub struct OpenChannelAccepted( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::Event for OpenChannelAccepted { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelAccepted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] - pub struct ChannelClosed( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::Event for ChannelClosed { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "ChannelClosed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct HrmpOpenChannelRequests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpOpenChannelRequests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequests"; - type Value = - runtime_types::polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpOpenChannelRequestsList; - impl ::subxt::StorageEntry for HrmpOpenChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestsList"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct HrmpOpenChannelRequestCount<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpOpenChannelRequestCount<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpAcceptedChannelRequestCount<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpAcceptedChannelRequestCount<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpAcceptedChannelRequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpCloseChannelRequests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpCloseChannelRequests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpCloseChannelRequests"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpCloseChannelRequestsList; - impl ::subxt::StorageEntry for HrmpCloseChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpCloseChannelRequestsList"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct HrmpWatermarks<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpWatermarks<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpWatermarks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannels<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpChannels<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannels"; - type Value = runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpIngressChannelsIndex<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpIngressChannelsIndex<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpIngressChannelsIndex"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpEgressChannelsIndex<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpEgressChannelsIndex<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpEgressChannelsIndex"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannelContents<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ); - impl ::subxt::StorageEntry for HrmpChannelContents<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelContents"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct HrmpChannelDigests<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpChannelDigests<'_> { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelDigests"; - type Value = ::std::vec::Vec<( - ::core::primitive::u32, - ::std::vec::Vec, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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 async fn hrmp_open_channel_requests( - &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 58u8, 216u8, 106u8, 4u8, 117u8, 77u8, 168u8, 230u8, 50u8, 6u8, 175u8, - 26u8, 110u8, 45u8, 143u8, 207u8, 174u8, 77u8, 5u8, 245u8, 172u8, 114u8, - 20u8, 229u8, 153u8, 137u8, 220u8, 189u8, 155u8, 5u8, 116u8, 236u8, - ] - { - let entry = HrmpOpenChannelRequests(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_open_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequests<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 58u8, 216u8, 106u8, 4u8, 117u8, 77u8, 168u8, 230u8, 50u8, 6u8, 175u8, - 26u8, 110u8, 45u8, 143u8, 207u8, 174u8, 77u8, 5u8, 245u8, 172u8, 114u8, - 20u8, 229u8, 153u8, 137u8, 220u8, 189u8, 155u8, 5u8, 116u8, 236u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn hrmp_open_channel_requests_list( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 176u8, 22u8, 136u8, 206u8, 243u8, 208u8, 67u8, 150u8, 187u8, 163u8, - 141u8, 37u8, 235u8, 84u8, 176u8, 63u8, 55u8, 38u8, 215u8, 185u8, 206u8, - 127u8, 37u8, 108u8, 245u8, 237u8, 154u8, 151u8, 111u8, 33u8, 39u8, - 102u8, - ] - { - let entry = HrmpOpenChannelRequestsList; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_open_channel_request_count( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 103u8, 47u8, 152u8, 1u8, 119u8, 244u8, 62u8, 249u8, 141u8, 194u8, - 157u8, 149u8, 58u8, 208u8, 113u8, 77u8, 4u8, 248u8, 114u8, 94u8, 153u8, - 20u8, 179u8, 4u8, 43u8, 32u8, 248u8, 118u8, 115u8, 206u8, 228u8, 28u8, - ] - { - let entry = HrmpOpenChannelRequestCount(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_open_channel_request_count_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequestCount<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 103u8, 47u8, 152u8, 1u8, 119u8, 244u8, 62u8, 249u8, 141u8, 194u8, - 157u8, 149u8, 58u8, 208u8, 113u8, 77u8, 4u8, 248u8, 114u8, 94u8, 153u8, - 20u8, 179u8, 4u8, 43u8, 32u8, 248u8, 118u8, 115u8, 206u8, 228u8, 28u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_accepted_channel_request_count( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 166u8, 207u8, 97u8, 222u8, 30u8, 204u8, 203u8, 122u8, 72u8, 66u8, - 247u8, 169u8, 128u8, 122u8, 145u8, 124u8, 214u8, 183u8, 251u8, 85u8, - 93u8, 37u8, 143u8, 71u8, 45u8, 61u8, 168u8, 211u8, 222u8, 58u8, 91u8, - 202u8, - ] - { - let entry = HrmpAcceptedChannelRequestCount(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_accepted_channel_request_count_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpAcceptedChannelRequestCount<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 166u8, 207u8, 97u8, 222u8, 30u8, 204u8, 203u8, 122u8, 72u8, 66u8, - 247u8, 169u8, 128u8, 122u8, 145u8, 124u8, 214u8, 183u8, 251u8, 85u8, - 93u8, 37u8, 143u8, 71u8, 45u8, 61u8, 168u8, 211u8, 222u8, 58u8, 91u8, - 202u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_close_channel_requests( - &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 118u8, 8u8, 142u8, 158u8, 184u8, 200u8, 38u8, 112u8, 217u8, 69u8, - 161u8, 255u8, 116u8, 143u8, 94u8, 185u8, 95u8, 247u8, 227u8, 101u8, - 107u8, 55u8, 172u8, 164u8, 58u8, 182u8, 193u8, 140u8, 142u8, 118u8, - 223u8, 240u8, - ] - { - let entry = HrmpCloseChannelRequests(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_close_channel_requests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 118u8, 8u8, 142u8, 158u8, 184u8, 200u8, 38u8, 112u8, 217u8, 69u8, - 161u8, 255u8, 116u8, 143u8, 94u8, 185u8, 95u8, 247u8, 227u8, 101u8, - 107u8, 55u8, 172u8, 164u8, 58u8, 182u8, 193u8, 140u8, 142u8, 118u8, - 223u8, 240u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn hrmp_close_channel_requests_list( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 203u8, 46u8, 200u8, 63u8, 120u8, 238u8, 88u8, 170u8, 239u8, 27u8, 99u8, - 104u8, 254u8, 194u8, 152u8, 221u8, 126u8, 188u8, 2u8, 153u8, 79u8, - 183u8, 236u8, 145u8, 120u8, 151u8, 235u8, 56u8, 130u8, 240u8, 74u8, - 211u8, - ] - { - let entry = HrmpCloseChannelRequestsList; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 session."] - pub async fn hrmp_watermarks( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 28u8, 187u8, 5u8, 0u8, 130u8, 11u8, 241u8, 171u8, 141u8, 109u8, 236u8, - 151u8, 194u8, 124u8, 172u8, 180u8, 36u8, 144u8, 134u8, 53u8, 162u8, - 247u8, 138u8, 209u8, 99u8, 194u8, 213u8, 100u8, 254u8, 15u8, 51u8, - 94u8, - ] - { - let entry = HrmpWatermarks(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 session."] - pub async fn hrmp_watermarks_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpWatermarks<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 28u8, 187u8, 5u8, 0u8, 130u8, 11u8, 241u8, 171u8, 141u8, 109u8, 236u8, - 151u8, 194u8, 124u8, 172u8, 180u8, 36u8, 144u8, 134u8, 53u8, 162u8, - 247u8, 138u8, 209u8, 99u8, 194u8, 213u8, 100u8, 254u8, 15u8, 51u8, - 94u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_channels( - &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 241u8, 160u8, 242u8, 167u8, 251u8, 8u8, 131u8, 194u8, 179u8, 216u8, - 231u8, 125u8, 58u8, 118u8, 61u8, 113u8, 46u8, 47u8, 6u8, 71u8, 46u8, - 113u8, 192u8, 1u8, 199u8, 207u8, 179u8, 253u8, 144u8, 146u8, 19u8, 1u8, - ] - { - let entry = HrmpChannels(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_channels_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannels<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 241u8, 160u8, 242u8, 167u8, 251u8, 8u8, 131u8, 194u8, 179u8, 216u8, - 231u8, 125u8, 58u8, 118u8, 61u8, 113u8, 46u8, 47u8, 6u8, 71u8, 46u8, - 113u8, 192u8, 1u8, 199u8, 207u8, 179u8, 253u8, 144u8, 146u8, 19u8, 1u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_ingress_channels_index( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 193u8, 185u8, 164u8, 194u8, 89u8, 218u8, 214u8, 184u8, 100u8, 238u8, - 232u8, 90u8, 243u8, 230u8, 93u8, 191u8, 197u8, 182u8, 215u8, 254u8, - 192u8, 11u8, 171u8, 211u8, 150u8, 210u8, 75u8, 216u8, 149u8, 60u8, - 49u8, 166u8, - ] - { - let entry = HrmpIngressChannelsIndex(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_ingress_channels_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpIngressChannelsIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 193u8, 185u8, 164u8, 194u8, 89u8, 218u8, 214u8, 184u8, 100u8, 238u8, - 232u8, 90u8, 243u8, 230u8, 93u8, 191u8, 197u8, 182u8, 215u8, 254u8, - 192u8, 11u8, 171u8, 211u8, 150u8, 210u8, 75u8, 216u8, 149u8, 60u8, - 49u8, 166u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn hrmp_egress_channels_index( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 242u8, 138u8, 89u8, 201u8, 60u8, 216u8, 73u8, 66u8, 167u8, 82u8, 225u8, - 42u8, 61u8, 50u8, 54u8, 187u8, 212u8, 8u8, 255u8, 183u8, 85u8, 180u8, - 176u8, 0u8, 226u8, 173u8, 45u8, 155u8, 172u8, 28u8, 229u8, 157u8, - ] - { - let entry = HrmpEgressChannelsIndex(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn hrmp_egress_channels_index_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 242u8, 138u8, 89u8, 201u8, 60u8, 216u8, 73u8, 66u8, 167u8, 82u8, 225u8, - 42u8, 61u8, 50u8, 54u8, 187u8, 212u8, 8u8, 255u8, 183u8, 85u8, 180u8, - 176u8, 0u8, 226u8, 173u8, 45u8, 155u8, 172u8, 28u8, 229u8, 157u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Storage for the messages for each channel."] - #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] - pub async fn hrmp_channel_contents( - &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 71u8, 246u8, 41u8, 12u8, 125u8, 10u8, 60u8, 209u8, 14u8, 254u8, 125u8, - 217u8, 251u8, 172u8, 243u8, 73u8, 33u8, 230u8, 242u8, 16u8, 207u8, - 165u8, 33u8, 136u8, 78u8, 83u8, 206u8, 134u8, 65u8, 115u8, 166u8, - 192u8, - ] - { - let entry = HrmpChannelContents(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Storage for the messages for each channel."] - #[doc = " Invariant: cannot be non-empty if the corresponding channel in `HrmpChannels` is `None`."] - pub async fn hrmp_channel_contents_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelContents<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 71u8, 246u8, 41u8, 12u8, 125u8, 10u8, 60u8, 209u8, 14u8, 254u8, 125u8, - 217u8, 251u8, 172u8, 243u8, 73u8, 33u8, 230u8, 242u8, 16u8, 207u8, - 165u8, 33u8, 136u8, 78u8, 83u8, 206u8, 134u8, 65u8, 115u8, 166u8, - 192u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_channel_digests( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::core::primitive::u32, - ::std::vec::Vec, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 54u8, 106u8, 76u8, 21u8, 18u8, 49u8, 1u8, 34u8, 247u8, 101u8, 150u8, - 142u8, 214u8, 137u8, 193u8, 100u8, 208u8, 162u8, 55u8, 229u8, 203u8, - 36u8, 154u8, 138u8, 48u8, 204u8, 114u8, 243u8, 54u8, 185u8, 27u8, - 173u8, - ] - { - let entry = HrmpChannelDigests(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn hrmp_channel_digests_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelDigests<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 54u8, 106u8, 76u8, 21u8, 18u8, 49u8, 1u8, 34u8, 247u8, 101u8, 150u8, - 142u8, 214u8, 137u8, 193u8, 100u8, 208u8, 162u8, 55u8, 229u8, 203u8, - 36u8, 154u8, 138u8, 48u8, 204u8, 114u8, 243u8, 54u8, 185u8, 27u8, - 173u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod para_session_info { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct AssignmentKeysUnsafe; - impl ::subxt::StorageEntry for AssignmentKeysUnsafe { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "AssignmentKeysUnsafe"; - type Value = - ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EarliestStoredSession; - impl ::subxt::StorageEntry for EarliestStoredSession { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "EarliestStoredSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Sessions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Sessions<'_> { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "Sessions"; - type Value = runtime_types::polkadot_primitives::v2::SessionInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Assignment keys for the current session."] - #[doc = " Note that this API is private due to it being prone to 'off-by-one' at session boundaries."] - #[doc = " When in doubt, use `Sessions` API instead."] - pub async fn assignment_keys_unsafe( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 243u8, 5u8, 37u8, 167u8, 29u8, 59u8, 87u8, 66u8, 53u8, 91u8, 181u8, - 9u8, 144u8, 248u8, 225u8, 121u8, 130u8, 111u8, 140u8, 35u8, 79u8, - 187u8, 159u8, 22u8, 192u8, 166u8, 144u8, 161u8, 239u8, 98u8, 255u8, - 108u8, - ] - { - let entry = AssignmentKeysUnsafe; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The earliest session for which previous session info is stored."] - pub async fn earliest_stored_session( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 25u8, 143u8, 246u8, 184u8, 35u8, 166u8, 140u8, 147u8, 171u8, 5u8, - 164u8, 159u8, 228u8, 21u8, 248u8, 236u8, 48u8, 210u8, 133u8, 140u8, - 171u8, 3u8, 85u8, 250u8, 160u8, 102u8, 95u8, 46u8, 33u8, 81u8, 102u8, - 241u8, - ] - { - let entry = EarliestStoredSession; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn sessions( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 95u8, 222u8, 240u8, 96u8, 203u8, 233u8, 100u8, 160u8, 180u8, 161u8, - 180u8, 123u8, 168u8, 102u8, 93u8, 172u8, 93u8, 174u8, 103u8, 211u8, - 254u8, 30u8, 207u8, 199u8, 148u8, 200u8, 100u8, 155u8, 149u8, 48u8, - 238u8, 51u8, - ] - { - let entry = Sessions(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn sessions_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Sessions<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 95u8, 222u8, 240u8, 96u8, 203u8, 233u8, 100u8, 160u8, 180u8, 161u8, - 180u8, 123u8, 168u8, 102u8, 93u8, 172u8, 93u8, 174u8, 103u8, 211u8, - 254u8, 30u8, 207u8, 199u8, 148u8, 200u8, 100u8, 155u8, 149u8, 48u8, - 238u8, 51u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod paras_disputes { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceUnfreeze; - impl ::subxt::Call for ForceUnfreeze { - const PALLET: &'static str = "ParasDisputes"; - const FUNCTION: &'static str = "force_unfreeze"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - pub fn force_unfreeze( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnfreeze, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 212u8, 211u8, 58u8, 159u8, 23u8, 220u8, 64u8, 175u8, 65u8, 50u8, 192u8, - 122u8, 113u8, 189u8, 74u8, 191u8, 48u8, 93u8, 251u8, 50u8, 237u8, - 240u8, 91u8, 139u8, 193u8, 114u8, 131u8, 125u8, 124u8, 236u8, 191u8, - 190u8, - ] - { - let call = ForceUnfreeze {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::disputes::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] - pub struct DisputeInitiated( - pub runtime_types::polkadot_core_primitives::CandidateHash, - pub runtime_types::polkadot_runtime_parachains::disputes::DisputeLocation, - ); - impl ::subxt::Event for DisputeInitiated { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeInitiated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A dispute has concluded for or against a candidate."] - #[doc = "`\\[para id, candidate hash, dispute result\\]`"] - pub struct DisputeConcluded( - pub runtime_types::polkadot_core_primitives::CandidateHash, - pub runtime_types::polkadot_runtime_parachains::disputes::DisputeResult, - ); - impl ::subxt::Event for DisputeConcluded { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeConcluded"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A dispute has timed out due to insufficient participation."] - #[doc = "`\\[para id, candidate hash\\]`"] - pub struct DisputeTimedOut(pub runtime_types::polkadot_core_primitives::CandidateHash); - impl ::subxt::Event for DisputeTimedOut { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "DisputeTimedOut"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - #[doc = "A dispute has concluded with supermajority against a candidate."] - #[doc = "Block authors should no longer build on top of this head and should"] - #[doc = "instead revert the block at the given height. This should be the"] - #[doc = "number of the child of the last known valid block in the chain."] - pub struct Revert(pub ::core::primitive::u32); - impl ::subxt::Event for Revert { - const PALLET: &'static str = "ParasDisputes"; - const EVENT: &'static str = "Revert"; - } - } - pub mod storage { - use super::runtime_types; - pub struct LastPrunedSession; - impl ::subxt::StorageEntry for LastPrunedSession { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "LastPrunedSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Disputes<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::polkadot_core_primitives::CandidateHash, - ); - impl ::subxt::StorageEntry for Disputes<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Disputes"; - type Value = - runtime_types::polkadot_primitives::v2::DisputeState<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Included<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::polkadot_core_primitives::CandidateHash, - ); - impl ::subxt::StorageEntry for Included<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Included"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct SpamSlots<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for SpamSlots<'_> { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "SpamSlots"; - type Value = ::std::vec::Vec<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Frozen; - impl ::subxt::StorageEntry for Frozen { - const PALLET: &'static str = "ParasDisputes"; - const STORAGE: &'static str = "Frozen"; - type Value = ::core::option::Option<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The last pruned session, if any. All data stored by this module"] - #[doc = " references sessions."] - pub async fn last_pruned_session( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 125u8, 138u8, 99u8, 242u8, 9u8, 246u8, 215u8, 246u8, 141u8, 6u8, 129u8, - 87u8, 27u8, 58u8, 53u8, 121u8, 61u8, 119u8, 35u8, 104u8, 33u8, 43u8, - 179u8, 82u8, 244u8, 121u8, 174u8, 135u8, 87u8, 119u8, 236u8, 105u8, - ] - { - let entry = LastPrunedSession; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub async fn disputes( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::polkadot_core_primitives::CandidateHash, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::DisputeState< - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 37u8, 50u8, 243u8, 127u8, 8u8, 137u8, 232u8, 140u8, 200u8, 76u8, 211u8, - 245u8, 26u8, 63u8, 113u8, 31u8, 169u8, 92u8, 165u8, 143u8, 11u8, 29u8, - 2u8, 25u8, 55u8, 250u8, 173u8, 237u8, 153u8, 4u8, 235u8, 10u8, - ] - { - let entry = Disputes(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All ongoing or concluded disputes for the last several sessions."] - pub async fn disputes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Disputes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 37u8, 50u8, 243u8, 127u8, 8u8, 137u8, 232u8, 140u8, 200u8, 76u8, 211u8, - 245u8, 26u8, 63u8, 113u8, 31u8, 169u8, 92u8, 165u8, 143u8, 11u8, 29u8, - 2u8, 25u8, 55u8, 250u8, 173u8, 237u8, 153u8, 4u8, 235u8, 10u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn included( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::polkadot_core_primitives::CandidateHash, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 32u8, 107u8, 8u8, 112u8, 201u8, 81u8, 66u8, 223u8, 120u8, 51u8, 166u8, - 240u8, 229u8, 141u8, 231u8, 132u8, 114u8, 36u8, 213u8, 48u8, 249u8, - 153u8, 143u8, 157u8, 93u8, 204u8, 207u8, 144u8, 52u8, 36u8, 46u8, 12u8, - ] - { - let entry = Included(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn included_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Included<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 32u8, 107u8, 8u8, 112u8, 201u8, 81u8, 66u8, 223u8, 120u8, 51u8, 166u8, - 240u8, 229u8, 141u8, 231u8, 132u8, 114u8, 36u8, 213u8, 48u8, 249u8, - 153u8, 143u8, 157u8, 93u8, 204u8, 207u8, 144u8, 52u8, 36u8, 46u8, 12u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] - #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] - #[doc = " fewer than `byzantine_threshold + 1` validators."] - #[doc = ""] - #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] - pub async fn spam_slots( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u32>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 172u8, 23u8, 120u8, 188u8, 71u8, 248u8, 252u8, 41u8, 132u8, 221u8, - 98u8, 215u8, 33u8, 242u8, 168u8, 196u8, 90u8, 123u8, 190u8, 27u8, - 147u8, 6u8, 196u8, 175u8, 198u8, 216u8, 50u8, 74u8, 138u8, 122u8, - 251u8, 238u8, - ] - { - let entry = SpamSlots(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maps session indices to a vector indicating the number of potentially-spam disputes"] - #[doc = " each validator is participating in. Potentially-spam disputes are remote disputes which have"] - #[doc = " fewer than `byzantine_threshold + 1` validators."] - #[doc = ""] - #[doc = " The i'th entry of the vector corresponds to the i'th validator in the session."] - pub async fn spam_slots_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SpamSlots<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 172u8, 23u8, 120u8, 188u8, 71u8, 248u8, 252u8, 41u8, 132u8, 221u8, - 98u8, 215u8, 33u8, 242u8, 168u8, 196u8, 90u8, 123u8, 190u8, 27u8, - 147u8, 6u8, 196u8, 175u8, 198u8, 216u8, 50u8, 74u8, 138u8, 122u8, - 251u8, 238u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Whether the chain is frozen. Starts as `None`. When this is `Some`,"] - #[doc = " the chain will not accept any new parachain blocks for backing or inclusion,"] - #[doc = " and its value indicates the last valid block number in the chain."] - #[doc = " It can only be set back to `None` by governance intervention."] - pub async fn frozen( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 133u8, 100u8, 86u8, 220u8, 180u8, 189u8, 65u8, 131u8, 64u8, 56u8, - 219u8, 47u8, 130u8, 167u8, 210u8, 125u8, 49u8, 7u8, 153u8, 254u8, 20u8, - 53u8, 218u8, 177u8, 122u8, 148u8, 16u8, 198u8, 251u8, 50u8, 194u8, - 128u8, - ] - { - let entry = Frozen; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod registrar { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Register { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - pub validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for Register { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "register"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceRegister { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - pub validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - } - impl ::subxt::Call for ForceRegister { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "force_register"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Deregister { - pub id: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Deregister { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "deregister"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Swap { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub other: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Swap { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "swap"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceRemoveLock { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for ForceRemoveLock { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "force_remove_lock"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Reserve; - impl ::subxt::Call for Reserve { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "reserve"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Register head data and validation code for a reserved Para Id."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin."] - #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] - #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] - #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] - #[doc = "reserved previously for this para ID is accounted for."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Registered` event is emitted in case of success."] - pub fn register( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Register, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 180u8, 21u8, 142u8, 73u8, 21u8, 31u8, 64u8, 210u8, 196u8, 4u8, 142u8, - 153u8, 172u8, 207u8, 95u8, 209u8, 177u8, 75u8, 202u8, 85u8, 95u8, - 208u8, 123u8, 237u8, 190u8, 148u8, 5u8, 64u8, 65u8, 191u8, 221u8, - 203u8, - ] - { - let call = Register { - id, - genesis_head, - validation_code, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Force the registration of a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function must be called by a Root origin."] - #[doc = ""] - #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] - #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] - pub fn force_register( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceRegister, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 191u8, 198u8, 172u8, 68u8, 118u8, 126u8, 110u8, 47u8, 193u8, 147u8, - 61u8, 27u8, 122u8, 107u8, 49u8, 222u8, 87u8, 199u8, 184u8, 247u8, - 153u8, 137u8, 205u8, 153u8, 6u8, 15u8, 246u8, 8u8, 36u8, 76u8, 54u8, - 63u8, - ] - { - let call = ForceRegister { - who, - deposit, - id, - genesis_head, - validation_code, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] - #[doc = ""] - #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] - pub fn deregister( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Deregister, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 147u8, 4u8, 172u8, 215u8, 67u8, 142u8, 93u8, 245u8, 108u8, 83u8, 5u8, - 250u8, 87u8, 138u8, 231u8, 10u8, 159u8, 216u8, 85u8, 233u8, 244u8, - 200u8, 37u8, 33u8, 160u8, 143u8, 119u8, 11u8, 70u8, 177u8, 8u8, 123u8, - ] - { - let call = Deregister { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Swap a parachain with another parachain or parathread."] - #[doc = ""] - #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] - #[doc = ""] - #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] - #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] - #[doc = ""] - #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] - #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] - #[doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] - #[doc = "and the auction deposit are switched."] - pub fn swap( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - other: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Swap, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 145u8, 163u8, 246u8, 239u8, 241u8, 209u8, 58u8, 241u8, 63u8, 134u8, - 102u8, 55u8, 217u8, 125u8, 176u8, 91u8, 27u8, 32u8, 220u8, 236u8, 18u8, - 20u8, 7u8, 187u8, 100u8, 116u8, 161u8, 133u8, 127u8, 187u8, 86u8, - 109u8, - ] - { - let call = Swap { id, other }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a manager lock from a para. This will allow the manager of a"] - #[doc = "previously locked para to deregister or swap a para without using governance."] - #[doc = ""] - #[doc = "Can only be called by the Root origin."] - pub fn force_remove_lock( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceRemoveLock, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 205u8, 174u8, 132u8, 188u8, 1u8, 59u8, 82u8, 135u8, 123u8, 55u8, 144u8, - 39u8, 205u8, 171u8, 13u8, 252u8, 65u8, 56u8, 98u8, 216u8, 23u8, 175u8, - 16u8, 200u8, 198u8, 252u8, 133u8, 238u8, 81u8, 142u8, 254u8, 124u8, - ] - { - let call = ForceRemoveLock { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Reserve a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] - #[doc = "The origin account is able to register head data and validation code using `register` to create"] - #[doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] - pub fn reserve( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Reserve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 22u8, 210u8, 13u8, 54u8, 253u8, 13u8, 89u8, 174u8, 232u8, 119u8, 148u8, - 206u8, 130u8, 133u8, 199u8, 127u8, 201u8, 205u8, 8u8, 213u8, 108u8, - 93u8, 135u8, 88u8, 238u8, 171u8, 31u8, 193u8, 23u8, 113u8, 106u8, - 135u8, - ] - { - let call = Reserve {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Registered( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Registered { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Registered"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Deregistered(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for Deregistered { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Deregistered"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Reserved( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Reserved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PendingSwap<'a>(pub &'a runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::StorageEntry for PendingSwap<'_> { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "PendingSwap"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Paras<'a>(pub &'a runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::StorageEntry for Paras<'_> { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "Paras"; - type Value = runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NextFreeParaId; - impl ::subxt::StorageEntry for NextFreeParaId { - const PALLET: &'static str = "Registrar"; - const STORAGE: &'static str = "NextFreeParaId"; - type Value = runtime_types::polkadot_parachain::primitives::Id; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Pending swap operations."] - pub async fn pending_swap( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 130u8, 4u8, 116u8, 91u8, 196u8, 41u8, 66u8, 48u8, 17u8, 2u8, 255u8, - 189u8, 132u8, 10u8, 129u8, 102u8, 117u8, 56u8, 114u8, 231u8, 78u8, - 112u8, 11u8, 76u8, 152u8, 41u8, 70u8, 232u8, 212u8, 71u8, 193u8, 107u8, - ] - { - let entry = PendingSwap(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Pending swap operations."] - pub async fn pending_swap_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PendingSwap<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 130u8, 4u8, 116u8, 91u8, 196u8, 41u8, 66u8, 48u8, 17u8, 2u8, 255u8, - 189u8, 132u8, 10u8, 129u8, 102u8, 117u8, 56u8, 114u8, 231u8, 78u8, - 112u8, 11u8, 76u8, 152u8, 41u8, 70u8, 232u8, 212u8, 71u8, 193u8, 107u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 only do"] - #[doc = " so if it isn't yet registered. (After that, it's up to governance to do so.)"] - pub async fn paras( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 180u8, 146u8, 122u8, 242u8, 222u8, 203u8, 19u8, 110u8, 22u8, 53u8, - 147u8, 127u8, 165u8, 158u8, 113u8, 196u8, 105u8, 209u8, 45u8, 250u8, - 163u8, 78u8, 120u8, 129u8, 180u8, 128u8, 63u8, 195u8, 71u8, 176u8, - 247u8, 206u8, - ] - { - let entry = Paras(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 only do"] - #[doc = " so if it isn't yet registered. (After that, it's up to governance to do so.)"] - pub async fn paras_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Paras<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 180u8, 146u8, 122u8, 242u8, 222u8, 203u8, 19u8, 110u8, 22u8, 53u8, - 147u8, 127u8, 165u8, 158u8, 113u8, 196u8, 105u8, 209u8, 45u8, 250u8, - 163u8, 78u8, 120u8, 129u8, 180u8, 128u8, 63u8, 195u8, 71u8, 176u8, - 247u8, 206u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The next free `ParaId`."] - pub async fn next_free_para_id( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 112u8, 52u8, 84u8, 181u8, 132u8, 61u8, 46u8, 69u8, 165u8, 85u8, 253u8, - 243u8, 228u8, 151u8, 15u8, 239u8, 172u8, 28u8, 102u8, 38u8, 155u8, - 90u8, 55u8, 162u8, 254u8, 139u8, 59u8, 186u8, 152u8, 239u8, 53u8, - 216u8, - ] - { - let entry = NextFreeParaId; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The deposit to be paid to run a parathread."] - #[doc = " This should include the cost for storing the genesis head and validation code."] - pub fn para_deposit( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Registrar", "ParaDeposit")? - == [ - 177u8, 138u8, 242u8, 166u8, 12u8, 97u8, 93u8, 2u8, 123u8, 45u8, 85u8, - 25u8, 46u8, 14u8, 221u8, 50u8, 157u8, 45u8, 243u8, 106u8, 171u8, 191u8, - 36u8, 192u8, 126u8, 91u8, 2u8, 240u8, 187u8, 201u8, 39u8, 110u8, - ] - { - let pallet = locked_metadata.pallet("Registrar")?; - let constant = pallet.constant("ParaDeposit")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The deposit to be paid per byte stored on chain."] - pub fn data_deposit_per_byte( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Registrar", "DataDepositPerByte")? - == [ - 75u8, 45u8, 63u8, 192u8, 73u8, 118u8, 130u8, 12u8, 38u8, 42u8, 196u8, - 189u8, 156u8, 218u8, 152u8, 165u8, 124u8, 253u8, 108u8, 113u8, 3u8, - 149u8, 83u8, 27u8, 234u8, 163u8, 225u8, 231u8, 179u8, 212u8, 26u8, - 156u8, - ] - { - let pallet = locked_metadata.pallet("Registrar")?; - let constant = pallet.constant("DataDepositPerByte")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod auctions { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct NewAuction { - #[codec(compact)] - pub duration: ::core::primitive::u32, - #[codec(compact)] - pub lease_period_index: ::core::primitive::u32, - } - impl ::subxt::Call for NewAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "new_auction"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Bid { - #[codec(compact)] - pub para: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub auction_index: ::core::primitive::u32, - #[codec(compact)] - pub first_slot: ::core::primitive::u32, - #[codec(compact)] - pub last_slot: ::core::primitive::u32, - #[codec(compact)] - pub amount: ::core::primitive::u128, - } - impl ::subxt::Call for Bid { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "bid"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CancelAuction; - impl ::subxt::Call for CancelAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "cancel_auction"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Create a new auction."] - #[doc = ""] - #[doc = "This can only happen when there isn't already an auction in progress and may only be"] - #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] - #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] - pub fn new_auction( - &self, - duration: ::core::primitive::u32, - lease_period_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - NewAuction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 12u8, 43u8, 152u8, 0u8, 229u8, 15u8, 32u8, 205u8, 208u8, 71u8, 57u8, - 169u8, 201u8, 177u8, 52u8, 10u8, 93u8, 183u8, 5u8, 156u8, 231u8, 188u8, - 77u8, 238u8, 119u8, 238u8, 87u8, 251u8, 121u8, 199u8, 18u8, 129u8, - ] - { - let call = NewAuction { - duration, - lease_period_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] - #[doc = "parachain."] - #[doc = ""] - #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] - #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] - #[doc = ""] - #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] - #[doc = "funded by) the same account."] - #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] - #[doc = "value of `AuctionCounter`."] - #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] - #[doc = "bid win. This amount is held throughout the range."] - pub fn bid( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - auction_index: ::core::primitive::u32, - first_slot: ::core::primitive::u32, - last_slot: ::core::primitive::u32, - amount: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Bid, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 206u8, 22u8, 15u8, 251u8, 222u8, 193u8, 192u8, 125u8, 160u8, 131u8, - 209u8, 129u8, 105u8, 46u8, 77u8, 204u8, 107u8, 112u8, 13u8, 188u8, - 193u8, 73u8, 225u8, 232u8, 179u8, 205u8, 39u8, 69u8, 242u8, 79u8, 36u8, - 121u8, - ] - { - let call = Bid { - para, - auction_index, - first_slot, - last_slot, - amount, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel an in-progress auction."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub fn cancel_auction( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelAuction, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 182u8, 223u8, 178u8, 136u8, 1u8, 115u8, 229u8, 78u8, 166u8, 128u8, - 28u8, 106u8, 6u8, 248u8, 46u8, 55u8, 110u8, 120u8, 213u8, 11u8, 90u8, - 217u8, 42u8, 120u8, 47u8, 83u8, 126u8, 216u8, 236u8, 251u8, 255u8, - 50u8, - ] - { - let call = CancelAuction {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An auction started. Provides its index and the block number where it will begin to"] - #[doc = "close and the first lease period of the quadruplet that is auctioned."] - #[doc = "`[auction_index, lease_period, ending]`"] - pub struct AuctionStarted( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for AuctionStarted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionStarted"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] - pub struct AuctionClosed(pub ::core::primitive::u32); - impl ::subxt::Event for AuctionClosed { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionClosed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] - #[doc = "Second is the total. `[bidder, extra_reserved, total_amount]`"] - pub struct Reserved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Reserved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] - pub struct Unreserved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Unreserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Unreserved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Someone attempted to lease the same slot twice for a parachain. The amount is held in reserve"] - #[doc = "but no parachain slot has been leased."] - #[doc = "`[parachain_id, leaser, amount]`"] - pub struct ReserveConfiscated( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for ReserveConfiscated { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "ReserveConfiscated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A new bid has been accepted as the current winner."] - #[doc = "`[who, para_id, amount, first_slot, last_slot]`"] - pub struct BidAccepted( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u128, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for BidAccepted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "BidAccepted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The winning offset was chosen for an auction. This will map into the `Winning` storage map."] - #[doc = "`[auction_index, block_number]`"] - pub struct WinningOffset(pub ::core::primitive::u32, pub ::core::primitive::u32); - impl ::subxt::Event for WinningOffset { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "WinningOffset"; - } - } - pub mod storage { - use super::runtime_types; - pub struct AuctionCounter; - impl ::subxt::StorageEntry for AuctionCounter { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "AuctionCounter"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct AuctionInfo; - impl ::subxt::StorageEntry for AuctionInfo { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "AuctionInfo"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReservedAmounts<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for ReservedAmounts<'_> { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "ReservedAmounts"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &(&self.0, &self.1), - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Winning<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Winning<'_> { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "Winning"; - type Value = [::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - )>; 36usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Number of auctions started so far."] - pub async fn auction_counter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 67u8, 247u8, 96u8, 152u8, 0u8, 224u8, 230u8, 98u8, 194u8, 107u8, 3u8, - 203u8, 51u8, 201u8, 149u8, 22u8, 184u8, 80u8, 251u8, 239u8, 253u8, - 19u8, 58u8, 192u8, 65u8, 96u8, 189u8, 54u8, 175u8, 130u8, 143u8, 181u8, - ] - { - let entry = AuctionCounter; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Information relating to the current auction, if there is one."] - #[doc = ""] - #[doc = " The first item in the tuple is the lease period index that the first of the four"] - #[doc = " contiguous lease periods on auction is for. The second is the block number when the"] - #[doc = " auction will \"begin to end\", i.e. the first block of the Ending Period of the auction."] - pub async fn auction_info( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 73u8, 216u8, 173u8, 230u8, 132u8, 78u8, 83u8, 62u8, 200u8, 69u8, 17u8, - 73u8, 57u8, 107u8, 160u8, 90u8, 147u8, 84u8, 29u8, 110u8, 144u8, 215u8, - 169u8, 110u8, 217u8, 77u8, 109u8, 204u8, 1u8, 164u8, 95u8, 83u8, - ] - { - let entry = AuctionInfo; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Amounts currently reserved in the accounts of the bidders currently winning"] - #[doc = " (sub-)ranges."] - pub async fn reserved_amounts( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - _1: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 195u8, 56u8, 142u8, 154u8, 193u8, 115u8, 13u8, 64u8, 101u8, 179u8, - 69u8, 175u8, 185u8, 12u8, 31u8, 65u8, 147u8, 211u8, 74u8, 40u8, 190u8, - 254u8, 190u8, 176u8, 117u8, 159u8, 234u8, 214u8, 157u8, 83u8, 56u8, - 192u8, - ] - { - let entry = ReservedAmounts(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Amounts currently reserved in the accounts of the bidders currently winning"] - #[doc = " (sub-)ranges."] - pub async fn reserved_amounts_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReservedAmounts<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 195u8, 56u8, 142u8, 154u8, 193u8, 115u8, 13u8, 64u8, 101u8, 179u8, - 69u8, 175u8, 185u8, 12u8, 31u8, 65u8, 147u8, 211u8, 74u8, 40u8, 190u8, - 254u8, 190u8, 176u8, 117u8, 159u8, 234u8, 214u8, 157u8, 83u8, 56u8, - 192u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn winning( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - [::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - )>; 36usize], - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 152u8, 246u8, 158u8, 193u8, 21u8, 56u8, 204u8, 29u8, 146u8, 90u8, - 133u8, 246u8, 75u8, 111u8, 157u8, 150u8, 175u8, 33u8, 127u8, 215u8, - 158u8, 55u8, 231u8, 78u8, 143u8, 128u8, 92u8, 70u8, 61u8, 23u8, 43u8, - 68u8, - ] - { - let entry = Winning(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn winning_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Winning<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 152u8, 246u8, 158u8, 193u8, 21u8, 56u8, 204u8, 29u8, 146u8, 90u8, - 133u8, 246u8, 75u8, 111u8, 157u8, 150u8, 175u8, 33u8, 127u8, 215u8, - 158u8, 55u8, 231u8, 78u8, 143u8, 128u8, 92u8, 70u8, 61u8, 23u8, 43u8, - 68u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of blocks over which an auction may be retroactively ended."] - pub fn ending_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Auctions", "EndingPeriod")? - == [ - 41u8, 212u8, 17u8, 243u8, 76u8, 205u8, 95u8, 195u8, 181u8, 1u8, 59u8, - 31u8, 204u8, 20u8, 83u8, 117u8, 69u8, 25u8, 74u8, 59u8, 18u8, 11u8, - 110u8, 123u8, 62u8, 254u8, 188u8, 62u8, 89u8, 80u8, 213u8, 97u8, - ] - { - let pallet = locked_metadata.pallet("Auctions")?; - let constant = pallet.constant("EndingPeriod")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The length of each sample to take during the ending period."] - #[doc = ""] - #[doc = " `EndingPeriod` / `SampleLength` = Total # of Samples"] - pub fn sample_length( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Auctions", "SampleLength")? - == [ - 120u8, 204u8, 79u8, 231u8, 92u8, 177u8, 250u8, 183u8, 207u8, 218u8, - 171u8, 81u8, 94u8, 92u8, 233u8, 87u8, 74u8, 212u8, 178u8, 104u8, 137u8, - 187u8, 31u8, 163u8, 157u8, 136u8, 111u8, 129u8, 149u8, 85u8, 122u8, - 181u8, - ] - { - let pallet = locked_metadata.pallet("Auctions")?; - let constant = pallet.constant("SampleLength")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub fn slot_range_count( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Auctions", "SlotRangeCount")? - == [ - 32u8, 147u8, 38u8, 54u8, 172u8, 189u8, 240u8, 136u8, 216u8, 182u8, - 191u8, 129u8, 122u8, 1u8, 129u8, 244u8, 180u8, 210u8, 219u8, 142u8, - 224u8, 151u8, 237u8, 192u8, 103u8, 206u8, 101u8, 131u8, 78u8, 181u8, - 163u8, 44u8, - ] - { - let pallet = locked_metadata.pallet("Auctions")?; - let constant = pallet.constant("SlotRangeCount")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub fn lease_periods_per_slot( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Auctions", "LeasePeriodsPerSlot")? - == [ - 174u8, 18u8, 150u8, 44u8, 219u8, 36u8, 218u8, 28u8, 34u8, 132u8, 235u8, - 161u8, 23u8, 173u8, 80u8, 175u8, 93u8, 163u8, 6u8, 226u8, 11u8, 212u8, - 186u8, 119u8, 185u8, 85u8, 111u8, 216u8, 214u8, 111u8, 148u8, 28u8, - ] - { - let pallet = locked_metadata.pallet("Auctions")?; - let constant = pallet.constant("LeasePeriodsPerSlot")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod crowdloan { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Create { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub cap: ::core::primitive::u128, - #[codec(compact)] - pub first_period: ::core::primitive::u32, - #[codec(compact)] - pub last_period: ::core::primitive::u32, - #[codec(compact)] - pub end: ::core::primitive::u32, - pub verifier: ::core::option::Option, - } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "create"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Contribute { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub value: ::core::primitive::u128, - pub signature: ::core::option::Option, - } - impl ::subxt::Call for Contribute { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "contribute"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Withdraw { - pub who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Withdraw { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "withdraw"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Refund { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Refund { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "refund"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Dissolve { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Dissolve { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "dissolve"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Edit { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub cap: ::core::primitive::u128, - #[codec(compact)] - pub first_period: ::core::primitive::u32, - #[codec(compact)] - pub last_period: ::core::primitive::u32, - #[codec(compact)] - pub end: ::core::primitive::u32, - pub verifier: ::core::option::Option, - } - impl ::subxt::Call for Edit { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "edit"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AddMemo { - pub index: runtime_types::polkadot_parachain::primitives::Id, - pub memo: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for AddMemo { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "add_memo"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Poke { - pub index: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for Poke { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "poke"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ContributeAll { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - pub signature: ::core::option::Option, - } - impl ::subxt::Call for ContributeAll { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "contribute_all"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] - #[doc = ""] - #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] - #[doc = "by the parachain manager."] - pub fn create( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - cap: ::core::primitive::u128, - first_period: ::core::primitive::u32, - last_period: ::core::primitive::u32, - end: ::core::primitive::u32, - verifier: ::core::option::Option, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Create, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 94u8, 115u8, 154u8, 239u8, 215u8, 180u8, 175u8, 240u8, 137u8, 240u8, - 74u8, 159u8, 67u8, 54u8, 69u8, 199u8, 161u8, 155u8, 243u8, 222u8, - 205u8, 163u8, 142u8, 251u8, 156u8, 94u8, 65u8, 153u8, 39u8, 226u8, - 79u8, 195u8, - ] - { - let call = Create { - index, - cap, - first_period, - last_period, - end, - verifier, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - pub fn contribute( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - value: ::core::primitive::u128, - signature: ::core::option::Option, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Contribute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 95u8, 255u8, 35u8, 30u8, 44u8, 150u8, 10u8, 166u8, 0u8, 204u8, 106u8, - 59u8, 150u8, 254u8, 216u8, 128u8, 232u8, 129u8, 30u8, 101u8, 196u8, - 198u8, 180u8, 156u8, 122u8, 252u8, 139u8, 28u8, 164u8, 115u8, 153u8, - 109u8, - ] - { - let call = Contribute { - index, - value, - signature, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Withdraw full balance of a specific contributor."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - #[doc = ""] - #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement, then the retirement"] - #[doc = "flag must be set. For a fund to be ready for retirement, then:"] - #[doc = "- it must not already be in retirement;"] - #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] - #[doc = "- and either:"] - #[doc = " - the block number must be at least `end`; or"] - #[doc = " - the current lease period must be greater than the fund's `last_period`."] - #[doc = ""] - #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current block"] - #[doc = "number."] - #[doc = ""] - #[doc = "- `who`: The account whose contribution should be withdrawn."] - #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] - pub fn withdraw( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Withdraw, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 67u8, 65u8, 89u8, 108u8, 193u8, 99u8, 74u8, 32u8, 163u8, 13u8, 81u8, - 131u8, 64u8, 107u8, 72u8, 23u8, 35u8, 177u8, 130u8, 171u8, 70u8, 232u8, - 246u8, 254u8, 67u8, 219u8, 84u8, 96u8, 165u8, 20u8, 183u8, 209u8, - ] - { - let call = Withdraw { who, index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Automatically refund contributors of an ended crowdloan."] - #[doc = "Due to weight restrictions, this function may need to be called multiple"] - #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - pub fn refund( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Refund, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 202u8, 206u8, 79u8, 226u8, 114u8, 228u8, 110u8, 18u8, 178u8, 173u8, - 23u8, 83u8, 64u8, 11u8, 201u8, 19u8, 57u8, 75u8, 181u8, 241u8, 231u8, - 189u8, 211u8, 48u8, 82u8, 64u8, 220u8, 22u8, 247u8, 7u8, 68u8, 211u8, - ] - { - let call = Refund { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] - pub fn dissolve( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Dissolve, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 210u8, 3u8, 221u8, 185u8, 64u8, 178u8, 56u8, 132u8, 72u8, 127u8, 105u8, - 31u8, 167u8, 107u8, 127u8, 224u8, 174u8, 221u8, 111u8, 105u8, 47u8, - 247u8, 10u8, 5u8, 37u8, 180u8, 61u8, 180u8, 3u8, 164u8, 196u8, 194u8, - ] - { - let call = Dissolve { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Edit the configuration for an in-progress crowdloan."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - pub fn edit( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - cap: ::core::primitive::u128, - first_period: ::core::primitive::u32, - last_period: ::core::primitive::u32, - end: ::core::primitive::u32, - verifier: ::core::option::Option, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Edit, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 34u8, 43u8, 47u8, 39u8, 106u8, 245u8, 49u8, 40u8, 191u8, 195u8, 202u8, - 113u8, 137u8, 98u8, 143u8, 172u8, 191u8, 55u8, 240u8, 75u8, 234u8, - 180u8, 90u8, 206u8, 93u8, 214u8, 115u8, 215u8, 140u8, 144u8, 105u8, - 89u8, - ] - { - let call = Edit { - index, - cap, - first_period, - last_period, - end, - verifier, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add an optional memo to an existing crowdloan contribution."] - #[doc = ""] - #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] - pub fn add_memo( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - memo: ::std::vec::Vec<::core::primitive::u8>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddMemo, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 97u8, 218u8, 115u8, 187u8, 167u8, 70u8, 229u8, 231u8, 148u8, 77u8, - 169u8, 139u8, 16u8, 15u8, 116u8, 128u8, 32u8, 59u8, 154u8, 146u8, 12u8, - 65u8, 36u8, 36u8, 69u8, 19u8, 74u8, 79u8, 66u8, 25u8, 215u8, 57u8, - ] - { - let call = AddMemo { index, memo }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Poke the fund into `NewRaise`"] - #[doc = ""] - #[doc = "Origin must be Signed, and the fund has non-zero raise."] - pub fn poke( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Poke, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 99u8, 158u8, 48u8, 3u8, 228u8, 210u8, 249u8, 42u8, 44u8, 49u8, 24u8, - 212u8, 69u8, 69u8, 189u8, 194u8, 124u8, 251u8, 25u8, 123u8, 234u8, 3u8, - 184u8, 227u8, 1u8, 195u8, 219u8, 118u8, 235u8, 237u8, 11u8, 159u8, - ] - { - let call = Poke { index }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - pub fn contribute_all( - &self, - index: runtime_types::polkadot_parachain::primitives::Id, - signature: ::core::option::Option, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ContributeAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 64u8, 224u8, 233u8, 196u8, 182u8, 109u8, 69u8, 220u8, 46u8, 60u8, - 189u8, 125u8, 17u8, 28u8, 207u8, 63u8, 129u8, 56u8, 32u8, 239u8, 182u8, - 214u8, 237u8, 95u8, 228u8, 171u8, 209u8, 233u8, 205u8, 212u8, 147u8, - 176u8, - ] - { - let call = ContributeAll { index, signature }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] - pub struct Created(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for Created { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Created"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Contributed to a crowd sale. `[who, fund_index, amount]`"] - pub struct Contributed( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Contributed { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Contributed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Withdrew full balance of a contributor. `[who, fund_index, amount]`"] - pub struct Withdrew( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Withdrew { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Withdrew"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The loans in a fund have been partially dissolved, i.e. there are some left"] - #[doc = "over child keys that still need to be killed. `[fund_index]`"] - pub struct PartiallyRefunded(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for PartiallyRefunded { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "PartiallyRefunded"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "All loans in a fund have been refunded. `[fund_index]`"] - pub struct AllRefunded(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for AllRefunded { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "AllRefunded"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Fund is dissolved. `[fund_index]`"] - pub struct Dissolved(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for Dissolved { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Dissolved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The result of trying to submit a new bid to the Slots pallet."] - pub struct HandleBidResult( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for HandleBidResult { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "HandleBidResult"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The configuration to a crowdloan has been edited. `[fund_index]`"] - pub struct Edited(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for Edited { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Edited"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A memo has been updated. `[who, fund_index, memo]`"] - pub struct MemoUpdated( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::std::vec::Vec<::core::primitive::u8>, - ); - impl ::subxt::Event for MemoUpdated { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "MemoUpdated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A parachain has been moved to `NewRaise`"] - pub struct AddedToNewRaise(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for AddedToNewRaise { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "AddedToNewRaise"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Funds<'a>(pub &'a runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::StorageEntry for Funds<'_> { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "Funds"; - type Value = runtime_types::polkadot_runtime_common::crowdloan::FundInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct NewRaise; - impl ::subxt::StorageEntry for NewRaise { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NewRaise"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EndingsCount; - impl ::subxt::StorageEntry for EndingsCount { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "EndingsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextFundIndex; - impl ::subxt::StorageEntry for NextFundIndex { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NextFundIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Info on all of the funds."] - pub async fn funds( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::crowdloan::FundInfo< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 13u8, 211u8, 240u8, 138u8, 231u8, 78u8, 123u8, 252u8, 210u8, 27u8, - 202u8, 82u8, 157u8, 118u8, 209u8, 218u8, 160u8, 183u8, 225u8, 77u8, - 230u8, 131u8, 180u8, 238u8, 83u8, 202u8, 29u8, 106u8, 114u8, 223u8, - 250u8, 3u8, - ] - { - let entry = Funds(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Info on all of the funds."] - pub async fn funds_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Funds<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 13u8, 211u8, 240u8, 138u8, 231u8, 78u8, 123u8, 252u8, 210u8, 27u8, - 202u8, 82u8, 157u8, 118u8, 209u8, 218u8, 160u8, 183u8, 225u8, 77u8, - 230u8, 131u8, 180u8, 238u8, 83u8, 202u8, 29u8, 106u8, 114u8, 223u8, - 250u8, 3u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The funds that have had additional contributions during the last block. This is used"] - #[doc = " in order to determine which funds should submit new or updated bids."] - pub async fn new_raise( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 243u8, 204u8, 121u8, 230u8, 151u8, 223u8, 248u8, 199u8, 68u8, 209u8, - 226u8, 159u8, 217u8, 105u8, 39u8, 127u8, 162u8, 133u8, 56u8, 1u8, 70u8, - 7u8, 176u8, 56u8, 81u8, 49u8, 155u8, 143u8, 100u8, 153u8, 59u8, 86u8, - ] - { - let entry = NewRaise; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of auctions that have entered into their ending period so far."] - pub async fn endings_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 12u8, 159u8, 166u8, 75u8, 192u8, 33u8, 21u8, 244u8, 149u8, 200u8, 49u8, - 54u8, 191u8, 174u8, 202u8, 86u8, 76u8, 115u8, 189u8, 35u8, 192u8, - 175u8, 156u8, 188u8, 41u8, 23u8, 92u8, 36u8, 141u8, 235u8, 248u8, - 143u8, - ] - { - let entry = EndingsCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Tracker for the next available fund index"] - pub async fn next_fund_index( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 1u8, 215u8, 164u8, 194u8, 231u8, 34u8, 207u8, 19u8, 149u8, 187u8, 3u8, - 176u8, 194u8, 240u8, 180u8, 169u8, 214u8, 194u8, 202u8, 240u8, 209u8, - 6u8, 244u8, 46u8, 54u8, 142u8, 61u8, 220u8, 240u8, 96u8, 10u8, 168u8, - ] - { - let entry = NextFundIndex; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b\"py/cfund\")`"] - pub fn pallet_id( - &self, - ) -> ::core::result::Result< - runtime_types::frame_support::PalletId, - ::subxt::BasicError, - > { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Crowdloan", "PalletId")? - == [ - 190u8, 62u8, 112u8, 88u8, 48u8, 222u8, 234u8, 76u8, 230u8, 81u8, 205u8, - 113u8, 202u8, 11u8, 184u8, 229u8, 189u8, 124u8, 132u8, 255u8, 46u8, - 202u8, 80u8, 86u8, 182u8, 212u8, 149u8, 200u8, 57u8, 215u8, 195u8, - 132u8, - ] - { - let pallet = locked_metadata.pallet("Crowdloan")?; - let constant = pallet.constant("PalletId")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The minimum amount that may be contributed into a crowdloan. Should almost certainly be at"] - #[doc = " least `ExistentialDeposit`."] - pub fn min_contribution( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Crowdloan", "MinContribution")? - == [ - 202u8, 28u8, 7u8, 249u8, 127u8, 100u8, 197u8, 70u8, 224u8, 205u8, 34u8, - 128u8, 198u8, 242u8, 54u8, 124u8, 230u8, 52u8, 142u8, 219u8, 30u8, - 229u8, 65u8, 136u8, 5u8, 244u8, 26u8, 9u8, 162u8, 58u8, 172u8, 141u8, - ] - { - let pallet = locked_metadata.pallet("Crowdloan")?; - let constant = pallet.constant("MinContribution")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Max number of storage keys to remove per extrinsic call."] - pub fn remove_keys_limit( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Crowdloan", "RemoveKeysLimit")? - == [ - 199u8, 136u8, 0u8, 136u8, 48u8, 93u8, 45u8, 100u8, 156u8, 106u8, 111u8, - 137u8, 126u8, 251u8, 185u8, 76u8, 37u8, 112u8, 241u8, 98u8, 237u8, 6u8, - 157u8, 204u8, 211u8, 246u8, 183u8, 101u8, 3u8, 214u8, 44u8, 135u8, - ] - { - let pallet = locked_metadata.pallet("Crowdloan")?; - let constant = pallet.constant("RemoveKeysLimit")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod slots { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceLease { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub leaser: ::subxt::sp_core::crypto::AccountId32, - pub amount: ::core::primitive::u128, - pub period_begin: ::core::primitive::u32, - pub period_count: ::core::primitive::u32, - } - impl ::subxt::Call for ForceLease { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "force_lease"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ClearAllLeases { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for ClearAllLeases { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "clear_all_leases"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct TriggerOnboard { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for TriggerOnboard { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "trigger_onboard"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] - #[doc = "independently of any other on-chain mechanism to use it."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub fn force_lease( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - period_begin: ::core::primitive::u32, - period_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceLease, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 110u8, 205u8, 106u8, 226u8, 3u8, 177u8, 198u8, 116u8, 52u8, 161u8, - 90u8, 240u8, 43u8, 160u8, 144u8, 63u8, 97u8, 231u8, 232u8, 176u8, 92u8, - 253u8, 16u8, 243u8, 187u8, 94u8, 20u8, 114u8, 23u8, 46u8, 231u8, 249u8, - ] - { - let call = ForceLease { - para, - leaser, - amount, - period_begin, - period_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - pub fn clear_all_leases( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearAllLeases, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 101u8, 225u8, 10u8, 139u8, 34u8, 12u8, 48u8, 76u8, 97u8, 178u8, 5u8, - 110u8, 19u8, 3u8, 237u8, 183u8, 54u8, 113u8, 7u8, 138u8, 180u8, 201u8, - 245u8, 151u8, 61u8, 40u8, 69u8, 31u8, 28u8, 172u8, 253u8, 227u8, - ] - { - let call = ClearAllLeases { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Try to onboard a parachain that has a lease for the current lease period."] - #[doc = ""] - #[doc = "This function can be useful if there was some state issue with a para that should"] - #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] - #[doc = "let them onboard from here."] - #[doc = ""] - #[doc = "Origin must be signed, but can be called by anyone."] - pub fn trigger_onboard( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TriggerOnboard, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 85u8, 246u8, 247u8, 252u8, 46u8, 143u8, 200u8, 102u8, 105u8, 51u8, - 148u8, 164u8, 27u8, 25u8, 139u8, 167u8, 150u8, 129u8, 131u8, 187u8, - 153u8, 6u8, 169u8, 153u8, 192u8, 116u8, 130u8, 12u8, 22u8, 199u8, 52u8, - 8u8, - ] - { - let call = TriggerOnboard { para }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - #[doc = "A new `[lease_period]` is beginning."] - pub struct NewLeasePeriod(pub ::core::primitive::u32); - impl ::subxt::Event for NewLeasePeriod { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "NewLeasePeriod"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A para has won the right to a continuous set of lease periods as a parachain."] - #[doc = "First balance is any extra amount reserved on top of the para's existing deposit."] - #[doc = "Second balance is the total amount reserved."] - #[doc = "`[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`"] - pub struct Leased( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::core::primitive::u128, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Leased { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "Leased"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Leases<'a>(pub &'a runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::StorageEntry for Leases<'_> { - const PALLET: &'static str = "Slots"; - const STORAGE: &'static str = "Leases"; - type Value = ::std::vec::Vec< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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 second values"] - #[doc = " 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 async fn leases( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 83u8, 145u8, 119u8, 74u8, 166u8, 90u8, 141u8, 47u8, 125u8, 250u8, - 173u8, 63u8, 193u8, 78u8, 96u8, 119u8, 111u8, 126u8, 83u8, 83u8, 80u8, - 32u8, 43u8, 173u8, 123u8, 126u8, 132u8, 166u8, 252u8, 39u8, 18u8, 39u8, - ] - { - let entry = Leases(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 second values"] - #[doc = " 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 async fn leases_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Leases<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 83u8, 145u8, 119u8, 74u8, 166u8, 90u8, 141u8, 47u8, 125u8, 250u8, - 173u8, 63u8, 193u8, 78u8, 96u8, 119u8, 111u8, 126u8, 83u8, 83u8, 80u8, - 32u8, 43u8, 173u8, 123u8, 126u8, 132u8, 166u8, 252u8, 39u8, 18u8, 39u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of blocks over which a single period lasts."] - pub fn lease_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Slots", "LeasePeriod")? - == [ - 199u8, 146u8, 34u8, 83u8, 56u8, 115u8, 56u8, 28u8, 80u8, 78u8, 80u8, - 106u8, 53u8, 187u8, 228u8, 50u8, 192u8, 147u8, 102u8, 175u8, 145u8, - 103u8, 186u8, 172u8, 235u8, 174u8, 247u8, 121u8, 47u8, 193u8, 44u8, - 60u8, - ] - { - let pallet = locked_metadata.pallet("Slots")?; - let constant = pallet.constant("LeasePeriod")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of blocks to offset each lease period by."] - pub fn lease_offset( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Slots", "LeaseOffset")? - == [ - 236u8, 50u8, 129u8, 231u8, 6u8, 181u8, 238u8, 115u8, 32u8, 62u8, 217u8, - 32u8, 198u8, 36u8, 84u8, 223u8, 239u8, 223u8, 53u8, 13u8, 21u8, 33u8, - 230u8, 17u8, 103u8, 37u8, 154u8, 230u8, 240u8, 143u8, 9u8, 179u8, - ] - { - let pallet = locked_metadata.pallet("Slots")?; - let constant = pallet.constant("LeaseOffset")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod paras_sudo_wrapper { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoScheduleParaInitialize { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub genesis: runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs, - } - impl ::subxt::Call for SudoScheduleParaInitialize { - const PALLET: &'static str = "ParasSudoWrapper"; - const FUNCTION: &'static str = "sudo_schedule_para_initialize"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoScheduleParaCleanup { - pub id: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for SudoScheduleParaCleanup { - const PALLET: &'static str = "ParasSudoWrapper"; - const FUNCTION: &'static str = "sudo_schedule_para_cleanup"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoScheduleParathreadUpgrade { - pub id: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for SudoScheduleParathreadUpgrade { - const PALLET: &'static str = "ParasSudoWrapper"; - const FUNCTION: &'static str = "sudo_schedule_parathread_upgrade"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoScheduleParachainDowngrade { - pub id: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for SudoScheduleParachainDowngrade { - const PALLET: &'static str = "ParasSudoWrapper"; - const FUNCTION: &'static str = "sudo_schedule_parachain_downgrade"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoQueueDownwardXcm { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub xcm: ::std::boxed::Box, - } - impl ::subxt::Call for SudoQueueDownwardXcm { - const PALLET: &'static str = "ParasSudoWrapper"; - const FUNCTION: &'static str = "sudo_queue_downward_xcm"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoEstablishHrmpChannel { - pub sender: runtime_types::polkadot_parachain::primitives::Id, - pub recipient: runtime_types::polkadot_parachain::primitives::Id, - pub max_capacity: ::core::primitive::u32, - pub max_message_size: ::core::primitive::u32, - } - impl ::subxt::Call for SudoEstablishHrmpChannel { - const PALLET: &'static str = "ParasSudoWrapper"; - const FUNCTION: &'static str = "sudo_establish_hrmp_channel"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Schedule a para to be initialized at the start of the next session."] - pub fn sudo_schedule_para_initialize( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis: runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SudoScheduleParaInitialize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 86u8, 164u8, 77u8, 56u8, 96u8, 214u8, 248u8, 7u8, 89u8, 247u8, 201u8, - 39u8, 212u8, 110u8, 252u8, 13u8, 2u8, 157u8, 243u8, 243u8, 22u8, 0u8, - 105u8, 138u8, 14u8, 232u8, 50u8, 121u8, 110u8, 222u8, 86u8, 47u8, - ] - { - let call = SudoScheduleParaInitialize { id, genesis }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Schedule a para to be cleaned up at the start of the next session."] - pub fn sudo_schedule_para_cleanup( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SudoScheduleParaCleanup, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 108u8, 244u8, 138u8, 161u8, 12u8, 207u8, 245u8, 145u8, 139u8, 18u8, - 37u8, 156u8, 86u8, 114u8, 183u8, 19u8, 172u8, 209u8, 127u8, 255u8, - 217u8, 189u8, 24u8, 79u8, 93u8, 121u8, 9u8, 163u8, 84u8, 20u8, 212u8, - 222u8, - ] - { - let call = SudoScheduleParaCleanup { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Upgrade a parathread to a parachain"] - pub fn sudo_schedule_parathread_upgrade( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SudoScheduleParathreadUpgrade, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 169u8, 58u8, 222u8, 27u8, 223u8, 115u8, 47u8, 226u8, 148u8, 82u8, 2u8, - 86u8, 135u8, 202u8, 102u8, 191u8, 40u8, 221u8, 170u8, 13u8, 225u8, - 131u8, 121u8, 27u8, 165u8, 179u8, 175u8, 34u8, 209u8, 115u8, 93u8, - 85u8, - ] - { - let call = SudoScheduleParathreadUpgrade { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Downgrade a parachain to a parathread"] - pub fn sudo_schedule_parachain_downgrade( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SudoScheduleParachainDowngrade, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 183u8, 209u8, 11u8, 52u8, 110u8, 163u8, 61u8, 191u8, 87u8, 84u8, 179u8, - 101u8, 251u8, 145u8, 158u8, 249u8, 48u8, 229u8, 84u8, 247u8, 21u8, 4u8, - 181u8, 104u8, 224u8, 128u8, 126u8, 249u8, 146u8, 158u8, 233u8, 128u8, - ] - { - let call = SudoScheduleParachainDowngrade { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send a downward XCM to the given para."] - #[doc = ""] - #[doc = "The given parachain should exist and the payload should not exceed the preconfigured size"] - #[doc = "`config.max_downward_message_size`."] - pub fn sudo_queue_downward_xcm( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - xcm: runtime_types::xcm::VersionedXcm, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SudoQueueDownwardXcm, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 81u8, 30u8, 40u8, 17u8, 248u8, 225u8, 213u8, 76u8, 11u8, 167u8, 196u8, - 12u8, 113u8, 152u8, 98u8, 196u8, 204u8, 166u8, 103u8, 199u8, 146u8, - 98u8, 73u8, 188u8, 128u8, 100u8, 77u8, 203u8, 103u8, 139u8, 105u8, - 50u8, - ] - { - let call = SudoQueueDownwardXcm { - id, - xcm: ::std::boxed::Box::new(xcm), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Forcefully establish a channel from the sender to the recipient."] - #[doc = ""] - #[doc = "This is equivalent to sending an `Hrmp::hrmp_init_open_channel` extrinsic followed by"] - #[doc = "`Hrmp::hrmp_accept_open_channel`."] - pub fn sudo_establish_hrmp_channel( - &self, - sender: runtime_types::polkadot_parachain::primitives::Id, - recipient: runtime_types::polkadot_parachain::primitives::Id, - max_capacity: ::core::primitive::u32, - max_message_size: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SudoEstablishHrmpChannel, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 37u8, 236u8, 235u8, 162u8, 207u8, 3u8, 97u8, 139u8, 72u8, 211u8, 203u8, - 78u8, 188u8, 159u8, 108u8, 13u8, 149u8, 224u8, 51u8, 96u8, 14u8, 60u8, - 124u8, 249u8, 48u8, 30u8, 6u8, 211u8, 205u8, 230u8, 252u8, 77u8, - ] - { - let call = SudoEstablishHrmpChannel { - sender, - recipient, - max_capacity, - max_message_size, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod assigned_slots { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AssignPermParachainSlot { - pub id: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for AssignPermParachainSlot { - const PALLET: &'static str = "AssignedSlots"; - const FUNCTION: &'static str = "assign_perm_parachain_slot"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AssignTempParachainSlot { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub lease_period_start: - runtime_types::polkadot_runtime_common::assigned_slots::SlotLeasePeriodStart, - } - impl ::subxt::Call for AssignTempParachainSlot { - const PALLET: &'static str = "AssignedSlots"; - const FUNCTION: &'static str = "assign_temp_parachain_slot"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct UnassignParachainSlot { - pub id: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for UnassignParachainSlot { - const PALLET: &'static str = "AssignedSlots"; - const FUNCTION: &'static str = "unassign_parachain_slot"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Assign a permanent parachain slot and immediately create a lease for it."] - pub fn assign_perm_parachain_slot( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AssignPermParachainSlot, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 182u8, 103u8, 59u8, 125u8, 140u8, 208u8, 37u8, 240u8, 39u8, 40u8, 34u8, - 213u8, 245u8, 19u8, 51u8, 202u8, 153u8, 174u8, 151u8, 229u8, 26u8, - 252u8, 91u8, 36u8, 67u8, 87u8, 249u8, 89u8, 149u8, 178u8, 87u8, 212u8, - ] - { - let call = AssignPermParachainSlot { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Assign a temporary parachain slot. The function tries to create a lease for it"] - #[doc = "immediately if `SlotLeasePeriodStart::Current` is specified, and if the number"] - #[doc = "of currently active temporary slots is below `MaxTemporarySlotPerLeasePeriod`."] - pub fn assign_temp_parachain_slot( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - lease_period_start : runtime_types :: polkadot_runtime_common :: assigned_slots :: SlotLeasePeriodStart, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AssignTempParachainSlot, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 166u8, 193u8, 161u8, 214u8, 110u8, 114u8, 94u8, 122u8, 247u8, 90u8, - 4u8, 153u8, 252u8, 215u8, 19u8, 80u8, 91u8, 82u8, 153u8, 101u8, 174u8, - 205u8, 41u8, 117u8, 144u8, 243u8, 206u8, 146u8, 170u8, 124u8, 53u8, - 109u8, - ] - { - let call = AssignTempParachainSlot { - id, - lease_period_start, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unassign a permanent or temporary parachain slot"] - pub fn unassign_parachain_slot( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UnassignParachainSlot, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 70u8, 155u8, 13u8, 223u8, 35u8, 4u8, 112u8, 133u8, 100u8, 136u8, 68u8, - 253u8, 52u8, 210u8, 70u8, 60u8, 13u8, 73u8, 39u8, 5u8, 163u8, 39u8, - 143u8, 187u8, 46u8, 54u8, 107u8, 160u8, 48u8, 227u8, 107u8, 106u8, - ] - { - let call = UnassignParachainSlot { id }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::assigned_slots::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A para was assigned a permanent parachain slot"] - pub struct PermanentSlotAssigned(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for PermanentSlotAssigned { - const PALLET: &'static str = "AssignedSlots"; - const EVENT: &'static str = "PermanentSlotAssigned"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A para was assigned a temporary parachain slot"] - pub struct TemporarySlotAssigned(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::Event for TemporarySlotAssigned { - const PALLET: &'static str = "AssignedSlots"; - const EVENT: &'static str = "TemporarySlotAssigned"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PermanentSlots<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for PermanentSlots<'_> { - const PALLET: &'static str = "AssignedSlots"; - const STORAGE: &'static str = "PermanentSlots"; - type Value = (::core::primitive::u32, ::core::primitive::u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PermanentSlotCount; - impl ::subxt::StorageEntry for PermanentSlotCount { - const PALLET: &'static str = "AssignedSlots"; - const STORAGE: &'static str = "PermanentSlotCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct TemporarySlots<'a>( - pub &'a runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for TemporarySlots<'_> { - const PALLET: &'static str = "AssignedSlots"; - const STORAGE: &'static str = "TemporarySlots"; - type Value = - runtime_types::polkadot_runtime_common::assigned_slots::ParachainTemporarySlot< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct TemporarySlotCount; - impl ::subxt::StorageEntry for TemporarySlotCount { - const PALLET: &'static str = "AssignedSlots"; - const STORAGE: &'static str = "TemporarySlotCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActiveTemporarySlotCount; - impl ::subxt::StorageEntry for ActiveTemporarySlotCount { - const PALLET: &'static str = "AssignedSlots"; - const STORAGE: &'static str = "ActiveTemporarySlotCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Assigned permanent slots, with their start lease period, and duration."] - pub async fn permanent_slots( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 128u8, 156u8, 45u8, 33u8, 173u8, 102u8, 61u8, 221u8, 125u8, 205u8, - 152u8, 190u8, 12u8, 209u8, 203u8, 24u8, 208u8, 50u8, 234u8, 124u8, - 172u8, 20u8, 20u8, 196u8, 232u8, 177u8, 117u8, 82u8, 116u8, 151u8, - 199u8, 204u8, - ] - { - let entry = PermanentSlots(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Assigned permanent slots, with their start lease period, and duration."] - pub async fn permanent_slots_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PermanentSlots<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 128u8, 156u8, 45u8, 33u8, 173u8, 102u8, 61u8, 221u8, 125u8, 205u8, - 152u8, 190u8, 12u8, 209u8, 203u8, 24u8, 208u8, 50u8, 234u8, 124u8, - 172u8, 20u8, 20u8, 196u8, 232u8, 177u8, 117u8, 82u8, 116u8, 151u8, - 199u8, 204u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of assigned (and active) permanent slots."] - pub async fn permanent_slot_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 186u8, 224u8, 144u8, 167u8, 64u8, 193u8, 68u8, 25u8, 146u8, 86u8, - 109u8, 81u8, 100u8, 197u8, 25u8, 4u8, 27u8, 131u8, 162u8, 7u8, 148u8, - 198u8, 162u8, 100u8, 197u8, 86u8, 37u8, 43u8, 240u8, 25u8, 18u8, 66u8, - ] - { - let entry = PermanentSlotCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Assigned temporary slots."] pub async fn temporary_slots (& self , _0 : & runtime_types :: polkadot_parachain :: primitives :: Id , block_hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: assigned_slots :: ParachainTemporarySlot < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 163u8, 37u8, 72u8, 142u8, 172u8, 117u8, 146u8, 111u8, 10u8, 100u8, - 92u8, 223u8, 253u8, 250u8, 19u8, 187u8, 227u8, 222u8, 91u8, 73u8, - 156u8, 158u8, 63u8, 183u8, 69u8, 16u8, 225u8, 58u8, 85u8, 89u8, 15u8, - 15u8, - ] - { - let entry = TemporarySlots(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Assigned temporary slots."] - pub async fn temporary_slots_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, TemporarySlots<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 163u8, 37u8, 72u8, 142u8, 172u8, 117u8, 146u8, 111u8, 10u8, 100u8, - 92u8, 223u8, 253u8, 250u8, 19u8, 187u8, 227u8, 222u8, 91u8, 73u8, - 156u8, 158u8, 63u8, 183u8, 69u8, 16u8, 225u8, 58u8, 85u8, 89u8, 15u8, - 15u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of assigned temporary slots."] - pub async fn temporary_slot_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 19u8, 243u8, 53u8, 131u8, 195u8, 143u8, 31u8, 224u8, 182u8, 69u8, - 209u8, 123u8, 82u8, 155u8, 96u8, 242u8, 109u8, 6u8, 27u8, 193u8, 251u8, - 45u8, 204u8, 10u8, 43u8, 185u8, 152u8, 181u8, 35u8, 183u8, 235u8, - 204u8, - ] - { - let entry = TemporarySlotCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Number of active temporary slots in current slot lease period."] - pub async fn active_temporary_slot_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 72u8, 42u8, 13u8, 42u8, 195u8, 143u8, 174u8, 137u8, 110u8, 144u8, - 190u8, 117u8, 102u8, 91u8, 66u8, 131u8, 69u8, 139u8, 156u8, 149u8, - 99u8, 177u8, 118u8, 72u8, 168u8, 191u8, 198u8, 135u8, 72u8, 192u8, - 130u8, 139u8, - ] - { - let entry = ActiveTemporarySlotCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The number of lease periods a permanent parachain slot lasts."] - pub fn permanent_slot_lease_period_length( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata - .constant_hash("AssignedSlots", "PermanentSlotLeasePeriodLength")? - == [ - 197u8, 245u8, 45u8, 120u8, 116u8, 188u8, 189u8, 76u8, 192u8, 116u8, - 209u8, 236u8, 222u8, 167u8, 208u8, 214u8, 153u8, 142u8, 201u8, 25u8, - 34u8, 104u8, 166u8, 229u8, 62u8, 169u8, 76u8, 118u8, 72u8, 170u8, - 202u8, 37u8, - ] - { - let pallet = locked_metadata.pallet("AssignedSlots")?; - let constant = pallet.constant("PermanentSlotLeasePeriodLength")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The number of lease periods a temporary parachain slot lasts."] - pub fn temporary_slot_lease_period_length( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata - .constant_hash("AssignedSlots", "TemporarySlotLeasePeriodLength")? - == [ - 160u8, 81u8, 143u8, 128u8, 192u8, 146u8, 202u8, 116u8, 139u8, 129u8, - 88u8, 164u8, 184u8, 60u8, 5u8, 56u8, 73u8, 212u8, 151u8, 207u8, 103u8, - 234u8, 152u8, 57u8, 230u8, 97u8, 135u8, 234u8, 34u8, 207u8, 116u8, - 164u8, - ] - { - let pallet = locked_metadata.pallet("AssignedSlots")?; - let constant = pallet.constant("TemporarySlotLeasePeriodLength")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The max number of permanent slots that can be assigned."] - pub fn max_permanent_slots( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("AssignedSlots", "MaxPermanentSlots")? - == [ - 75u8, 219u8, 223u8, 108u8, 146u8, 170u8, 51u8, 167u8, 148u8, 224u8, - 43u8, 171u8, 119u8, 109u8, 29u8, 18u8, 235u8, 142u8, 46u8, 172u8, 33u8, - 164u8, 74u8, 200u8, 206u8, 184u8, 170u8, 212u8, 233u8, 202u8, 191u8, - 47u8, - ] - { - let pallet = locked_metadata.pallet("AssignedSlots")?; - let constant = pallet.constant("MaxPermanentSlots")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The max number of temporary slots that can be assigned."] - pub fn max_temporary_slots( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("AssignedSlots", "MaxTemporarySlots")? - == [ - 165u8, 58u8, 243u8, 192u8, 228u8, 193u8, 249u8, 135u8, 28u8, 120u8, - 142u8, 150u8, 118u8, 250u8, 26u8, 107u8, 167u8, 219u8, 137u8, 231u8, - 8u8, 189u8, 114u8, 249u8, 86u8, 90u8, 224u8, 234u8, 229u8, 19u8, 65u8, - 211u8, - ] - { - let pallet = locked_metadata.pallet("AssignedSlots")?; - let constant = pallet.constant("MaxTemporarySlots")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The max number of temporary slots to be scheduled per lease periods."] - pub fn max_temporary_slot_per_lease_period( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata - .constant_hash("AssignedSlots", "MaxTemporarySlotPerLeasePeriod")? - == [ - 134u8, 16u8, 150u8, 86u8, 147u8, 116u8, 41u8, 63u8, 214u8, 209u8, 81u8, - 194u8, 90u8, 90u8, 12u8, 174u8, 120u8, 81u8, 50u8, 131u8, 35u8, 180u8, - 81u8, 105u8, 237u8, 186u8, 234u8, 114u8, 88u8, 106u8, 64u8, 254u8, - ] - { - let pallet = locked_metadata.pallet("AssignedSlots")?; - let constant = pallet.constant("MaxTemporarySlotPerLeasePeriod")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod sudo { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Sudo { - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for Sudo { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoUncheckedWeight { - pub call: ::std::boxed::Box, - pub weight: ::core::primitive::u64, - } - impl ::subxt::Call for SudoUncheckedWeight { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo_unchecked_weight"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetKey { - pub new: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - } - impl ::subxt::Call for SetKey { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "set_key"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SudoAs { - pub who: - ::subxt::sp_runtime::MultiAddress<::subxt::sp_core::crypto::AccountId32, ()>, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for SudoAs { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo_as"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + 10,000."] - #[doc = "# "] - pub fn sudo( - &self, - call: runtime_types::rococo_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Sudo, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 165u8, 27u8, 216u8, 53u8, 79u8, 72u8, 22u8, 193u8, 20u8, 154u8, 163u8, - 30u8, 135u8, 178u8, 220u8, 20u8, 245u8, 51u8, 238u8, 9u8, 168u8, 124u8, - 1u8, 30u8, 56u8, 170u8, 116u8, 140u8, 166u8, 78u8, 97u8, 101u8, - ] - { - let call = Sudo { - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - #[doc = "This function does not check the weight of the call, and instead allows the"] - #[doc = "Sudo user to specify the weight of the call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- The weight of this call is defined by the caller."] - #[doc = "# "] - pub fn sudo_unchecked_weight( - &self, - call: runtime_types::rococo_runtime::Call, - weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SudoUncheckedWeight, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 140u8, 39u8, 107u8, 82u8, 111u8, 170u8, 141u8, 203u8, 31u8, 182u8, - 85u8, 153u8, 47u8, 158u8, 243u8, 94u8, 94u8, 20u8, 236u8, 6u8, 24u8, - 144u8, 106u8, 53u8, 85u8, 101u8, 203u8, 28u8, 35u8, 73u8, 19u8, 138u8, - ] - { - let call = SudoUncheckedWeight { - call: ::std::boxed::Box::new(call), - weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] - #[doc = "key."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB change."] - #[doc = "# "] - pub fn set_key( - &self, - new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, SetKey, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 77u8, 253u8, 211u8, 157u8, 74u8, 92u8, 1u8, 102u8, 178u8, 103u8, 126u8, - 56u8, 156u8, 105u8, 45u8, 44u8, 64u8, 154u8, 163u8, 102u8, 93u8, 93u8, - 212u8, 5u8, 148u8, 184u8, 22u8, 135u8, 110u8, 102u8, 44u8, 172u8, - ] - { - let call = SetKey { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] - #[doc = "a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + 10,000."] - #[doc = "# "] - pub fn sudo_as( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - call: runtime_types::rococo_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, SudoAs, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 236u8, 134u8, 99u8, 97u8, 108u8, 178u8, 179u8, 154u8, 214u8, 36u8, - 100u8, 96u8, 15u8, 202u8, 205u8, 149u8, 89u8, 163u8, 159u8, 34u8, - 133u8, 118u8, 131u8, 54u8, 61u8, 116u8, 158u8, 143u8, 78u8, 85u8, 41u8, - 69u8, - ] - { - let call = SudoAs { - who, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_sudo::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A sudo just took place. \\[result\\]"] - pub struct Sudid { - pub sudo_result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for Sudid { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "Sudid"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The \\[sudoer\\] just switched identity; the old key is supplied if one existed."] - pub struct KeyChanged { - pub old_sudoer: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Event for KeyChanged { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "KeyChanged"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A sudo just took place. \\[result\\]"] - pub struct SudoAsDone { - pub sudo_result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for SudoAsDone { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "SudoAsDone"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Key; - impl ::subxt::StorageEntry for Key { - const PALLET: &'static str = "Sudo"; - const STORAGE: &'static str = "Key"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The `AccountId` of the sudo key."] - pub async fn key( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 222u8, 90u8, 158u8, 233u8, 184u8, 23u8, 141u8, 135u8, 81u8, 187u8, - 47u8, 100u8, 30u8, 81u8, 239u8, 197u8, 249u8, 253u8, 73u8, 207u8, - 161u8, 141u8, 174u8, 59u8, 74u8, 181u8, 10u8, 90u8, 22u8, 109u8, 62u8, - 27u8, - ] - { - let entry = Key; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod mmr { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct RootHash; - impl ::subxt::StorageEntry for RootHash { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "RootHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NumberOfLeaves; - impl ::subxt::StorageEntry for NumberOfLeaves { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "NumberOfLeaves"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Nodes<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Nodes<'_> { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "Nodes"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Peaks<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Peaks<'_> { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "Peaks"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Latest MMR Root hash."] - pub async fn root_hash( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 156u8, 176u8, 7u8, 77u8, 96u8, 23u8, 240u8, 140u8, 74u8, 33u8, 12u8, - 124u8, 160u8, 228u8, 78u8, 8u8, 139u8, 164u8, 109u8, 52u8, 168u8, - 234u8, 221u8, 194u8, 100u8, 2u8, 250u8, 5u8, 188u8, 203u8, 13u8, 117u8, - ] - { - let entry = RootHash; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Current size of the MMR (number of leaves)."] - pub async fn number_of_leaves( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 138u8, 124u8, 23u8, 186u8, 255u8, 231u8, 187u8, 122u8, 213u8, 160u8, - 29u8, 24u8, 88u8, 98u8, 171u8, 36u8, 195u8, 216u8, 27u8, 190u8, 192u8, - 152u8, 8u8, 13u8, 210u8, 232u8, 45u8, 184u8, 240u8, 255u8, 156u8, - 204u8, - ] - { - let entry = NumberOfLeaves; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All known nodes & leaves in the MMR, just until offchain db is fork aware"] - pub async fn nodes( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 113u8, 225u8, 71u8, 185u8, 124u8, 250u8, 5u8, 111u8, 46u8, 137u8, 40u8, - 37u8, 190u8, 232u8, 247u8, 194u8, 199u8, 28u8, 48u8, 224u8, 131u8, 6u8, - 213u8, 79u8, 238u8, 33u8, 199u8, 124u8, 238u8, 237u8, 247u8, 226u8, - ] - { - let entry = Nodes(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All known nodes & leaves in the MMR, just until offchain db is fork aware"] - pub async fn nodes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Nodes<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 113u8, 225u8, 71u8, 185u8, 124u8, 250u8, 5u8, 111u8, 46u8, 137u8, 40u8, - 37u8, 190u8, 232u8, 247u8, 194u8, 199u8, 28u8, 48u8, 224u8, 131u8, 6u8, - 213u8, 79u8, 238u8, 33u8, 199u8, 124u8, 238u8, 237u8, 247u8, 226u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn peaks( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 123u8, 192u8, 76u8, 245u8, 125u8, 125u8, 94u8, 74u8, 247u8, 105u8, - 68u8, 68u8, 136u8, 32u8, 79u8, 113u8, 236u8, 187u8, 42u8, 130u8, 123u8, - 36u8, 40u8, 32u8, 2u8, 32u8, 70u8, 9u8, 95u8, 200u8, 214u8, 107u8, - ] - { - let entry = Peaks(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn peaks_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Peaks<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 123u8, 192u8, 76u8, 245u8, 125u8, 125u8, 94u8, 74u8, 247u8, 105u8, - 68u8, 68u8, 136u8, 32u8, 79u8, 113u8, 236u8, 187u8, 42u8, 130u8, 123u8, - 36u8, 40u8, 32u8, 2u8, 32u8, 70u8, 9u8, 95u8, 200u8, 214u8, 107u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod beefy { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Authorities; - impl ::subxt::StorageEntry for Authorities { - const PALLET: &'static str = "Beefy"; - const STORAGE: &'static str = "Authorities"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ValidatorSetId; - impl ::subxt::StorageEntry for ValidatorSetId { - const PALLET: &'static str = "Beefy"; - const STORAGE: &'static str = "ValidatorSetId"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextAuthorities; - impl ::subxt::StorageEntry for NextAuthorities { - const PALLET: &'static str = "Beefy"; - const STORAGE: &'static str = "NextAuthorities"; - type Value = ::std::vec::Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current authorities set"] - pub async fn authorities( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 45u8, 197u8, 244u8, 25u8, 113u8, 204u8, 231u8, 240u8, 124u8, 4u8, - 153u8, 160u8, 92u8, 242u8, 251u8, 64u8, 146u8, 82u8, 161u8, 154u8, - 238u8, 220u8, 206u8, 186u8, 244u8, 49u8, 238u8, 244u8, 122u8, 26u8, - 159u8, 168u8, - ] - { - let entry = Authorities; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current validator set id"] - pub async fn validator_set_id( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 132u8, 47u8, 139u8, 239u8, 214u8, 179u8, 24u8, 63u8, 55u8, 154u8, - 248u8, 206u8, 73u8, 7u8, 52u8, 135u8, 54u8, 111u8, 250u8, 106u8, 71u8, - 78u8, 44u8, 44u8, 235u8, 177u8, 36u8, 112u8, 17u8, 122u8, 252u8, 80u8, - ] - { - let entry = ValidatorSetId; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Authorities set scheduled to be used with the next session"] - pub async fn next_authorities( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 217u8, 12u8, 213u8, 100u8, 67u8, 73u8, 155u8, 134u8, 236u8, 210u8, - 129u8, 96u8, 191u8, 83u8, 200u8, 17u8, 181u8, 124u8, 201u8, 155u8, - 14u8, 246u8, 203u8, 23u8, 57u8, 221u8, 95u8, 174u8, 128u8, 9u8, 32u8, - 1u8, - ] - { - let entry = NextAuthorities; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod mmr_leaf { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct BeefyNextAuthorities; - impl ::subxt::StorageEntry for BeefyNextAuthorities { - const PALLET: &'static str = "MmrLeaf"; - const STORAGE: &'static str = "BeefyNextAuthorities"; - type Value = runtime_types::beefy_primitives::mmr::BeefyNextAuthoritySet< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Details of next BEEFY authority set."] - #[doc = ""] - #[doc = " This storage entry is used as cache for calls to `update_beefy_next_authority_set`."] - pub async fn beefy_next_authorities( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::beefy_primitives::mmr::BeefyNextAuthoritySet< - ::subxt::sp_core::H256, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 176u8, 52u8, 163u8, 20u8, 65u8, 149u8, 67u8, 119u8, 40u8, 134u8, 178u8, - 89u8, 67u8, 6u8, 201u8, 226u8, 207u8, 218u8, 138u8, 14u8, 201u8, 41u8, - 40u8, 110u8, 227u8, 200u8, 56u8, 164u8, 187u8, 168u8, 116u8, 127u8, - ] - { - let entry = BeefyNextAuthorities; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod validator_manager { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RegisterValidators { - pub validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for RegisterValidators { - const PALLET: &'static str = "ValidatorManager"; - const FUNCTION: &'static str = "register_validators"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DeregisterValidators { - pub validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for DeregisterValidators { - const PALLET: &'static str = "ValidatorManager"; - const FUNCTION: &'static str = "deregister_validators"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Add new validators to the set."] - #[doc = ""] - #[doc = "The new validators will be active from current session + 2."] - pub fn register_validators( - &self, - validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RegisterValidators, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 211u8, 183u8, 121u8, 233u8, 106u8, 25u8, 23u8, 189u8, 167u8, 88u8, - 21u8, 191u8, 153u8, 233u8, 186u8, 3u8, 237u8, 24u8, 145u8, 35u8, 85u8, - 217u8, 142u8, 173u8, 62u8, 123u8, 67u8, 246u8, 252u8, 38u8, 101u8, - 22u8, - ] - { - let call = RegisterValidators { validators }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove validators from the set."] - #[doc = ""] - #[doc = "The removed validators will be deactivated from current session + 2."] - pub fn deregister_validators( - &self, - validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DeregisterValidators, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 150u8, 129u8, 133u8, 192u8, 213u8, 92u8, 94u8, 234u8, 253u8, 173u8, - 208u8, 236u8, 109u8, 105u8, 193u8, 122u8, 88u8, 234u8, 39u8, 152u8, - 245u8, 127u8, 195u8, 101u8, 189u8, 25u8, 24u8, 4u8, 179u8, 149u8, 73u8, - 216u8, - ] - { - let call = DeregisterValidators { validators }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::rococo_runtime::validator_manager::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "New validators were added to the set."] - pub struct ValidatorsRegistered( - pub ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ); - impl ::subxt::Event for ValidatorsRegistered { - const PALLET: &'static str = "ValidatorManager"; - const EVENT: &'static str = "ValidatorsRegistered"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Validators were removed from the set."] - pub struct ValidatorsDeregistered( - pub ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ); - impl ::subxt::Event for ValidatorsDeregistered { - const PALLET: &'static str = "ValidatorManager"; - const EVENT: &'static str = "ValidatorsDeregistered"; - } - } - pub mod storage { - use super::runtime_types; - pub struct ValidatorsToRetire; - impl ::subxt::StorageEntry for ValidatorsToRetire { - const PALLET: &'static str = "ValidatorManager"; - const STORAGE: &'static str = "ValidatorsToRetire"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ValidatorsToAdd; - impl ::subxt::StorageEntry for ValidatorsToAdd { - const PALLET: &'static str = "ValidatorManager"; - const STORAGE: &'static str = "ValidatorsToAdd"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Validators that should be retired, because their Parachain was deregistered."] - pub async fn validators_to_retire( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 132u8, 64u8, 206u8, 170u8, 240u8, 112u8, 249u8, 91u8, 54u8, 160u8, - 127u8, 52u8, 144u8, 203u8, 91u8, 42u8, 60u8, 139u8, 121u8, 51u8, 154u8, - 68u8, 5u8, 64u8, 32u8, 33u8, 235u8, 220u8, 161u8, 155u8, 105u8, 29u8, - ] - { - let entry = ValidatorsToRetire; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Validators that should be added."] - pub async fn validators_to_add( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 222u8, 254u8, 217u8, 103u8, 255u8, 143u8, 42u8, 9u8, 219u8, 218u8, 1u8, - 95u8, 225u8, 65u8, 100u8, 178u8, 255u8, 33u8, 196u8, 174u8, 29u8, 92u8, - 3u8, 66u8, 166u8, 37u8, 3u8, 156u8, 148u8, 169u8, 121u8, 208u8, - ] - { - let entry = ValidatorsToAdd; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod bridge_rococo_grandpa { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SubmitFinalityProof { - pub finality_target: ::std::boxed::Box< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - pub justification: - runtime_types::bp_header_chain::justification::GrandpaJustification< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for SubmitFinalityProof { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const FUNCTION: &'static str = "submit_finality_proof"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Initialize { - pub init_data: runtime_types::bp_header_chain::InitializationData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for Initialize { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const FUNCTION: &'static str = "initialize"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOwner { - pub new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for SetOwner { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const FUNCTION: &'static str = "set_owner"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOperational { - pub operational: ::core::primitive::bool, - } - impl ::subxt::Call for SetOperational { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const FUNCTION: &'static str = "set_operational"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Verify a target header is finalized according to the given finality proof."] - #[doc = ""] - #[doc = "It will use the underlying storage pallet to fetch information about the current"] - #[doc = "authorities and best finalized header in order to verify that the header is finalized."] - #[doc = ""] - #[doc = "If successful in verification, it will write the target header to the underlying storage"] - #[doc = "pallet."] - pub fn submit_finality_proof( - &self, - finality_target: runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - justification : runtime_types :: bp_header_chain :: justification :: GrandpaJustification < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SubmitFinalityProof, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 31u8, 50u8, 238u8, 103u8, 232u8, 246u8, 137u8, 168u8, 123u8, 2u8, - 101u8, 25u8, 65u8, 221u8, 119u8, 45u8, 253u8, 107u8, 252u8, 151u8, - 64u8, 89u8, 110u8, 60u8, 207u8, 64u8, 49u8, 185u8, 161u8, 222u8, 182u8, - 95u8, - ] - { - let call = SubmitFinalityProof { - finality_target: ::std::boxed::Box::new(finality_target), - justification, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Bootstrap the bridge pallet with an initial header and authority set from which to sync."] - #[doc = ""] - #[doc = "The initial configuration provided does not need to be the genesis header of the bridged"] - #[doc = "chain, it can be any arbitrary header. You can also provide the next scheduled set"] - #[doc = "change if it is already know."] - #[doc = ""] - #[doc = "This function is only allowed to be called from a trusted origin and writes to storage"] - #[doc = "with practically no checks in terms of the validity of the data. It is important that"] - #[doc = "you ensure that valid data is being passed in."] - pub fn initialize( - &self, - init_data: runtime_types::bp_header_chain::InitializationData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Initialize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 22u8, 193u8, 202u8, 78u8, 206u8, 45u8, 63u8, 47u8, 215u8, 57u8, - 63u8, 178u8, 235u8, 108u8, 255u8, 169u8, 88u8, 219u8, 0u8, 239u8, - 214u8, 251u8, 230u8, 27u8, 231u8, 67u8, 71u8, 61u8, 4u8, 124u8, 157u8, - ] - { - let call = Initialize { init_data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Change `PalletOwner`."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_owner( - &self, - new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOwner, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 168u8, 223u8, 175u8, 15u8, 5u8, 101u8, 85u8, 40u8, 177u8, 36u8, 145u8, - 67u8, 135u8, 179u8, 171u8, 30u8, 17u8, 130u8, 2u8, 99u8, 96u8, 141u8, - 109u8, 36u8, 54u8, 185u8, 38u8, 48u8, 191u8, 233u8, 104u8, 163u8, - ] - { - let call = SetOwner { new_owner }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Halt or resume all pallet operations."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_operational( - &self, - operational: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOperational, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 0u8, 141u8, 239u8, 63u8, 232u8, 183u8, 89u8, 179u8, 33u8, 67u8, 107u8, - 73u8, 45u8, 231u8, 255u8, 182u8, 6u8, 245u8, 198u8, 20u8, 60u8, 69u8, - 110u8, 153u8, 105u8, 231u8, 38u8, 60u8, 160u8, 183u8, 33u8, 249u8, - ] - { - let call = SetOperational { operational }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct RequestCount; - impl ::subxt::StorageEntry for RequestCount { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "RequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct InitialHash; - impl ::subxt::StorageEntry for InitialHash { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "InitialHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BestFinalized; - impl ::subxt::StorageEntry for BestFinalized { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "BestFinalized"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ImportedHashes<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ImportedHashes<'_> { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "ImportedHashes"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ImportedHashesPointer; - impl ::subxt::StorageEntry for ImportedHashesPointer { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "ImportedHashesPointer"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ImportedHeaders<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ImportedHeaders<'_> { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "ImportedHeaders"; - type Value = runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct CurrentAuthoritySet; - impl ::subxt::StorageEntry for CurrentAuthoritySet { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "CurrentAuthoritySet"; - type Value = runtime_types::bp_header_chain::AuthoritySet; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PalletOwner; - impl ::subxt::StorageEntry for PalletOwner { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "PalletOwner"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct IsHalted; - impl ::subxt::StorageEntry for IsHalted { - const PALLET: &'static str = "BridgeRococoGrandpa"; - const STORAGE: &'static str = "IsHalted"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current number of requests which have written to storage."] - #[doc = ""] - #[doc = " If the `RequestCount` hits `MaxRequests`, no more calls will be allowed to the pallet until"] - #[doc = " the request capacity is increased."] - #[doc = ""] - #[doc = " The `RequestCount` is decreased by one at the beginning of every block. This is to ensure"] - #[doc = " that the pallet can always make progress."] - pub async fn request_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 100u8, 156u8, 98u8, 176u8, 229u8, 85u8, 81u8, 159u8, 120u8, 156u8, - 33u8, 179u8, 224u8, 237u8, 52u8, 198u8, 81u8, 81u8, 10u8, 180u8, 53u8, - 141u8, 96u8, 4u8, 39u8, 217u8, 58u8, 9u8, 57u8, 79u8, 47u8, 201u8, - ] - { - let entry = RequestCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Hash of the header used to bootstrap the pallet."] - pub async fn initial_hash( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 132u8, 52u8, 69u8, 160u8, 110u8, 180u8, 123u8, 180u8, 42u8, 166u8, - 212u8, 77u8, 56u8, 248u8, 24u8, 188u8, 232u8, 178u8, 81u8, 114u8, - 203u8, 57u8, 225u8, 145u8, 59u8, 192u8, 166u8, 78u8, 85u8, 104u8, - 211u8, 98u8, - ] - { - let entry = InitialHash; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Hash of the best finalized header."] - pub async fn best_finalized( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 236u8, 116u8, 207u8, 248u8, 32u8, 122u8, 40u8, 116u8, 42u8, 71u8, - 188u8, 243u8, 139u8, 97u8, 120u8, 181u8, 228u8, 109u8, 53u8, 145u8, - 142u8, 63u8, 106u8, 133u8, 201u8, 253u8, 46u8, 171u8, 99u8, 21u8, 12u8, - 186u8, - ] - { - let entry = BestFinalized; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A ring buffer of imported hashes. Ordered by the insertion time."] - pub async fn imported_hashes( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 54u8, 8u8, 20u8, 100u8, 220u8, 128u8, 147u8, 237u8, 119u8, 242u8, - 164u8, 140u8, 4u8, 77u8, 23u8, 71u8, 148u8, 75u8, 236u8, 176u8, 87u8, - 223u8, 160u8, 188u8, 128u8, 213u8, 3u8, 218u8, 147u8, 39u8, 240u8, - 175u8, - ] - { - let entry = ImportedHashes(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A ring buffer of imported hashes. Ordered by the insertion time."] - pub async fn imported_hashes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ImportedHashes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 54u8, 8u8, 20u8, 100u8, 220u8, 128u8, 147u8, 237u8, 119u8, 242u8, - 164u8, 140u8, 4u8, 77u8, 23u8, 71u8, 148u8, 75u8, 236u8, 176u8, 87u8, - 223u8, 160u8, 188u8, 128u8, 213u8, 3u8, 218u8, 147u8, 39u8, 240u8, - 175u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Current ring buffer position."] - pub async fn imported_hashes_pointer( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 159u8, 83u8, 35u8, 45u8, 27u8, 249u8, 155u8, 131u8, 181u8, 196u8, - 224u8, 26u8, 92u8, 132u8, 127u8, 237u8, 13u8, 142u8, 196u8, 147u8, - 221u8, 216u8, 11u8, 78u8, 190u8, 241u8, 201u8, 96u8, 74u8, 185u8, - 208u8, 42u8, - ] - { - let entry = ImportedHashesPointer; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Headers which have been imported into the pallet."] - pub async fn imported_headers( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 222u8, 252u8, 160u8, 15u8, 104u8, 250u8, 14u8, 24u8, 170u8, 217u8, - 43u8, 181u8, 191u8, 4u8, 36u8, 189u8, 147u8, 94u8, 126u8, 141u8, 163u8, - 97u8, 128u8, 137u8, 252u8, 242u8, 146u8, 108u8, 40u8, 218u8, 137u8, - 36u8, - ] - { - let entry = ImportedHeaders(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Headers which have been imported into the pallet."] - pub async fn imported_headers_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ImportedHeaders<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 222u8, 252u8, 160u8, 15u8, 104u8, 250u8, 14u8, 24u8, 170u8, 217u8, - 43u8, 181u8, 191u8, 4u8, 36u8, 189u8, 147u8, 94u8, 126u8, 141u8, 163u8, - 97u8, 128u8, 137u8, 252u8, 242u8, 146u8, 108u8, 40u8, 218u8, 137u8, - 36u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current GRANDPA Authority set."] - pub async fn current_authority_set( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_header_chain::AuthoritySet, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 170u8, 59u8, 85u8, 12u8, 194u8, 126u8, 250u8, 180u8, 104u8, 36u8, - 128u8, 146u8, 189u8, 201u8, 233u8, 229u8, 234u8, 193u8, 87u8, 249u8, - 216u8, 197u8, 183u8, 93u8, 84u8, 101u8, 243u8, 122u8, 157u8, 243u8, - 211u8, 3u8, - ] - { - let entry = CurrentAuthoritySet; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Optional pallet owner."] - #[doc = ""] - #[doc = " Pallet owner has a right to halt all pallet operations and then resume it. If it is"] - #[doc = " `None`, then there are no direct ways to halt/resume pallet operations, but other"] - #[doc = " runtime methods may still be used to do that (i.e. democracy::referendum to update halt"] - #[doc = " flag directly or call the `halt_operations`)."] - pub async fn pallet_owner( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 115u8, 57u8, 104u8, 22u8, 119u8, 16u8, 215u8, 71u8, 228u8, 104u8, - 111u8, 24u8, 53u8, 155u8, 26u8, 121u8, 143u8, 126u8, 72u8, 148u8, - 105u8, 132u8, 190u8, 40u8, 233u8, 219u8, 19u8, 143u8, 255u8, 20u8, - 220u8, 124u8, - ] - { - let entry = PalletOwner; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " If true, all pallet transactions are failed immediately."] - pub async fn is_halted( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 107u8, 205u8, 253u8, 250u8, 98u8, 222u8, 141u8, 130u8, 74u8, 138u8, - 151u8, 77u8, 37u8, 226u8, 115u8, 116u8, 137u8, 247u8, 159u8, 72u8, - 230u8, 11u8, 85u8, 102u8, 122u8, 203u8, 235u8, 219u8, 54u8, 172u8, - 74u8, 22u8, - ] - { - let entry = IsHalted; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The upper bound on the number of requests allowed by the pallet."] - #[doc = ""] - #[doc = " A request refers to an action which writes a header to storage."] - #[doc = ""] - #[doc = " Once this bound is reached the pallet will not allow any dispatchables to be called"] - #[doc = " until the request count has decreased."] - pub fn max_requests( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("BridgeRococoGrandpa", "MaxRequests")? - == [ - 214u8, 232u8, 188u8, 57u8, 231u8, 189u8, 134u8, 244u8, 85u8, 191u8, - 134u8, 74u8, 207u8, 115u8, 21u8, 124u8, 19u8, 227u8, 59u8, 8u8, 252u8, - 8u8, 0u8, 252u8, 40u8, 49u8, 74u8, 145u8, 172u8, 109u8, 136u8, 63u8, - ] - { - let pallet = locked_metadata.pallet("BridgeRococoGrandpa")?; - let constant = pallet.constant("MaxRequests")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximal number of finalized headers to keep in the storage."] - #[doc = ""] - #[doc = " The setting is there to prevent growing the on-chain state indefinitely. Note"] - #[doc = " the setting does not relate to block numbers - we will simply keep as much items"] - #[doc = " in the storage, so it doesn't guarantee any fixed timeframe for finality headers."] - pub fn headers_to_keep( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("BridgeRococoGrandpa", "HeadersToKeep")? - == [ - 60u8, 85u8, 123u8, 208u8, 97u8, 205u8, 153u8, 170u8, 74u8, 94u8, 206u8, - 148u8, 171u8, 182u8, 210u8, 175u8, 1u8, 44u8, 152u8, 246u8, 144u8, - 232u8, 127u8, 202u8, 253u8, 214u8, 47u8, 246u8, 63u8, 86u8, 184u8, - 94u8, - ] - { - let pallet = locked_metadata.pallet("BridgeRococoGrandpa")?; - let constant = pallet.constant("HeadersToKeep")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod bridge_wococo_grandpa { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SubmitFinalityProof { - pub finality_target: ::std::boxed::Box< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - pub justification: - runtime_types::bp_header_chain::justification::GrandpaJustification< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for SubmitFinalityProof { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const FUNCTION: &'static str = "submit_finality_proof"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Initialize { - pub init_data: runtime_types::bp_header_chain::InitializationData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - } - impl ::subxt::Call for Initialize { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const FUNCTION: &'static str = "initialize"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOwner { - pub new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for SetOwner { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const FUNCTION: &'static str = "set_owner"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOperational { - pub operational: ::core::primitive::bool, - } - impl ::subxt::Call for SetOperational { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const FUNCTION: &'static str = "set_operational"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Verify a target header is finalized according to the given finality proof."] - #[doc = ""] - #[doc = "It will use the underlying storage pallet to fetch information about the current"] - #[doc = "authorities and best finalized header in order to verify that the header is finalized."] - #[doc = ""] - #[doc = "If successful in verification, it will write the target header to the underlying storage"] - #[doc = "pallet."] - pub fn submit_finality_proof( - &self, - finality_target: runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - justification : runtime_types :: bp_header_chain :: justification :: GrandpaJustification < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SubmitFinalityProof, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 31u8, 50u8, 238u8, 103u8, 232u8, 246u8, 137u8, 168u8, 123u8, 2u8, - 101u8, 25u8, 65u8, 221u8, 119u8, 45u8, 253u8, 107u8, 252u8, 151u8, - 64u8, 89u8, 110u8, 60u8, 207u8, 64u8, 49u8, 185u8, 161u8, 222u8, 182u8, - 95u8, - ] - { - let call = SubmitFinalityProof { - finality_target: ::std::boxed::Box::new(finality_target), - justification, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Bootstrap the bridge pallet with an initial header and authority set from which to sync."] - #[doc = ""] - #[doc = "The initial configuration provided does not need to be the genesis header of the bridged"] - #[doc = "chain, it can be any arbitrary header. You can also provide the next scheduled set"] - #[doc = "change if it is already know."] - #[doc = ""] - #[doc = "This function is only allowed to be called from a trusted origin and writes to storage"] - #[doc = "with practically no checks in terms of the validity of the data. It is important that"] - #[doc = "you ensure that valid data is being passed in."] - pub fn initialize( - &self, - init_data: runtime_types::bp_header_chain::InitializationData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Initialize, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 22u8, 193u8, 202u8, 78u8, 206u8, 45u8, 63u8, 47u8, 215u8, 57u8, - 63u8, 178u8, 235u8, 108u8, 255u8, 169u8, 88u8, 219u8, 0u8, 239u8, - 214u8, 251u8, 230u8, 27u8, 231u8, 67u8, 71u8, 61u8, 4u8, 124u8, 157u8, - ] - { - let call = Initialize { init_data }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Change `PalletOwner`."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_owner( - &self, - new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOwner, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 168u8, 223u8, 175u8, 15u8, 5u8, 101u8, 85u8, 40u8, 177u8, 36u8, 145u8, - 67u8, 135u8, 179u8, 171u8, 30u8, 17u8, 130u8, 2u8, 99u8, 96u8, 141u8, - 109u8, 36u8, 54u8, 185u8, 38u8, 48u8, 191u8, 233u8, 104u8, 163u8, - ] - { - let call = SetOwner { new_owner }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Halt or resume all pallet operations."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_operational( - &self, - operational: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOperational, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 0u8, 141u8, 239u8, 63u8, 232u8, 183u8, 89u8, 179u8, 33u8, 67u8, 107u8, - 73u8, 45u8, 231u8, 255u8, 182u8, 6u8, 245u8, 198u8, 20u8, 60u8, 69u8, - 110u8, 153u8, 105u8, 231u8, 38u8, 60u8, 160u8, 183u8, 33u8, 249u8, - ] - { - let call = SetOperational { operational }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod storage { - use super::runtime_types; - pub struct RequestCount; - impl ::subxt::StorageEntry for RequestCount { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "RequestCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct InitialHash; - impl ::subxt::StorageEntry for InitialHash { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "InitialHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BestFinalized; - impl ::subxt::StorageEntry for BestFinalized { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "BestFinalized"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ImportedHashes<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for ImportedHashes<'_> { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "ImportedHashes"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ImportedHashesPointer; - impl ::subxt::StorageEntry for ImportedHashesPointer { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "ImportedHashesPointer"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ImportedHeaders<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ImportedHeaders<'_> { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "ImportedHeaders"; - type Value = runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct CurrentAuthoritySet; - impl ::subxt::StorageEntry for CurrentAuthoritySet { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "CurrentAuthoritySet"; - type Value = runtime_types::bp_header_chain::AuthoritySet; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PalletOwner; - impl ::subxt::StorageEntry for PalletOwner { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "PalletOwner"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct IsHalted; - impl ::subxt::StorageEntry for IsHalted { - const PALLET: &'static str = "BridgeWococoGrandpa"; - const STORAGE: &'static str = "IsHalted"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current number of requests which have written to storage."] - #[doc = ""] - #[doc = " If the `RequestCount` hits `MaxRequests`, no more calls will be allowed to the pallet until"] - #[doc = " the request capacity is increased."] - #[doc = ""] - #[doc = " The `RequestCount` is decreased by one at the beginning of every block. This is to ensure"] - #[doc = " that the pallet can always make progress."] - pub async fn request_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 100u8, 156u8, 98u8, 176u8, 229u8, 85u8, 81u8, 159u8, 120u8, 156u8, - 33u8, 179u8, 224u8, 237u8, 52u8, 198u8, 81u8, 81u8, 10u8, 180u8, 53u8, - 141u8, 96u8, 4u8, 39u8, 217u8, 58u8, 9u8, 57u8, 79u8, 47u8, 201u8, - ] - { - let entry = RequestCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Hash of the header used to bootstrap the pallet."] - pub async fn initial_hash( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 132u8, 52u8, 69u8, 160u8, 110u8, 180u8, 123u8, 180u8, 42u8, 166u8, - 212u8, 77u8, 56u8, 248u8, 24u8, 188u8, 232u8, 178u8, 81u8, 114u8, - 203u8, 57u8, 225u8, 145u8, 59u8, 192u8, 166u8, 78u8, 85u8, 104u8, - 211u8, 98u8, - ] - { - let entry = InitialHash; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Hash of the best finalized header."] - pub async fn best_finalized( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 236u8, 116u8, 207u8, 248u8, 32u8, 122u8, 40u8, 116u8, 42u8, 71u8, - 188u8, 243u8, 139u8, 97u8, 120u8, 181u8, 228u8, 109u8, 53u8, 145u8, - 142u8, 63u8, 106u8, 133u8, 201u8, 253u8, 46u8, 171u8, 99u8, 21u8, 12u8, - 186u8, - ] - { - let entry = BestFinalized; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A ring buffer of imported hashes. Ordered by the insertion time."] - pub async fn imported_hashes( - &self, - _0: &::core::primitive::u32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 54u8, 8u8, 20u8, 100u8, 220u8, 128u8, 147u8, 237u8, 119u8, 242u8, - 164u8, 140u8, 4u8, 77u8, 23u8, 71u8, 148u8, 75u8, 236u8, 176u8, 87u8, - 223u8, 160u8, 188u8, 128u8, 213u8, 3u8, 218u8, 147u8, 39u8, 240u8, - 175u8, - ] - { - let entry = ImportedHashes(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " A ring buffer of imported hashes. Ordered by the insertion time."] - pub async fn imported_hashes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ImportedHashes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 54u8, 8u8, 20u8, 100u8, 220u8, 128u8, 147u8, 237u8, 119u8, 242u8, - 164u8, 140u8, 4u8, 77u8, 23u8, 71u8, 148u8, 75u8, 236u8, 176u8, 87u8, - 223u8, 160u8, 188u8, 128u8, 213u8, 3u8, 218u8, 147u8, 39u8, 240u8, - 175u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Current ring buffer position."] - pub async fn imported_hashes_pointer( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 159u8, 83u8, 35u8, 45u8, 27u8, 249u8, 155u8, 131u8, 181u8, 196u8, - 224u8, 26u8, 92u8, 132u8, 127u8, 237u8, 13u8, 142u8, 196u8, 147u8, - 221u8, 216u8, 11u8, 78u8, 190u8, 241u8, 201u8, 96u8, 74u8, 185u8, - 208u8, 42u8, - ] - { - let entry = ImportedHashesPointer; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Headers which have been imported into the pallet."] - pub async fn imported_headers( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 222u8, 252u8, 160u8, 15u8, 104u8, 250u8, 14u8, 24u8, 170u8, 217u8, - 43u8, 181u8, 191u8, 4u8, 36u8, 189u8, 147u8, 94u8, 126u8, 141u8, 163u8, - 97u8, 128u8, 137u8, 252u8, 242u8, 146u8, 108u8, 40u8, 218u8, 137u8, - 36u8, - ] - { - let entry = ImportedHeaders(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Headers which have been imported into the pallet."] - pub async fn imported_headers_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ImportedHeaders<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 222u8, 252u8, 160u8, 15u8, 104u8, 250u8, 14u8, 24u8, 170u8, 217u8, - 43u8, 181u8, 191u8, 4u8, 36u8, 189u8, 147u8, 94u8, 126u8, 141u8, 163u8, - 97u8, 128u8, 137u8, 252u8, 242u8, 146u8, 108u8, 40u8, 218u8, 137u8, - 36u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current GRANDPA Authority set."] - pub async fn current_authority_set( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_header_chain::AuthoritySet, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 170u8, 59u8, 85u8, 12u8, 194u8, 126u8, 250u8, 180u8, 104u8, 36u8, - 128u8, 146u8, 189u8, 201u8, 233u8, 229u8, 234u8, 193u8, 87u8, 249u8, - 216u8, 197u8, 183u8, 93u8, 84u8, 101u8, 243u8, 122u8, 157u8, 243u8, - 211u8, 3u8, - ] - { - let entry = CurrentAuthoritySet; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Optional pallet owner."] - #[doc = ""] - #[doc = " Pallet owner has a right to halt all pallet operations and then resume it. If it is"] - #[doc = " `None`, then there are no direct ways to halt/resume pallet operations, but other"] - #[doc = " runtime methods may still be used to do that (i.e. democracy::referendum to update halt"] - #[doc = " flag directly or call the `halt_operations`)."] - pub async fn pallet_owner( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 115u8, 57u8, 104u8, 22u8, 119u8, 16u8, 215u8, 71u8, 228u8, 104u8, - 111u8, 24u8, 53u8, 155u8, 26u8, 121u8, 143u8, 126u8, 72u8, 148u8, - 105u8, 132u8, 190u8, 40u8, 233u8, 219u8, 19u8, 143u8, 255u8, 20u8, - 220u8, 124u8, - ] - { - let entry = PalletOwner; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " If true, all pallet transactions are failed immediately."] - pub async fn is_halted( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 107u8, 205u8, 253u8, 250u8, 98u8, 222u8, 141u8, 130u8, 74u8, 138u8, - 151u8, 77u8, 37u8, 226u8, 115u8, 116u8, 137u8, 247u8, 159u8, 72u8, - 230u8, 11u8, 85u8, 102u8, 122u8, 203u8, 235u8, 219u8, 54u8, 172u8, - 74u8, 22u8, - ] - { - let entry = IsHalted; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The upper bound on the number of requests allowed by the pallet."] - #[doc = ""] - #[doc = " A request refers to an action which writes a header to storage."] - #[doc = ""] - #[doc = " Once this bound is reached the pallet will not allow any dispatchables to be called"] - #[doc = " until the request count has decreased."] - pub fn max_requests( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("BridgeWococoGrandpa", "MaxRequests")? - == [ - 214u8, 232u8, 188u8, 57u8, 231u8, 189u8, 134u8, 244u8, 85u8, 191u8, - 134u8, 74u8, 207u8, 115u8, 21u8, 124u8, 19u8, 227u8, 59u8, 8u8, 252u8, - 8u8, 0u8, 252u8, 40u8, 49u8, 74u8, 145u8, 172u8, 109u8, 136u8, 63u8, - ] - { - let pallet = locked_metadata.pallet("BridgeWococoGrandpa")?; - let constant = pallet.constant("MaxRequests")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Maximal number of finalized headers to keep in the storage."] - #[doc = ""] - #[doc = " The setting is there to prevent growing the on-chain state indefinitely. Note"] - #[doc = " the setting does not relate to block numbers - we will simply keep as much items"] - #[doc = " in the storage, so it doesn't guarantee any fixed timeframe for finality headers."] - pub fn headers_to_keep( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("BridgeWococoGrandpa", "HeadersToKeep")? - == [ - 60u8, 85u8, 123u8, 208u8, 97u8, 205u8, 153u8, 170u8, 74u8, 94u8, 206u8, - 148u8, 171u8, 182u8, 210u8, 175u8, 1u8, 44u8, 152u8, 246u8, 144u8, - 232u8, 127u8, 202u8, 253u8, 214u8, 47u8, 246u8, 63u8, 86u8, 184u8, - 94u8, - ] - { - let pallet = locked_metadata.pallet("BridgeWococoGrandpa")?; - let constant = pallet.constant("HeadersToKeep")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod bridge_rococo_messages { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOwner { - pub new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for SetOwner { - const PALLET: &'static str = "BridgeRococoMessages"; - const FUNCTION: &'static str = "set_owner"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOperatingMode { - pub operating_mode: runtime_types::bp_messages::OperatingMode, - } - impl ::subxt::Call for SetOperatingMode { - const PALLET: &'static str = "BridgeRococoMessages"; - const FUNCTION: &'static str = "set_operating_mode"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct UpdatePalletParameter { - pub parameter: (), - } - impl ::subxt::Call for UpdatePalletParameter { - const PALLET: &'static str = "BridgeRococoMessages"; - const FUNCTION: &'static str = "update_pallet_parameter"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SendMessage { - pub lane_id: [::core::primitive::u8; 4usize], - pub payload: runtime_types::bp_message_dispatch::MessagePayload< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_runtime::MultiSigner, - runtime_types::sp_runtime::MultiSignature, - ::std::vec::Vec<::core::primitive::u8>, - >, - pub delivery_and_dispatch_fee: ::core::primitive::u128, - } - impl ::subxt::Call for SendMessage { - const PALLET: &'static str = "BridgeRococoMessages"; - const FUNCTION: &'static str = "send_message"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct IncreaseMessageFee { - pub lane_id: [::core::primitive::u8; 4usize], - pub nonce: ::core::primitive::u64, - pub additional_fee: ::core::primitive::u128, - } - impl ::subxt::Call for IncreaseMessageFee { - const PALLET: &'static str = "BridgeRococoMessages"; - const FUNCTION: &'static str = "increase_message_fee"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReceiveMessagesProof { pub relayer_id_at_bridged_chain : :: subxt :: sp_core :: crypto :: AccountId32 , pub proof : runtime_types :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: sp_core :: H256 > , pub messages_count : :: core :: primitive :: u32 , pub dispatch_weight : :: core :: primitive :: u64 , } - impl ::subxt::Call for ReceiveMessagesProof { - const PALLET: &'static str = "BridgeRococoMessages"; - const FUNCTION: &'static str = "receive_messages_proof"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReceiveMessagesDeliveryProof { pub proof : runtime_types :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: sp_core :: H256 > , pub relayers_state : runtime_types :: bp_messages :: UnrewardedRelayersState , } - impl ::subxt::Call for ReceiveMessagesDeliveryProof { - const PALLET: &'static str = "BridgeRococoMessages"; - const FUNCTION: &'static str = "receive_messages_delivery_proof"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Change `PalletOwner`."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_owner( - &self, - new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOwner, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 168u8, 223u8, 175u8, 15u8, 5u8, 101u8, 85u8, 40u8, 177u8, 36u8, 145u8, - 67u8, 135u8, 179u8, 171u8, 30u8, 17u8, 130u8, 2u8, 99u8, 96u8, 141u8, - 109u8, 36u8, 54u8, 185u8, 38u8, 48u8, 191u8, 233u8, 104u8, 163u8, - ] - { - let call = SetOwner { new_owner }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Halt or resume all/some pallet operations."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_operating_mode( - &self, - operating_mode: runtime_types::bp_messages::OperatingMode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOperatingMode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 51u8, 64u8, 160u8, 51u8, 9u8, 118u8, 71u8, 106u8, 25u8, 107u8, 67u8, - 86u8, 123u8, 215u8, 161u8, 150u8, 233u8, 199u8, 212u8, 78u8, 233u8, - 35u8, 120u8, 249u8, 145u8, 110u8, 105u8, 78u8, 67u8, 64u8, 189u8, - 199u8, - ] - { - let call = SetOperatingMode { operating_mode }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Update pallet parameter."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - #[doc = ""] - #[doc = "The weight is: single read for permissions check + 2 writes for parameter value and"] - #[doc = "event."] - pub fn update_pallet_parameter( - &self, - parameter: (), - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UpdatePalletParameter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 252u8, 109u8, 232u8, 190u8, 218u8, 178u8, 4u8, 197u8, 159u8, 44u8, - 100u8, 111u8, 106u8, 105u8, 69u8, 161u8, 170u8, 208u8, 241u8, 102u8, - 102u8, 157u8, 19u8, 93u8, 168u8, 66u8, 205u8, 174u8, 158u8, 21u8, - 201u8, 204u8, - ] - { - let call = UpdatePalletParameter { parameter }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send message over lane."] - pub fn send_message( - &self, - lane_id: [::core::primitive::u8; 4usize], - payload: runtime_types::bp_message_dispatch::MessagePayload< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_runtime::MultiSigner, - runtime_types::sp_runtime::MultiSignature, - ::std::vec::Vec<::core::primitive::u8>, - >, - delivery_and_dispatch_fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SendMessage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 159u8, 54u8, 99u8, 44u8, 222u8, 24u8, 28u8, 193u8, 253u8, 233u8, 170u8, - 10u8, 56u8, 217u8, 127u8, 71u8, 83u8, 188u8, 101u8, 15u8, 38u8, 2u8, - 193u8, 228u8, 195u8, 106u8, 68u8, 10u8, 216u8, 237u8, 99u8, 201u8, - ] - { - let call = SendMessage { - lane_id, - payload, - delivery_and_dispatch_fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Pay additional fee for the message."] - pub fn increase_message_fee( - &self, - lane_id: [::core::primitive::u8; 4usize], - nonce: ::core::primitive::u64, - additional_fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - IncreaseMessageFee, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 98u8, 74u8, 240u8, 247u8, 27u8, 236u8, 48u8, 148u8, 45u8, 53u8, 212u8, - 214u8, 25u8, 170u8, 120u8, 109u8, 35u8, 111u8, 27u8, 167u8, 195u8, - 112u8, 76u8, 112u8, 108u8, 74u8, 219u8, 100u8, 226u8, 255u8, 106u8, - 47u8, - ] - { - let call = IncreaseMessageFee { - lane_id, - nonce, - additional_fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Receive messages proof from bridged chain."] - #[doc = ""] - #[doc = "The weight of the call assumes that the transaction always brings outbound lane"] - #[doc = "state update. Because of that, the submitter (relayer) has no benefit of not including"] - #[doc = "this data in the transaction, so reward confirmations lags should be minimal."] - pub fn receive_messages_proof( - &self, - relayer_id_at_bridged_chain: ::subxt::sp_core::crypto::AccountId32, - proof : runtime_types :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: sp_core :: H256 >, - messages_count: ::core::primitive::u32, - dispatch_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReceiveMessagesProof, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 182u8, 116u8, 206u8, 75u8, 107u8, 233u8, 83u8, 54u8, 162u8, 233u8, - 28u8, 139u8, 89u8, 167u8, 7u8, 37u8, 215u8, 4u8, 67u8, 86u8, 142u8, - 205u8, 64u8, 76u8, 155u8, 167u8, 87u8, 237u8, 187u8, 188u8, 179u8, - 115u8, - ] - { - let call = ReceiveMessagesProof { - relayer_id_at_bridged_chain, - proof, - messages_count, - dispatch_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Receive messages delivery proof from bridged chain."] - pub fn receive_messages_delivery_proof( - &self, - proof : runtime_types :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: sp_core :: H256 >, - relayers_state: runtime_types::bp_messages::UnrewardedRelayersState, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReceiveMessagesDeliveryProof, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 103u8, 219u8, 120u8, 201u8, 118u8, 176u8, 17u8, 121u8, 188u8, 88u8, - 72u8, 251u8, 42u8, 143u8, 197u8, 198u8, 220u8, 152u8, 71u8, 9u8, 92u8, - 14u8, 75u8, 33u8, 169u8, 249u8, 149u8, 66u8, 154u8, 94u8, 63u8, 142u8, - ] - { - let call = ReceiveMessagesDeliveryProof { - proof, - relayers_state, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_bridge_messages::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Pallet parameter has been updated."] - pub struct ParameterUpdated(pub ()); - impl ::subxt::Event for ParameterUpdated { - const PALLET: &'static str = "BridgeRococoMessages"; - const EVENT: &'static str = "ParameterUpdated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been accepted and is waiting to be delivered."] - pub struct MessageAccepted( - pub [::core::primitive::u8; 4usize], - pub ::core::primitive::u64, - ); - impl ::subxt::Event for MessageAccepted { - const PALLET: &'static str = "BridgeRococoMessages"; - const EVENT: &'static str = "MessageAccepted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Messages in the inclusive range have been delivered to the bridged chain."] - pub struct MessagesDelivered( - pub [::core::primitive::u8; 4usize], - pub runtime_types::bp_messages::DeliveredMessages, - ); - impl ::subxt::Event for MessagesDelivered { - const PALLET: &'static str = "BridgeRococoMessages"; - const EVENT: &'static str = "MessagesDelivered"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PalletOwner; - impl ::subxt::StorageEntry for PalletOwner { - const PALLET: &'static str = "BridgeRococoMessages"; - const STORAGE: &'static str = "PalletOwner"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PalletOperatingMode; - impl ::subxt::StorageEntry for PalletOperatingMode { - const PALLET: &'static str = "BridgeRococoMessages"; - const STORAGE: &'static str = "PalletOperatingMode"; - type Value = runtime_types::bp_messages::OperatingMode; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct InboundLanes<'a>(pub &'a [::core::primitive::u8; 4usize]); - impl ::subxt::StorageEntry for InboundLanes<'_> { - const PALLET: &'static str = "BridgeRococoMessages"; - const STORAGE: &'static str = "InboundLanes"; - type Value = runtime_types::bp_messages::InboundLaneData< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct OutboundLanes<'a>(pub &'a [::core::primitive::u8; 4usize]); - impl ::subxt::StorageEntry for OutboundLanes<'_> { - const PALLET: &'static str = "BridgeRococoMessages"; - const STORAGE: &'static str = "OutboundLanes"; - type Value = runtime_types::bp_messages::OutboundLaneData; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct OutboundMessages<'a>(pub &'a runtime_types::bp_messages::MessageKey); - impl ::subxt::StorageEntry for OutboundMessages<'_> { - const PALLET: &'static str = "BridgeRococoMessages"; - const STORAGE: &'static str = "OutboundMessages"; - type Value = runtime_types::bp_messages::MessageData<::core::primitive::u128>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Optional pallet owner."] - #[doc = ""] - #[doc = " Pallet owner has a right to halt all pallet operations and then resume it. If it is"] - #[doc = " `None`, then there are no direct ways to halt/resume pallet operations, but other"] - #[doc = " runtime methods may still be used to do that (i.e. democracy::referendum to update halt"] - #[doc = " flag directly or call the `halt_operations`)."] - pub async fn pallet_owner( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 115u8, 57u8, 104u8, 22u8, 119u8, 16u8, 215u8, 71u8, 228u8, 104u8, - 111u8, 24u8, 53u8, 155u8, 26u8, 121u8, 143u8, 126u8, 72u8, 148u8, - 105u8, 132u8, 190u8, 40u8, 233u8, 219u8, 19u8, 143u8, 255u8, 20u8, - 220u8, 124u8, - ] - { - let entry = PalletOwner; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current operating mode of the pallet."] - #[doc = ""] - #[doc = " Depending on the mode either all, some, or no transactions will be allowed."] - pub async fn pallet_operating_mode( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_messages::OperatingMode, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 210u8, 120u8, 80u8, 199u8, 37u8, 129u8, 219u8, 178u8, 3u8, 129u8, - 160u8, 77u8, 255u8, 190u8, 33u8, 163u8, 1u8, 234u8, 96u8, 88u8, 157u8, - 45u8, 31u8, 136u8, 137u8, 30u8, 21u8, 47u8, 118u8, 28u8, 240u8, 131u8, - ] - { - let entry = PalletOperatingMode; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => inbound lane data."] - pub async fn inbound_lanes( - &self, - _0: &[::core::primitive::u8; 4usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_messages::InboundLaneData< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 147u8, 219u8, 249u8, 150u8, 150u8, 102u8, 58u8, 115u8, 13u8, 113u8, - 123u8, 132u8, 192u8, 87u8, 188u8, 170u8, 17u8, 101u8, 23u8, 37u8, - 209u8, 188u8, 148u8, 44u8, 67u8, 5u8, 197u8, 202u8, 247u8, 177u8, 87u8, - 22u8, - ] - { - let entry = InboundLanes(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => inbound lane data."] - pub async fn inbound_lanes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, InboundLanes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 147u8, 219u8, 249u8, 150u8, 150u8, 102u8, 58u8, 115u8, 13u8, 113u8, - 123u8, 132u8, 192u8, 87u8, 188u8, 170u8, 17u8, 101u8, 23u8, 37u8, - 209u8, 188u8, 148u8, 44u8, 67u8, 5u8, 197u8, 202u8, 247u8, 177u8, 87u8, - 22u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => outbound lane data."] - pub async fn outbound_lanes( - &self, - _0: &[::core::primitive::u8; 4usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_messages::OutboundLaneData, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 167u8, 52u8, 228u8, 63u8, 97u8, 175u8, 67u8, 104u8, 3u8, 142u8, 1u8, - 95u8, 125u8, 145u8, 23u8, 141u8, 69u8, 159u8, 248u8, 138u8, 132u8, - 134u8, 226u8, 39u8, 80u8, 126u8, 65u8, 114u8, 181u8, 100u8, 194u8, - 217u8, - ] - { - let entry = OutboundLanes(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => outbound lane data."] - pub async fn outbound_lanes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, OutboundLanes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 167u8, 52u8, 228u8, 63u8, 97u8, 175u8, 67u8, 104u8, 3u8, 142u8, 1u8, - 95u8, 125u8, 145u8, 23u8, 141u8, 69u8, 159u8, 248u8, 138u8, 132u8, - 134u8, 226u8, 39u8, 80u8, 126u8, 65u8, 114u8, 181u8, 100u8, 194u8, - 217u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All queued outbound messages."] - pub async fn outbound_messages( - &self, - _0: &runtime_types::bp_messages::MessageKey, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::bp_messages::MessageData<::core::primitive::u128>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 177u8, 51u8, 170u8, 171u8, 178u8, 211u8, 79u8, 214u8, 67u8, 138u8, - 133u8, 155u8, 41u8, 236u8, 49u8, 87u8, 77u8, 61u8, 87u8, 87u8, 5u8, - 52u8, 16u8, 64u8, 202u8, 215u8, 40u8, 221u8, 179u8, 109u8, 76u8, 110u8, - ] - { - let entry = OutboundMessages(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All queued outbound messages."] - pub async fn outbound_messages_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, OutboundMessages<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 177u8, 51u8, 170u8, 171u8, 178u8, 211u8, 79u8, 214u8, 67u8, 138u8, - 133u8, 155u8, 41u8, 236u8, 49u8, 87u8, 77u8, 61u8, 87u8, 87u8, 5u8, - 52u8, 16u8, 64u8, 202u8, 215u8, 40u8, 221u8, 179u8, 109u8, 76u8, 110u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Gets the chain id value from the instance."] - pub fn bridged_chain_id( - &self, - ) -> ::core::result::Result<[::core::primitive::u8; 4usize], ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("BridgeRococoMessages", "BridgedChainId")? - == [ - 133u8, 139u8, 37u8, 221u8, 12u8, 53u8, 28u8, 244u8, 20u8, 208u8, 170u8, - 206u8, 199u8, 163u8, 64u8, 197u8, 53u8, 203u8, 37u8, 207u8, 163u8, 8u8, - 105u8, 94u8, 247u8, 117u8, 251u8, 97u8, 243u8, 237u8, 116u8, 130u8, - ] - { - let pallet = locked_metadata.pallet("BridgeRococoMessages")?; - let constant = pallet.constant("BridgedChainId")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod bridge_wococo_messages { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOwner { - pub new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for SetOwner { - const PALLET: &'static str = "BridgeWococoMessages"; - const FUNCTION: &'static str = "set_owner"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetOperatingMode { - pub operating_mode: runtime_types::bp_messages::OperatingMode, - } - impl ::subxt::Call for SetOperatingMode { - const PALLET: &'static str = "BridgeWococoMessages"; - const FUNCTION: &'static str = "set_operating_mode"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct UpdatePalletParameter { - pub parameter: (), - } - impl ::subxt::Call for UpdatePalletParameter { - const PALLET: &'static str = "BridgeWococoMessages"; - const FUNCTION: &'static str = "update_pallet_parameter"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SendMessage { - pub lane_id: [::core::primitive::u8; 4usize], - pub payload: runtime_types::bp_message_dispatch::MessagePayload< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_runtime::MultiSigner, - runtime_types::sp_runtime::MultiSignature, - ::std::vec::Vec<::core::primitive::u8>, - >, - pub delivery_and_dispatch_fee: ::core::primitive::u128, - } - impl ::subxt::Call for SendMessage { - const PALLET: &'static str = "BridgeWococoMessages"; - const FUNCTION: &'static str = "send_message"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct IncreaseMessageFee { - pub lane_id: [::core::primitive::u8; 4usize], - pub nonce: ::core::primitive::u64, - pub additional_fee: ::core::primitive::u128, - } - impl ::subxt::Call for IncreaseMessageFee { - const PALLET: &'static str = "BridgeWococoMessages"; - const FUNCTION: &'static str = "increase_message_fee"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReceiveMessagesProof { pub relayer_id_at_bridged_chain : :: subxt :: sp_core :: crypto :: AccountId32 , pub proof : runtime_types :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: sp_core :: H256 > , pub messages_count : :: core :: primitive :: u32 , pub dispatch_weight : :: core :: primitive :: u64 , } - impl ::subxt::Call for ReceiveMessagesProof { - const PALLET: &'static str = "BridgeWococoMessages"; - const FUNCTION: &'static str = "receive_messages_proof"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReceiveMessagesDeliveryProof { pub proof : runtime_types :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: sp_core :: H256 > , pub relayers_state : runtime_types :: bp_messages :: UnrewardedRelayersState , } - impl ::subxt::Call for ReceiveMessagesDeliveryProof { - const PALLET: &'static str = "BridgeWococoMessages"; - const FUNCTION: &'static str = "receive_messages_delivery_proof"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Change `PalletOwner`."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_owner( - &self, - new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOwner, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 168u8, 223u8, 175u8, 15u8, 5u8, 101u8, 85u8, 40u8, 177u8, 36u8, 145u8, - 67u8, 135u8, 179u8, 171u8, 30u8, 17u8, 130u8, 2u8, 99u8, 96u8, 141u8, - 109u8, 36u8, 54u8, 185u8, 38u8, 48u8, 191u8, 233u8, 104u8, 163u8, - ] - { - let call = SetOwner { new_owner }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Halt or resume all/some pallet operations."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - pub fn set_operating_mode( - &self, - operating_mode: runtime_types::bp_messages::OperatingMode, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetOperatingMode, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 51u8, 64u8, 160u8, 51u8, 9u8, 118u8, 71u8, 106u8, 25u8, 107u8, 67u8, - 86u8, 123u8, 215u8, 161u8, 150u8, 233u8, 199u8, 212u8, 78u8, 233u8, - 35u8, 120u8, 249u8, 145u8, 110u8, 105u8, 78u8, 67u8, 64u8, 189u8, - 199u8, - ] - { - let call = SetOperatingMode { operating_mode }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Update pallet parameter."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - #[doc = ""] - #[doc = "The weight is: single read for permissions check + 2 writes for parameter value and"] - #[doc = "event."] - pub fn update_pallet_parameter( - &self, - parameter: (), - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - UpdatePalletParameter, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 252u8, 109u8, 232u8, 190u8, 218u8, 178u8, 4u8, 197u8, 159u8, 44u8, - 100u8, 111u8, 106u8, 105u8, 69u8, 161u8, 170u8, 208u8, 241u8, 102u8, - 102u8, 157u8, 19u8, 93u8, 168u8, 66u8, 205u8, 174u8, 158u8, 21u8, - 201u8, 204u8, - ] - { - let call = UpdatePalletParameter { parameter }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send message over lane."] - pub fn send_message( - &self, - lane_id: [::core::primitive::u8; 4usize], - payload: runtime_types::bp_message_dispatch::MessagePayload< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_runtime::MultiSigner, - runtime_types::sp_runtime::MultiSignature, - ::std::vec::Vec<::core::primitive::u8>, - >, - delivery_and_dispatch_fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SendMessage, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 159u8, 54u8, 99u8, 44u8, 222u8, 24u8, 28u8, 193u8, 253u8, 233u8, 170u8, - 10u8, 56u8, 217u8, 127u8, 71u8, 83u8, 188u8, 101u8, 15u8, 38u8, 2u8, - 193u8, 228u8, 195u8, 106u8, 68u8, 10u8, 216u8, 237u8, 99u8, 201u8, - ] - { - let call = SendMessage { - lane_id, - payload, - delivery_and_dispatch_fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Pay additional fee for the message."] - pub fn increase_message_fee( - &self, - lane_id: [::core::primitive::u8; 4usize], - nonce: ::core::primitive::u64, - additional_fee: ::core::primitive::u128, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - IncreaseMessageFee, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 98u8, 74u8, 240u8, 247u8, 27u8, 236u8, 48u8, 148u8, 45u8, 53u8, 212u8, - 214u8, 25u8, 170u8, 120u8, 109u8, 35u8, 111u8, 27u8, 167u8, 195u8, - 112u8, 76u8, 112u8, 108u8, 74u8, 219u8, 100u8, 226u8, 255u8, 106u8, - 47u8, - ] - { - let call = IncreaseMessageFee { - lane_id, - nonce, - additional_fee, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Receive messages proof from bridged chain."] - #[doc = ""] - #[doc = "The weight of the call assumes that the transaction always brings outbound lane"] - #[doc = "state update. Because of that, the submitter (relayer) has no benefit of not including"] - #[doc = "this data in the transaction, so reward confirmations lags should be minimal."] - pub fn receive_messages_proof( - &self, - relayer_id_at_bridged_chain: ::subxt::sp_core::crypto::AccountId32, - proof : runtime_types :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: sp_core :: H256 >, - messages_count: ::core::primitive::u32, - dispatch_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReceiveMessagesProof, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 182u8, 116u8, 206u8, 75u8, 107u8, 233u8, 83u8, 54u8, 162u8, 233u8, - 28u8, 139u8, 89u8, 167u8, 7u8, 37u8, 215u8, 4u8, 67u8, 86u8, 142u8, - 205u8, 64u8, 76u8, 155u8, 167u8, 87u8, 237u8, 187u8, 188u8, 179u8, - 115u8, - ] - { - let call = ReceiveMessagesProof { - relayer_id_at_bridged_chain, - proof, - messages_count, - dispatch_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Receive messages delivery proof from bridged chain."] - pub fn receive_messages_delivery_proof( - &self, - proof : runtime_types :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: sp_core :: H256 >, - relayers_state: runtime_types::bp_messages::UnrewardedRelayersState, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReceiveMessagesDeliveryProof, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 103u8, 219u8, 120u8, 201u8, 118u8, 176u8, 17u8, 121u8, 188u8, 88u8, - 72u8, 251u8, 42u8, 143u8, 197u8, 198u8, 220u8, 152u8, 71u8, 9u8, 92u8, - 14u8, 75u8, 33u8, 169u8, 249u8, 149u8, 66u8, 154u8, 94u8, 63u8, 142u8, - ] - { - let call = ReceiveMessagesDeliveryProof { - proof, - relayers_state, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_bridge_messages::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Pallet parameter has been updated."] - pub struct ParameterUpdated(pub ()); - impl ::subxt::Event for ParameterUpdated { - const PALLET: &'static str = "BridgeWococoMessages"; - const EVENT: &'static str = "ParameterUpdated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been accepted and is waiting to be delivered."] - pub struct MessageAccepted( - pub [::core::primitive::u8; 4usize], - pub ::core::primitive::u64, - ); - impl ::subxt::Event for MessageAccepted { - const PALLET: &'static str = "BridgeWococoMessages"; - const EVENT: &'static str = "MessageAccepted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Messages in the inclusive range have been delivered to the bridged chain."] - pub struct MessagesDelivered( - pub [::core::primitive::u8; 4usize], - pub runtime_types::bp_messages::DeliveredMessages, - ); - impl ::subxt::Event for MessagesDelivered { - const PALLET: &'static str = "BridgeWococoMessages"; - const EVENT: &'static str = "MessagesDelivered"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PalletOwner; - impl ::subxt::StorageEntry for PalletOwner { - const PALLET: &'static str = "BridgeWococoMessages"; - const STORAGE: &'static str = "PalletOwner"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PalletOperatingMode; - impl ::subxt::StorageEntry for PalletOperatingMode { - const PALLET: &'static str = "BridgeWococoMessages"; - const STORAGE: &'static str = "PalletOperatingMode"; - type Value = runtime_types::bp_messages::OperatingMode; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct InboundLanes<'a>(pub &'a [::core::primitive::u8; 4usize]); - impl ::subxt::StorageEntry for InboundLanes<'_> { - const PALLET: &'static str = "BridgeWococoMessages"; - const STORAGE: &'static str = "InboundLanes"; - type Value = runtime_types::bp_messages::InboundLaneData< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct OutboundLanes<'a>(pub &'a [::core::primitive::u8; 4usize]); - impl ::subxt::StorageEntry for OutboundLanes<'_> { - const PALLET: &'static str = "BridgeWococoMessages"; - const STORAGE: &'static str = "OutboundLanes"; - type Value = runtime_types::bp_messages::OutboundLaneData; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct OutboundMessages<'a>(pub &'a runtime_types::bp_messages::MessageKey); - impl ::subxt::StorageEntry for OutboundMessages<'_> { - const PALLET: &'static str = "BridgeWococoMessages"; - const STORAGE: &'static str = "OutboundMessages"; - type Value = runtime_types::bp_messages::MessageData<::core::primitive::u128>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Optional pallet owner."] - #[doc = ""] - #[doc = " Pallet owner has a right to halt all pallet operations and then resume it. If it is"] - #[doc = " `None`, then there are no direct ways to halt/resume pallet operations, but other"] - #[doc = " runtime methods may still be used to do that (i.e. democracy::referendum to update halt"] - #[doc = " flag directly or call the `halt_operations`)."] - pub async fn pallet_owner( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 115u8, 57u8, 104u8, 22u8, 119u8, 16u8, 215u8, 71u8, 228u8, 104u8, - 111u8, 24u8, 53u8, 155u8, 26u8, 121u8, 143u8, 126u8, 72u8, 148u8, - 105u8, 132u8, 190u8, 40u8, 233u8, 219u8, 19u8, 143u8, 255u8, 20u8, - 220u8, 124u8, - ] - { - let entry = PalletOwner; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current operating mode of the pallet."] - #[doc = ""] - #[doc = " Depending on the mode either all, some, or no transactions will be allowed."] - pub async fn pallet_operating_mode( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_messages::OperatingMode, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 210u8, 120u8, 80u8, 199u8, 37u8, 129u8, 219u8, 178u8, 3u8, 129u8, - 160u8, 77u8, 255u8, 190u8, 33u8, 163u8, 1u8, 234u8, 96u8, 88u8, 157u8, - 45u8, 31u8, 136u8, 137u8, 30u8, 21u8, 47u8, 118u8, 28u8, 240u8, 131u8, - ] - { - let entry = PalletOperatingMode; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => inbound lane data."] - pub async fn inbound_lanes( - &self, - _0: &[::core::primitive::u8; 4usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_messages::InboundLaneData< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 147u8, 219u8, 249u8, 150u8, 150u8, 102u8, 58u8, 115u8, 13u8, 113u8, - 123u8, 132u8, 192u8, 87u8, 188u8, 170u8, 17u8, 101u8, 23u8, 37u8, - 209u8, 188u8, 148u8, 44u8, 67u8, 5u8, 197u8, 202u8, 247u8, 177u8, 87u8, - 22u8, - ] - { - let entry = InboundLanes(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => inbound lane data."] - pub async fn inbound_lanes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, InboundLanes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 147u8, 219u8, 249u8, 150u8, 150u8, 102u8, 58u8, 115u8, 13u8, 113u8, - 123u8, 132u8, 192u8, 87u8, 188u8, 170u8, 17u8, 101u8, 23u8, 37u8, - 209u8, 188u8, 148u8, 44u8, 67u8, 5u8, 197u8, 202u8, 247u8, 177u8, 87u8, - 22u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => outbound lane data."] - pub async fn outbound_lanes( - &self, - _0: &[::core::primitive::u8; 4usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::bp_messages::OutboundLaneData, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 167u8, 52u8, 228u8, 63u8, 97u8, 175u8, 67u8, 104u8, 3u8, 142u8, 1u8, - 95u8, 125u8, 145u8, 23u8, 141u8, 69u8, 159u8, 248u8, 138u8, 132u8, - 134u8, 226u8, 39u8, 80u8, 126u8, 65u8, 114u8, 181u8, 100u8, 194u8, - 217u8, - ] - { - let entry = OutboundLanes(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Map of lane id => outbound lane data."] - pub async fn outbound_lanes_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, OutboundLanes<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 167u8, 52u8, 228u8, 63u8, 97u8, 175u8, 67u8, 104u8, 3u8, 142u8, 1u8, - 95u8, 125u8, 145u8, 23u8, 141u8, 69u8, 159u8, 248u8, 138u8, 132u8, - 134u8, 226u8, 39u8, 80u8, 126u8, 65u8, 114u8, 181u8, 100u8, 194u8, - 217u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All queued outbound messages."] - pub async fn outbound_messages( - &self, - _0: &runtime_types::bp_messages::MessageKey, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::bp_messages::MessageData<::core::primitive::u128>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 177u8, 51u8, 170u8, 171u8, 178u8, 211u8, 79u8, 214u8, 67u8, 138u8, - 133u8, 155u8, 41u8, 236u8, 49u8, 87u8, 77u8, 61u8, 87u8, 87u8, 5u8, - 52u8, 16u8, 64u8, 202u8, 215u8, 40u8, 221u8, 179u8, 109u8, 76u8, 110u8, - ] - { - let entry = OutboundMessages(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All queued outbound messages."] - pub async fn outbound_messages_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, OutboundMessages<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 177u8, 51u8, 170u8, 171u8, 178u8, 211u8, 79u8, 214u8, 67u8, 138u8, - 133u8, 155u8, 41u8, 236u8, 49u8, 87u8, 77u8, 61u8, 87u8, 87u8, 5u8, - 52u8, 16u8, 64u8, 202u8, 215u8, 40u8, 221u8, 179u8, 109u8, 76u8, 110u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " Gets the chain id value from the instance."] - pub fn bridged_chain_id( - &self, - ) -> ::core::result::Result<[::core::primitive::u8; 4usize], ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("BridgeWococoMessages", "BridgedChainId")? - == [ - 154u8, 72u8, 97u8, 79u8, 84u8, 66u8, 85u8, 2u8, 236u8, 184u8, 229u8, - 154u8, 144u8, 244u8, 122u8, 19u8, 61u8, 170u8, 228u8, 92u8, 221u8, - 160u8, 137u8, 95u8, 132u8, 191u8, 172u8, 201u8, 177u8, 162u8, 6u8, - 223u8, - ] - { - let pallet = locked_metadata.pallet("BridgeWococoMessages")?; - let constant = pallet.constant("BridgedChainId")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod bridge_rococo_messages_dispatch { - use super::root_mod; - use super::runtime_types; - pub type Event = runtime_types::pallet_bridge_dispatch::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been rejected before reaching dispatch."] - pub struct MessageRejected( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageRejected { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageRejected"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been rejected by dispatcher because of spec version mismatch."] - #[doc = "Last two arguments are: expected and passed spec version."] - pub struct MessageVersionSpecMismatch( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for MessageVersionSpecMismatch { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageVersionSpecMismatch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been rejected by dispatcher because of weight mismatch."] - #[doc = "Last two arguments are: expected and passed call weight."] - pub struct MessageWeightMismatch( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for MessageWeightMismatch { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageWeightMismatch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message signature mismatch."] - pub struct MessageSignatureMismatch( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageSignatureMismatch { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageSignatureMismatch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "We have failed to decode Call from the message."] - pub struct MessageCallDecodeFailed( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageCallDecodeFailed { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageCallDecodeFailed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The call from the message has been rejected by the call filter."] - pub struct MessageCallRejected( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageCallRejected { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageCallRejected"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The origin account has failed to pay fee for dispatching the message."] - pub struct MessageDispatchPaymentFailed( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for MessageDispatchPaymentFailed { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageDispatchPaymentFailed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been dispatched with given result."] - pub struct MessageDispatched( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for MessageDispatched { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "MessageDispatched"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Phantom member, never used. Needed to handle multiple pallet instances."] - pub struct _Dummy; - impl ::subxt::Event for _Dummy { - const PALLET: &'static str = "BridgeRococoMessagesDispatch"; - const EVENT: &'static str = "_Dummy"; - } - } - } - pub mod bridge_wococo_messages_dispatch { - use super::root_mod; - use super::runtime_types; - pub type Event = runtime_types::pallet_bridge_dispatch::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been rejected before reaching dispatch."] - pub struct MessageRejected( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageRejected { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageRejected"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been rejected by dispatcher because of spec version mismatch."] - #[doc = "Last two arguments are: expected and passed spec version."] - pub struct MessageVersionSpecMismatch( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for MessageVersionSpecMismatch { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageVersionSpecMismatch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been rejected by dispatcher because of weight mismatch."] - #[doc = "Last two arguments are: expected and passed call weight."] - pub struct MessageWeightMismatch( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for MessageWeightMismatch { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageWeightMismatch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message signature mismatch."] - pub struct MessageSignatureMismatch( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageSignatureMismatch { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageSignatureMismatch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "We have failed to decode Call from the message."] - pub struct MessageCallDecodeFailed( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageCallDecodeFailed { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageCallDecodeFailed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The call from the message has been rejected by the call filter."] - pub struct MessageCallRejected( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ); - impl ::subxt::Event for MessageCallRejected { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageCallRejected"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The origin account has failed to pay fee for dispatching the message."] - pub struct MessageDispatchPaymentFailed( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for MessageDispatchPaymentFailed { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageDispatchPaymentFailed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Message has been dispatched with given result."] - pub struct MessageDispatched( - pub [::core::primitive::u8; 4usize], - pub ([::core::primitive::u8; 4usize], ::core::primitive::u64), - pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for MessageDispatched { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "MessageDispatched"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Phantom member, never used. Needed to handle multiple pallet instances."] - pub struct _Dummy; - impl ::subxt::Event for _Dummy { - const PALLET: &'static str = "BridgeWococoMessagesDispatch"; - const EVENT: &'static str = "_Dummy"; - } - } - } - pub mod collective { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetMembers { - pub new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - pub old_count: ::core::primitive::u32, - } - impl ::subxt::Call for SetMembers { - const PALLET: &'static str = "Collective"; - const FUNCTION: &'static str = "set_members"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Execute { - pub proposal: ::std::boxed::Box, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "Collective"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Propose { - #[codec(compact)] - pub threshold: ::core::primitive::u32, - pub proposal: ::std::boxed::Box, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Collective"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Vote { - pub proposal: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: ::core::primitive::u32, - pub approve: ::core::primitive::bool, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Collective"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Close { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: ::core::primitive::u32, - #[codec(compact)] - pub proposal_weight_bound: ::core::primitive::u64, - #[codec(compact)] - pub length_bound: ::core::primitive::u32, - } - impl ::subxt::Call for Close { - const PALLET: &'static str = "Collective"; - const FUNCTION: &'static str = "close"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DisapproveProposal { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for DisapproveProposal { - const PALLET: &'static str = "Collective"; - const FUNCTION: &'static str = "disapprove_proposal"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Set the collective's membership."] - #[doc = ""] - #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] - #[doc = "- `prime`: The prime member whose vote sets the default."] - #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] - #[doc = " weight estimation."] - #[doc = ""] - #[doc = "Requires root origin."] - #[doc = ""] - #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] - #[doc = " the weight estimations rely on it to estimate dispatchable weight."] - #[doc = ""] - #[doc = "# WARNING:"] - #[doc = ""] - #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] - #[doc = "implementation of the trait [`ChangeMembers`]."] - #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] - #[doc = "with other logic managing the member set."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(MP + N)` where:"] - #[doc = " - `M` old-members-count (code- and governance-bounded)"] - #[doc = " - `N` new-members-count (code- and governance-bounded)"] - #[doc = " - `P` proposals-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] - #[doc = " members"] - #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] - #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] - #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] - #[doc = "# "] - pub fn set_members( - &self, - new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - old_count: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 228u8, 186u8, 17u8, 12u8, 231u8, 231u8, 139u8, 15u8, 96u8, 200u8, 68u8, - 27u8, 61u8, 106u8, 245u8, 199u8, 120u8, 141u8, 95u8, 215u8, 36u8, 49u8, - 0u8, 163u8, 172u8, 252u8, 221u8, 9u8, 1u8, 222u8, 44u8, 214u8, - ] - { - let call = SetMembers { - new_members, - prime, - old_count, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Dispatch a proposal from a member using the `Member` origin."] - #[doc = ""] - #[doc = "Origin must be a member of the collective."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] - #[doc = " `proposal`"] - #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] - #[doc = "- 1 event"] - #[doc = "# "] - pub fn execute( - &self, - proposal: runtime_types::rococo_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 91u8, 19u8, 148u8, 61u8, 20u8, 98u8, 47u8, 106u8, 62u8, 82u8, 202u8, - 245u8, 156u8, 219u8, 65u8, 246u8, 241u8, 3u8, 8u8, 162u8, 236u8, 12u8, - 184u8, 233u8, 106u8, 161u8, 175u8, 53u8, 141u8, 177u8, 144u8, 91u8, - ] - { - let call = Execute { - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add a new proposal to either be voted on or executed directly."] - #[doc = ""] - #[doc = "Requires the sender to be member."] - #[doc = ""] - #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] - #[doc = "or put up for voting."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - branching is influenced by `threshold` where:"] - #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] - #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] - #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] - #[doc = " - DB accesses influenced by `threshold`:"] - #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] - #[doc = " - OR proposal insertion (`threshold <= 2`)"] - #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] - #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] - #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] - #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] - #[doc = " - 1 event"] - #[doc = "# "] - pub fn propose( - &self, - threshold: ::core::primitive::u32, - proposal: runtime_types::rococo_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Propose, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 25u8, 34u8, 67u8, 124u8, 158u8, 216u8, 190u8, 19u8, 250u8, 189u8, - 179u8, 90u8, 125u8, 231u8, 84u8, 210u8, 235u8, 250u8, 185u8, 61u8, - 50u8, 249u8, 196u8, 50u8, 165u8, 2u8, 6u8, 227u8, 209u8, 121u8, 167u8, - 100u8, - ] - { - let call = Propose { - threshold, - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "Requires the sender to be a member."] - #[doc = ""] - #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `Members` (codec `O(M)`)"] - #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] - #[doc = "- 1 event"] - #[doc = "# "] - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Vote, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 184u8, 236u8, 80u8, 133u8, 26u8, 207u8, 3u8, 2u8, 120u8, 27u8, 38u8, - 135u8, 195u8, 86u8, 169u8, 229u8, 125u8, 253u8, 220u8, 120u8, 231u8, - 181u8, 101u8, 84u8, 151u8, 161u8, 39u8, 154u8, 183u8, 142u8, 165u8, - 161u8, - ] - { - let call = Vote { - proposal, - index, - approve, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] - #[doc = ""] - #[doc = "May be called by any signed account in order to finish voting and close the proposal."] - #[doc = ""] - #[doc = "If called before the end of the voting period it will only close the vote if it is"] - #[doc = "has enough votes to be approved or disapproved."] - #[doc = ""] - #[doc = "If called after the end of the voting period abstentions are counted as rejections"] - #[doc = "unless there is a prime member set and the prime member cast an approval."] - #[doc = ""] - #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] - #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] - #[doc = ""] - #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] - #[doc = "proposal."] - #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] - #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1 + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - `P1` is the complexity of `proposal` preimage."] - #[doc = " - `P2` is proposal-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] - #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] - #[doc = " `O(P2)`)"] - #[doc = " - any mutations done while executing `proposal` (`P1`)"] - #[doc = "- up to 3 events"] - #[doc = "# "] - pub fn close( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - proposal_weight_bound: ::core::primitive::u64, - length_bound: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Close, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 208u8, 108u8, 202u8, 24u8, 139u8, 8u8, 150u8, 108u8, 217u8, - 30u8, 209u8, 178u8, 1u8, 80u8, 25u8, 154u8, 146u8, 173u8, 172u8, 227u8, - 4u8, 140u8, 228u8, 58u8, 221u8, 189u8, 135u8, 203u8, 69u8, 105u8, 47u8, - ] - { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] - #[doc = "state."] - #[doc = ""] - #[doc = "Must be called by the Root origin."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity: O(P) where P is the number of max proposals"] - #[doc = "DB Weight:"] - #[doc = "* Reads: Proposals"] - #[doc = "* Writes: Voting, Proposals, ProposalOf"] - #[doc = "# "] - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DisapproveProposal, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 199u8, 113u8, 221u8, 167u8, 60u8, 241u8, 77u8, 166u8, 205u8, 191u8, - 183u8, 121u8, 191u8, 206u8, 230u8, 212u8, 215u8, 219u8, 30u8, 51u8, - 123u8, 18u8, 17u8, 218u8, 77u8, 227u8, 197u8, 95u8, 232u8, 59u8, 169u8, - 133u8, - ] - { - let call = DisapproveProposal { proposal_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] - #[doc = "`MemberCount`)."] - pub struct Proposed { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_index: ::core::primitive::u32, - pub proposal_hash: ::subxt::sp_core::H256, - pub threshold: ::core::primitive::u32, - } - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A motion (given hash) has been voted on by given account, leaving"] - #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] - pub struct Voted { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub proposal_hash: ::subxt::sp_core::H256, - pub voted: ::core::primitive::bool, - pub yes: ::core::primitive::u32, - pub no: ::core::primitive::u32, - } - impl ::subxt::Event for Voted { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Voted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A motion was approved by the required threshold."] - pub struct Approved { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Approved { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Approved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A motion was not approved by the required threshold."] - pub struct Disapproved { - pub proposal_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Disapproved { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Disapproved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A motion was executed; result will be `Ok` if it returned without error."] - pub struct Executed { - pub proposal_hash: ::subxt::sp_core::H256, - pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for Executed { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Executed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A single member did some action; result will be `Ok` if it returned without error."] - pub struct MemberExecuted { - pub proposal_hash: ::subxt::sp_core::H256, - pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for MemberExecuted { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "MemberExecuted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] - pub struct Closed { - pub proposal_hash: ::subxt::sp_core::H256, - pub yes: ::core::primitive::u32, - pub no: ::core::primitive::u32, - } - impl ::subxt::Event for Closed { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Closed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proposals; - impl ::subxt::StorageEntry for Proposals { - const PALLET: &'static str = "Collective"; - const STORAGE: &'static str = "Proposals"; - type Value = runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ProposalOf<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf<'_> { - const PALLET: &'static str = "Collective"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::rococo_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Voting<'_> { - const PALLET: &'static str = "Collective"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "Collective"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Collective"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "Collective"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The hashes of the active proposals."] - pub async fn proposals( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 174u8, 75u8, 108u8, 245u8, 86u8, 50u8, 107u8, 212u8, 244u8, 113u8, - 232u8, 168u8, 194u8, 33u8, 247u8, 97u8, 54u8, 115u8, 236u8, 189u8, - 59u8, 2u8, 252u8, 84u8, 199u8, 127u8, 197u8, 72u8, 23u8, 1u8, 118u8, - 95u8, - ] - { - let entry = Proposals; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Actual proposal for a given hash, if it's current."] - pub async fn proposal_of( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 21u8, 248u8, 80u8, 6u8, 213u8, 208u8, 252u8, 96u8, 223u8, 223u8, 125u8, - 219u8, 134u8, 59u8, 138u8, 197u8, 103u8, 6u8, 55u8, 189u8, 83u8, 21u8, - 75u8, 71u8, 193u8, 116u8, 101u8, 79u8, 151u8, 103u8, 87u8, 172u8, - ] - { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Actual proposal for a given hash, if it's current."] - pub async fn proposal_of_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 21u8, 248u8, 80u8, 6u8, 213u8, 208u8, 252u8, 96u8, 223u8, 223u8, 125u8, - 219u8, 134u8, 59u8, 138u8, 197u8, 103u8, 6u8, 55u8, 189u8, 83u8, 21u8, - 75u8, 71u8, 193u8, 116u8, 101u8, 79u8, 151u8, 103u8, 87u8, 172u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub async fn voting( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 145u8, 223u8, 203u8, 2u8, 137u8, 33u8, 22u8, 239u8, 175u8, 149u8, - 254u8, 185u8, 0u8, 139u8, 71u8, 134u8, 109u8, 95u8, 45u8, 75u8, 33u8, - 228u8, 127u8, 67u8, 53u8, 119u8, 188u8, 198u8, 11u8, 92u8, 4u8, 177u8, - ] - { - let entry = Voting(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub async fn voting_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 145u8, 223u8, 203u8, 2u8, 137u8, 33u8, 22u8, 239u8, 175u8, 149u8, - 254u8, 185u8, 0u8, 139u8, 71u8, 134u8, 109u8, 95u8, 45u8, 75u8, 33u8, - 228u8, 127u8, 67u8, 53u8, 119u8, 188u8, 198u8, 11u8, 92u8, 4u8, 177u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Proposals so far."] - pub async fn proposal_count( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, 143u8, 33u8, - 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, 154u8, 110u8, 32u8, 142u8, - 24u8, 149u8, 109u8, 105u8, 30u8, 83u8, 39u8, 177u8, 127u8, 160u8, 34u8, - 70u8, - ] - { - let entry = ProposalCount; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current members of the collective. This is stored sorted (just by value)."] - pub async fn members( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 136u8, 91u8, 140u8, 173u8, 238u8, 221u8, 4u8, 132u8, 238u8, 99u8, - 195u8, 142u8, 10u8, 35u8, 210u8, 227u8, 22u8, 72u8, 218u8, 222u8, - 227u8, 51u8, 55u8, 31u8, 252u8, 78u8, 195u8, 11u8, 195u8, 242u8, 171u8, - 75u8, - ] - { - let entry = Members; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] - pub async fn prime( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 70u8, 101u8, 20u8, 160u8, 173u8, 87u8, 190u8, 85u8, 60u8, 249u8, 144u8, - 77u8, 175u8, 195u8, 51u8, 196u8, 234u8, 62u8, 243u8, 199u8, 126u8, - 12u8, 88u8, 252u8, 1u8, 210u8, 65u8, 210u8, 33u8, 19u8, 222u8, 11u8, - ] - { - let entry = Prime; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod membership { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AddMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for AddMember { - const PALLET: &'static str = "Membership"; - const FUNCTION: &'static str = "add_member"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RemoveMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "Membership"; - const FUNCTION: &'static str = "remove_member"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SwapMember { - pub remove: ::subxt::sp_core::crypto::AccountId32, - pub add: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SwapMember { - const PALLET: &'static str = "Membership"; - const FUNCTION: &'static str = "swap_member"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ResetMembers { - pub members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for ResetMembers { - const PALLET: &'static str = "Membership"; - const FUNCTION: &'static str = "reset_members"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ChangeKey { - pub new: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ChangeKey { - const PALLET: &'static str = "Membership"; - const FUNCTION: &'static str = "change_key"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SetPrime { - pub who: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SetPrime { - const PALLET: &'static str = "Membership"; - const FUNCTION: &'static str = "set_prime"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ClearPrime; - impl ::subxt::Call for ClearPrime { - const PALLET: &'static str = "Membership"; - const FUNCTION: &'static str = "clear_prime"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Add a member `who` to the set."] - #[doc = ""] - #[doc = "May only be called from `T::AddOrigin`."] - pub fn add_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 1u8, 149u8, 115u8, 222u8, 93u8, 9u8, 208u8, 58u8, 22u8, 148u8, 215u8, - 141u8, 204u8, 48u8, 107u8, 210u8, 202u8, 165u8, 43u8, 159u8, 45u8, - 161u8, 255u8, 127u8, 225u8, 100u8, 161u8, 195u8, 197u8, 206u8, 57u8, - 166u8, - ] - { - let call = AddMember { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a member `who` from the set."] - #[doc = ""] - #[doc = "May only be called from `T::RemoveOrigin`."] - pub fn remove_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 137u8, 249u8, 148u8, 139u8, 147u8, 47u8, 226u8, 228u8, 139u8, 219u8, - 109u8, 128u8, 254u8, 51u8, 227u8, 154u8, 105u8, 91u8, 229u8, 69u8, - 217u8, 241u8, 107u8, 229u8, 41u8, 202u8, 228u8, 227u8, 160u8, 162u8, - 45u8, 211u8, - ] - { - let call = RemoveMember { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Swap out one member `remove` for another `add`."] - #[doc = ""] - #[doc = "May only be called from `T::SwapOrigin`."] - #[doc = ""] - #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] - pub fn swap_member( - &self, - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SwapMember, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 159u8, 62u8, 254u8, 117u8, 56u8, 185u8, 99u8, 29u8, 146u8, 210u8, 40u8, - 77u8, 169u8, 224u8, 215u8, 34u8, 106u8, 95u8, 204u8, 109u8, 72u8, 67u8, - 11u8, 183u8, 33u8, 84u8, 133u8, 4u8, 5u8, 13u8, 188u8, 123u8, - ] - { - let call = SwapMember { remove, add }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] - #[doc = "pass `members` pre-sorted."] - #[doc = ""] - #[doc = "May only be called from `T::ResetOrigin`."] - pub fn reset_members( - &self, - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ResetMembers, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 246u8, 84u8, 91u8, 191u8, 61u8, 245u8, 171u8, 80u8, 18u8, 120u8, 61u8, - 86u8, 23u8, 115u8, 161u8, 203u8, 128u8, 34u8, 166u8, 128u8, 33u8, 28u8, - 229u8, 81u8, 103u8, 217u8, 173u8, 151u8, 31u8, 118u8, 151u8, 217u8, - ] - { - let call = ResetMembers { members }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Swap out the sending member for some other key `new`."] - #[doc = ""] - #[doc = "May only be called from `Signed` origin of a current member."] - #[doc = ""] - #[doc = "Prime membership is passed from the origin account to `new`, if extant."] - pub fn change_key( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ChangeKey, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 198u8, 93u8, 41u8, 52u8, 241u8, 11u8, 225u8, 82u8, 30u8, 114u8, 111u8, - 204u8, 13u8, 31u8, 34u8, 82u8, 171u8, 58u8, 180u8, 65u8, 3u8, 246u8, - 33u8, 167u8, 200u8, 23u8, 150u8, 235u8, 130u8, 172u8, 202u8, 216u8, - ] - { - let call = ChangeKey { new }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set the prime member. Must be a current member."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - pub fn set_prime( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - SetPrime, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 185u8, 53u8, 61u8, 154u8, 234u8, 77u8, 195u8, 126u8, 19u8, 39u8, 78u8, - 205u8, 109u8, 210u8, 137u8, 245u8, 128u8, 110u8, 2u8, 201u8, 20u8, - 153u8, 146u8, 177u8, 4u8, 144u8, 229u8, 125u8, 91u8, 131u8, 199u8, - 15u8, - ] - { - let call = SetPrime { who }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the prime member if it exists."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - pub fn clear_prime( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ClearPrime, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 186u8, 182u8, 225u8, 90u8, 71u8, 124u8, 69u8, 100u8, 234u8, 25u8, 53u8, - 23u8, 182u8, 32u8, 176u8, 81u8, 54u8, 140u8, 235u8, 126u8, 247u8, 7u8, - 155u8, 62u8, 35u8, 135u8, 48u8, 61u8, 88u8, 160u8, 183u8, 72u8, - ] - { - let call = ClearPrime {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_membership::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given member was added; see the transaction for who."] - pub struct MemberAdded; - impl ::subxt::Event for MemberAdded { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MemberAdded"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The given member was removed; see the transaction for who."] - pub struct MemberRemoved; - impl ::subxt::Event for MemberRemoved { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MemberRemoved"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Two members were swapped; see the transaction for who."] - pub struct MembersSwapped; - impl ::subxt::Event for MembersSwapped { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MembersSwapped"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The membership was reset; see the transaction for who the new set is."] - pub struct MembersReset; - impl ::subxt::Event for MembersReset { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MembersReset"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "One of the members' keys changed."] - pub struct KeyChanged; - impl ::subxt::Event for KeyChanged { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "KeyChanged"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Phantom member, never used."] - pub struct Dummy; - impl ::subxt::Event for Dummy { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "Dummy"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Membership"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "Membership"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The current membership, stored as an ordered Vec."] - pub async fn members( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 136u8, 91u8, 140u8, 173u8, 238u8, 221u8, 4u8, 132u8, 238u8, 99u8, - 195u8, 142u8, 10u8, 35u8, 210u8, 227u8, 22u8, 72u8, 218u8, 222u8, - 227u8, 51u8, 55u8, 31u8, 252u8, 78u8, 195u8, 11u8, 195u8, 242u8, 171u8, - 75u8, - ] - { - let entry = Members; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current prime member, if one exists."] - pub async fn prime( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 70u8, 101u8, 20u8, 160u8, 173u8, 87u8, 190u8, 85u8, 60u8, 249u8, 144u8, - 77u8, 175u8, 195u8, 51u8, 196u8, 234u8, 62u8, 243u8, 199u8, 126u8, - 12u8, 88u8, 252u8, 1u8, 210u8, 65u8, 210u8, 33u8, 19u8, 222u8, 11u8, - ] - { - let entry = Prime; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod utility { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Batch { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for Batch { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AsDerivative { - pub index: ::core::primitive::u16, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for AsDerivative { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "as_derivative"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BatchAll { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for BatchAll { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch_all"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DispatchAs { - pub as_origin: ::std::boxed::Box, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for DispatchAs { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "dispatch_as"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceBatch { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for ForceBatch { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "force_batch"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub fn batch( - &self, - calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Batch, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 106u8, 187u8, 150u8, 55u8, 162u8, 187u8, 87u8, 129u8, 247u8, 37u8, - 92u8, 122u8, 107u8, 10u8, 191u8, 140u8, 119u8, 204u8, 241u8, 192u8, - 245u8, 13u8, 60u8, 212u8, 74u8, 124u8, 28u8, 107u8, 151u8, 98u8, 70u8, - 231u8, - ] - { - let call = Batch { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] - #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub fn as_derivative( - &self, - index: ::core::primitive::u16, - call: runtime_types::rococo_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsDerivative, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 120u8, 74u8, 233u8, 165u8, 129u8, 172u8, 27u8, 223u8, 154u8, 246u8, - 215u8, 151u8, 196u8, 144u8, 236u8, 157u8, 201u8, 142u8, 190u8, 195u8, - 43u8, 225u8, 242u8, 148u8, 224u8, 146u8, 48u8, 129u8, 64u8, 145u8, - 28u8, 137u8, - ] - { - let call = AsDerivative { - index, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - pub fn batch_all( - &self, - calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - BatchAll, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 239u8, 39u8, 233u8, 190u8, 130u8, 122u8, 240u8, 89u8, 96u8, 90u8, 8u8, - 204u8, 93u8, 178u8, 223u8, 62u8, 1u8, 103u8, 70u8, 17u8, 168u8, 139u8, - 33u8, 107u8, 144u8, 112u8, 166u8, 86u8, 167u8, 59u8, 103u8, 250u8, - ] - { - let call = BatchAll { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] - #[doc = "# "] - pub fn dispatch_as( - &self, - as_origin: runtime_types::rococo_runtime::OriginCaller, - call: runtime_types::rococo_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - DispatchAs, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 53u8, 188u8, 204u8, 105u8, 191u8, 117u8, 48u8, 40u8, 241u8, 25u8, 75u8, - 98u8, 116u8, 66u8, 111u8, 199u8, 196u8, 26u8, 139u8, 162u8, 192u8, - 223u8, 0u8, 120u8, 2u8, 65u8, 204u8, 132u8, 83u8, 54u8, 95u8, 114u8, - ] - { - let call = DispatchAs { - as_origin: ::std::boxed::Box::new(as_origin), - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Send a batch of dispatch calls."] - #[doc = "Unlike `batch`, it allows errors and won't interrupt."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - pub fn force_batch( - &self, - calls: ::std::vec::Vec, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceBatch, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 154u8, 15u8, 2u8, 133u8, 243u8, 136u8, 204u8, 147u8, 221u8, 27u8, 53u8, - 170u8, 239u8, 182u8, 153u8, 193u8, 207u8, 218u8, 32u8, 136u8, 251u8, - 110u8, 152u8, 252u8, 128u8, 12u8, 217u8, 251u8, 136u8, 157u8, 237u8, - 73u8, - ] - { - let call = ForceBatch { calls }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_utility::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] - #[doc = "well as the error."] - pub struct BatchInterrupted { - pub index: ::core::primitive::u32, - pub error: runtime_types::sp_runtime::DispatchError, - } - impl ::subxt::Event for BatchInterrupted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchInterrupted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Batch of dispatches completed fully with no error."] - pub struct BatchCompleted; - impl ::subxt::Event for BatchCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompleted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Batch of dispatches completed but has errors."] - pub struct BatchCompletedWithErrors; - impl ::subxt::Event for BatchCompletedWithErrors { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompletedWithErrors"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A single item within a Batch of dispatches has completed with no error."] - pub struct ItemCompleted; - impl ::subxt::Event for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A single item within a Batch of dispatches has completed with error."] - pub struct ItemFailed { - pub error: runtime_types::sp_runtime::DispatchError, - } - impl ::subxt::Event for ItemFailed { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemFailed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A call was dispatched."] - pub struct DispatchedAs { - pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for DispatchedAs { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "DispatchedAs"; - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The limit on the number of batched calls."] - pub fn batched_calls_limit( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Utility", "batched_calls_limit")? - == [ - 230u8, 161u8, 6u8, 191u8, 162u8, 108u8, 149u8, 245u8, 68u8, 101u8, - 120u8, 129u8, 140u8, 51u8, 77u8, 97u8, 30u8, 155u8, 115u8, 70u8, 72u8, - 235u8, 251u8, 192u8, 5u8, 8u8, 188u8, 72u8, 132u8, 227u8, 44u8, 2u8, - ] - { - let pallet = locked_metadata.pallet("Utility")?; - let constant = pallet.constant("batched_calls_limit")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod proxy { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Proxy { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: - ::core::option::Option, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for Proxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AddProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::rococo_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Call for AddProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "add_proxy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RemoveProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::rococo_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Call for RemoveProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxy"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RemoveProxies; - impl ::subxt::Call for RemoveProxies { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxies"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Anonymous { - pub proxy_type: runtime_types::rococo_runtime::ProxyType, - pub delay: ::core::primitive::u32, - pub index: ::core::primitive::u16, - } - impl ::subxt::Call for Anonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "anonymous"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct KillAnonymous { - pub spawner: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::rococo_runtime::ProxyType, - pub index: ::core::primitive::u16, - #[codec(compact)] - pub height: ::core::primitive::u32, - #[codec(compact)] - pub ext_index: ::core::primitive::u32, - } - impl ::subxt::Call for KillAnonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "kill_anonymous"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Announce { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for Announce { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "announce"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RemoveAnnouncement { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RemoveAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_announcement"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RejectAnnouncement { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Call for RejectAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "reject_announcement"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ProxyAnnounced { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: - ::core::option::Option, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy_announced"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn proxy( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::rococo_runtime::ProxyType, - >, - call: runtime_types::rococo_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Proxy, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 18u8, 83u8, 53u8, 86u8, 243u8, 116u8, 243u8, 62u8, 36u8, 219u8, 202u8, - 53u8, 14u8, 164u8, 185u8, 154u8, 213u8, 196u8, 108u8, 34u8, 174u8, - 244u8, 39u8, 148u8, 71u8, 169u8, 227u8, 106u8, 20u8, 191u8, 119u8, - 43u8, - ] - { - let call = Proxy { - real, - force_proxy_type, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] - #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn add_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AddProxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 147u8, 160u8, 155u8, 162u8, 94u8, 114u8, 60u8, 178u8, 78u8, 235u8, 9u8, - 249u8, 180u8, 152u8, 73u8, 248u8, 238u8, 155u8, 114u8, 32u8, 247u8, - 146u8, 16u8, 94u8, 135u8, 118u8, 13u8, 77u8, 78u8, 69u8, 200u8, 251u8, - ] - { - let call = AddProxy { - delegate, - proxy_type, - delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unregister a proxy account for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] - #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn remove_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveProxy, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 76u8, 45u8, 70u8, 255u8, 181u8, 17u8, 146u8, 110u8, 26u8, 44u8, 191u8, - 48u8, 244u8, 61u8, 163u8, 235u8, 202u8, 184u8, 160u8, 156u8, 130u8, - 47u8, 35u8, 206u8, 12u8, 103u8, 25u8, 27u8, 129u8, 119u8, 162u8, 157u8, - ] - { - let call = RemoveProxy { - delegate, - proxy_type, - delay, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Unregister all proxy accounts for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] - #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn remove_proxies( - &self, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveProxies, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 15u8, 237u8, 27u8, 166u8, 254u8, 218u8, 92u8, 5u8, 213u8, 239u8, 99u8, - 59u8, 1u8, 26u8, 73u8, 252u8, 81u8, 94u8, 214u8, 227u8, 169u8, 58u8, - 40u8, 253u8, 187u8, 225u8, 192u8, 26u8, 19u8, 23u8, 121u8, 129u8, - ] - { - let call = RemoveProxies {}; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] - #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] - #[doc = ""] - #[doc = "Requires a `Signed` origin."] - #[doc = ""] - #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] - #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] - #[doc = "allow for maximum flexibility."] - #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] - #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] - #[doc = "want to use `0`."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] - #[doc = "same sender, with the same parameters."] - #[doc = ""] - #[doc = "Fails if there are insufficient funds to pay for deposit."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - #[doc = "TODO: Might be over counting 1 read"] - pub fn anonymous( - &self, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - index: ::core::primitive::u16, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Anonymous, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 196u8, 87u8, 202u8, 253u8, 227u8, 15u8, 4u8, 65u8, 86u8, 235u8, 205u8, - 19u8, 248u8, 108u8, 61u8, 206u8, 108u8, 178u8, 123u8, 154u8, 200u8, - 189u8, 124u8, 10u8, 251u8, 86u8, 5u8, 21u8, 172u8, 201u8, 4u8, 176u8, - ] - { - let call = Anonymous { - proxy_type, - delay, - index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Removes a previously spawned anonymous proxy."] - #[doc = ""] - #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] - #[doc = "inaccessible."] - #[doc = ""] - #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`anonymous` with corresponding parameters."] - #[doc = ""] - #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] - #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] - #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] - #[doc = "account whose `anonymous` call has corresponding parameters."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn kill_anonymous( - &self, - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - index: ::core::primitive::u16, - height: ::core::primitive::u32, - ext_index: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - KillAnonymous, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 165u8, 240u8, 108u8, 74u8, 96u8, 200u8, 186u8, 64u8, 56u8, 175u8, - 123u8, 106u8, 122u8, 165u8, 200u8, 20u8, 93u8, 30u8, 93u8, 210u8, 89u8, - 108u8, 13u8, 180u8, 143u8, 218u8, 157u8, 135u8, 111u8, 9u8, 42u8, 18u8, - ] - { - let call = KillAnonymous { - spawner, - proxy_type, - index, - height, - ext_index, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Publish the hash of a proxy-call that will be made in the future."] - #[doc = ""] - #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] - #[doc = "if the delay associated with the proxy relationship is greater than zero."] - #[doc = ""] - #[doc = "No more than `MaxPending` announcements may be made at any one time."] - #[doc = ""] - #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] - #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn announce( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Announce, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 102u8, 8u8, 136u8, 179u8, 13u8, 47u8, 158u8, 24u8, 93u8, 196u8, 52u8, - 22u8, 118u8, 98u8, 17u8, 8u8, 12u8, 51u8, 181u8, 75u8, 215u8, 133u8, - 201u8, 180u8, 231u8, 122u8, 198u8, 190u8, 188u8, 127u8, 228u8, 218u8, - ] - { - let call = Announce { real, call_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove a given announcement."] - #[doc = ""] - #[doc = "May be called by a proxy account to remove a call they previously announced and return"] - #[doc = "the deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn remove_announcement( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RemoveAnnouncement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 209u8, 156u8, 215u8, 188u8, 225u8, 230u8, 171u8, 228u8, 241u8, 105u8, - 43u8, 183u8, 234u8, 18u8, 170u8, 239u8, 232u8, 188u8, 37u8, 84u8, - 156u8, 50u8, 241u8, 170u8, 9u8, 148u8, 185u8, 172u8, 204u8, 63u8, - 187u8, 253u8, - ] - { - let call = RemoveAnnouncement { real, call_hash }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Remove the given announcement of a delegate."] - #[doc = ""] - #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] - #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `delegate`: The account that previously announced the call."] - #[doc = "- `call_hash`: The hash of the call to be made."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn reject_announcement( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - RejectAnnouncement, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 26u8, 67u8, 197u8, 169u8, 243u8, 11u8, 94u8, 153u8, 50u8, 22u8, 176u8, - 103u8, 88u8, 2u8, 13u8, 10u8, 96u8, 7u8, 121u8, 148u8, 13u8, 96u8, - 20u8, 67u8, 76u8, 51u8, 81u8, 54u8, 244u8, 44u8, 94u8, 52u8, - ] - { - let call = RejectAnnouncement { - delegate, - call_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - pub fn proxy_announced( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::rococo_runtime::ProxyType, - >, - call: runtime_types::rococo_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ProxyAnnounced, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 58u8, 66u8, 186u8, 179u8, 146u8, 124u8, 9u8, 6u8, 61u8, 184u8, 96u8, - 144u8, 234u8, 169u8, 63u8, 241u8, 239u8, 64u8, 71u8, 133u8, 100u8, - 212u8, 253u8, 213u8, 90u8, 160u8, 162u8, 71u8, 162u8, 141u8, 20u8, - 161u8, - ] - { - let call = ProxyAnnounced { - delegate, - real, - force_proxy_type, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_proxy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A proxy was executed correctly, with the given."] - pub struct ProxyExecuted { - pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for ProxyExecuted { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyExecuted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Anonymous account has been created by new proxy with given"] - #[doc = "disambiguation index and proxy type."] - pub struct AnonymousCreated { - pub anonymous: ::subxt::sp_core::crypto::AccountId32, - pub who: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::rococo_runtime::ProxyType, - pub disambiguation_index: ::core::primitive::u16, - } - impl ::subxt::Event for AnonymousCreated { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "AnonymousCreated"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An announcement was placed to make a call in the future."] - pub struct Announced { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub proxy: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for Announced { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "Announced"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A proxy was added."] - pub struct ProxyAdded { - pub delegator: ::subxt::sp_core::crypto::AccountId32, - pub delegatee: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::rococo_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Event for ProxyAdded { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyAdded"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A proxy was removed."] - pub struct ProxyRemoved { - pub delegator: ::subxt::sp_core::crypto::AccountId32, - pub delegatee: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::rococo_runtime::ProxyType, - pub delay: ::core::primitive::u32, - } - impl ::subxt::Event for ProxyRemoved { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyRemoved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proxies<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Proxies<'_> { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Proxies"; - type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::ProxyType, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Announcements<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Announcements<'_> { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Announcements"; - type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[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 async fn proxies( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::ProxyType, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 6u8, 154u8, 57u8, 61u8, 169u8, 15u8, 54u8, 128u8, 62u8, 67u8, 181u8, - 251u8, 172u8, 194u8, 97u8, 9u8, 141u8, 230u8, 243u8, 33u8, 25u8, 29u8, - 46u8, 136u8, 208u8, 192u8, 147u8, 168u8, 57u8, 18u8, 155u8, 80u8, - ] - { - let entry = Proxies(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn proxies_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Proxies<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 6u8, 154u8, 57u8, 61u8, 169u8, 15u8, 54u8, 128u8, 62u8, 67u8, 181u8, - 251u8, 172u8, 194u8, 97u8, 9u8, 141u8, 230u8, 243u8, 33u8, 25u8, 29u8, - 46u8, 136u8, 208u8, 192u8, 147u8, 168u8, 57u8, 18u8, 155u8, 80u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The announcements made by the proxy (key)."] - pub async fn announcements( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ), - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 247u8, 243u8, 109u8, 142u8, 99u8, 156u8, 61u8, 101u8, 200u8, 211u8, - 158u8, 60u8, 159u8, 232u8, 147u8, 125u8, 139u8, 150u8, 4u8, 129u8, - 189u8, 117u8, 74u8, 32u8, 85u8, 39u8, 46u8, 47u8, 164u8, 130u8, 254u8, - 43u8, - ] - { - let entry = Announcements(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The announcements made by the proxy (key)."] - pub async fn announcements_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Announcements<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 247u8, 243u8, 109u8, 142u8, 99u8, 156u8, 61u8, 101u8, 200u8, 211u8, - 158u8, 60u8, 159u8, 232u8, 147u8, 125u8, 139u8, 150u8, 4u8, 129u8, - 189u8, 117u8, 74u8, 32u8, 85u8, 39u8, 46u8, 47u8, 164u8, 130u8, 254u8, - 43u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The base amount of currency needed to reserve for creating a proxy."] - #[doc = ""] - #[doc = " This is held for an additional storage item whose value size is"] - #[doc = " `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes."] - pub fn proxy_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Proxy", "ProxyDepositBase")? - == [ - 126u8, 107u8, 187u8, 250u8, 199u8, 131u8, 62u8, 248u8, 122u8, 95u8, - 138u8, 186u8, 61u8, 129u8, 237u8, 236u8, 225u8, 91u8, 255u8, 54u8, - 183u8, 34u8, 103u8, 35u8, 145u8, 9u8, 1u8, 71u8, 124u8, 220u8, 147u8, - 88u8, - ] - { - let pallet = locked_metadata.pallet("Proxy")?; - let constant = pallet.constant("ProxyDepositBase")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of currency needed per proxy added."] - #[doc = ""] - #[doc = " This is held for adding 32 bytes plus an instance of `ProxyType` more into a"] - #[doc = " pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take"] - #[doc = " into account `32 + proxy_type.encode().len()` bytes of data."] - pub fn proxy_deposit_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Proxy", "ProxyDepositFactor")? - == [ - 241u8, 48u8, 216u8, 37u8, 136u8, 147u8, 59u8, 234u8, 27u8, 8u8, 138u8, - 46u8, 158u8, 190u8, 141u8, 172u8, 176u8, 158u8, 46u8, 109u8, 188u8, - 240u8, 122u8, 122u8, 83u8, 127u8, 29u8, 89u8, 173u8, 110u8, 7u8, 5u8, - ] - { - let pallet = locked_metadata.pallet("Proxy")?; - let constant = pallet.constant("ProxyDepositFactor")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum amount of proxies allowed for a single account."] - pub fn max_proxies( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Proxy", "MaxProxies")? - == [ - 249u8, 153u8, 224u8, 128u8, 161u8, 3u8, 39u8, 192u8, 120u8, 150u8, - 184u8, 92u8, 225u8, 222u8, 76u8, 172u8, 131u8, 87u8, 231u8, 128u8, 5u8, - 62u8, 116u8, 112u8, 103u8, 4u8, 39u8, 163u8, 71u8, 97u8, 221u8, 19u8, - ] - { - let pallet = locked_metadata.pallet("Proxy")?; - let constant = pallet.constant("MaxProxies")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum amount of time-delayed announcements that are allowed to be pending."] - pub fn max_pending( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Proxy", "MaxPending")? - == [ - 88u8, 148u8, 146u8, 152u8, 151u8, 208u8, 255u8, 193u8, 239u8, 105u8, - 197u8, 153u8, 151u8, 18u8, 86u8, 13u8, 242u8, 242u8, 59u8, 92u8, 107u8, - 203u8, 102u8, 69u8, 147u8, 147u8, 37u8, 83u8, 237u8, 9u8, 114u8, 196u8, - ] - { - let pallet = locked_metadata.pallet("Proxy")?; - let constant = pallet.constant("MaxPending")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The base amount of currency needed to reserve for creating an announcement."] - #[doc = ""] - #[doc = " This is held when a new storage item holding a `Balance` is created (typically 16"] - #[doc = " bytes)."] - pub fn announcement_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Proxy", "AnnouncementDepositBase")? - == [ - 190u8, 15u8, 203u8, 82u8, 114u8, 33u8, 225u8, 62u8, 89u8, 39u8, 218u8, - 69u8, 217u8, 120u8, 4u8, 235u8, 209u8, 97u8, 119u8, 86u8, 157u8, 178u8, - 64u8, 170u8, 102u8, 187u8, 251u8, 125u8, 20u8, 181u8, 6u8, 102u8, - ] - { - let pallet = locked_metadata.pallet("Proxy")?; - let constant = pallet.constant("AnnouncementDepositBase")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of currency needed per announcement made."] - #[doc = ""] - #[doc = " This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)"] - #[doc = " into a pre-existing storage value."] - pub fn announcement_deposit_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Proxy", "AnnouncementDepositFactor")? - == [ - 240u8, 165u8, 11u8, 46u8, 237u8, 248u8, 133u8, 48u8, 240u8, 235u8, - 26u8, 59u8, 42u8, 72u8, 18u8, 252u8, 167u8, 16u8, 15u8, 168u8, 197u8, - 45u8, 57u8, 49u8, 173u8, 31u8, 180u8, 27u8, 64u8, 94u8, 139u8, 251u8, - ] - { - let pallet = locked_metadata.pallet("Proxy")?; - let constant = pallet.constant("AnnouncementDepositFactor")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod multisig { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AsMultiThreshold1 { - pub other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub call: ::std::boxed::Box, - } - impl ::subxt::Call for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi_threshold_1"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AsMulti { - pub threshold: ::core::primitive::u16, - pub other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - pub call: ::subxt::WrapperKeepOpaque, - pub store_call: ::core::primitive::bool, - pub max_weight: ::core::primitive::u64, - } - impl ::subxt::Call for AsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ApproveAsMulti { - pub threshold: ::core::primitive::u16, - pub other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - pub call_hash: [::core::primitive::u8; 32usize], - pub max_weight: ::core::primitive::u64, - } - impl ::subxt::Call for ApproveAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "approve_as_multi"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CancelAsMulti { - pub threshold: ::core::primitive::u16, - pub other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Call for CancelAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "cancel_as_multi"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = "multi-signature, but do not participate in the approval process."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result."] - #[doc = ""] - #[doc = "# "] - #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight: None"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - pub fn as_multi_threshold_1( - &self, - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - call: runtime_types::rococo_runtime::Call, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsMultiThreshold1, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 94u8, 166u8, 78u8, 27u8, 200u8, 192u8, 21u8, 36u8, 3u8, 242u8, 123u8, - 37u8, 25u8, 157u8, 14u8, 154u8, 92u8, 91u8, 44u8, 252u8, 222u8, 239u8, - 170u8, 196u8, 189u8, 17u8, 250u8, 75u8, 167u8, 25u8, 138u8, 93u8, - ] - { - let call = AsMultiThreshold1 { - other_signatories, - call: ::std::boxed::Box::new(call), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "If there are enough, then dispatch the call."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] - #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] - #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] - #[doc = "may be found in the deposited `MultisigExecuted` event."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S + Z + Call)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- The weight of the `call`."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - pub fn as_multi( - &self, - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - call: ::subxt::WrapperKeepOpaque, - store_call: ::core::primitive::bool, - max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - AsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 38u8, 251u8, 199u8, 81u8, 228u8, 223u8, 200u8, 188u8, 119u8, 214u8, - 46u8, 81u8, 191u8, 12u8, 45u8, 110u8, 197u8, 121u8, 22u8, 238u8, 61u8, - 246u8, 246u8, 7u8, 47u8, 242u8, 167u8, 194u8, 66u8, 98u8, 167u8, 112u8, - ] - { - let call = AsMulti { - threshold, - other_signatories, - maybe_timepoint, - call, - store_call, - max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account]"] - #[doc = " - Write: Multisig Storage, [Caller Account]"] - #[doc = "# "] - pub fn approve_as_multi( - &self, - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - call_hash: [::core::primitive::u8; 32usize], - max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ApproveAsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 114u8, 29u8, 118u8, 154u8, 91u8, 4u8, 127u8, 126u8, 190u8, 180u8, 57u8, - 112u8, 72u8, 8u8, 248u8, 126u8, 25u8, 190u8, 130u8, 86u8, 160u8, 164u8, - 76u8, 64u8, 25u8, 175u8, 132u8, 225u8, 147u8, 166u8, 12u8, 38u8, - ] - { - let call = ApproveAsMulti { - threshold, - other_signatories, - maybe_timepoint, - call_hash, - max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] - #[doc = "for this operation will be unreserved on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] - #[doc = "transaction for this dispatch."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- One event."] - #[doc = "- I/O: 1 read `O(S)`, one remove."] - #[doc = "- Storage: removes one item."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = "# "] - pub fn cancel_as_multi( - &self, - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - call_hash: [::core::primitive::u8; 32usize], - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - CancelAsMulti, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 195u8, 216u8, 37u8, 179u8, 9u8, 19u8, 238u8, 94u8, 156u8, 5u8, 120u8, - 78u8, 129u8, 99u8, 239u8, 142u8, 68u8, 12u8, 254u8, 46u8, 251u8, 8u8, - 193u8, 43u8, 37u8, 68u8, 249u8, 85u8, 163u8, 85u8, 193u8, 47u8, - ] - { - let call = CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_multisig::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A new multisig operation has begun."] - pub struct NewMultisig { - pub approving: ::subxt::sp_core::crypto::AccountId32, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Event for NewMultisig { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "NewMultisig"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A multisig operation has been approved by someone."] - pub struct MultisigApproval { - pub approving: ::subxt::sp_core::crypto::AccountId32, - pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Event for MultisigApproval { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigApproval"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A multisig operation has been executed."] - pub struct MultisigExecuted { - pub approving: ::subxt::sp_core::crypto::AccountId32, - pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::Event for MultisigExecuted { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigExecuted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A multisig operation has been cancelled."] - pub struct MultisigCancelled { - pub cancelling: ::subxt::sp_core::crypto::AccountId32, - pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub multisig: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: [::core::primitive::u8; 32usize], - } - impl ::subxt::Event for MultisigCancelled { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigCancelled"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Multisigs<'a>( - pub &'a ::subxt::sp_core::crypto::AccountId32, - pub &'a [::core::primitive::u8; 32usize], - ); - impl ::subxt::StorageEntry for Multisigs<'_> { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Multisigs"; - type Value = runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Calls<'a>(pub &'a [::core::primitive::u8; 32usize]); - impl ::subxt::StorageEntry for Calls<'_> { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Calls"; - type Value = ( - ::subxt::WrapperKeepOpaque, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The set of open multisig operations."] - pub async fn multisigs( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - _1: &[::core::primitive::u8; 32usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_multisig::Multisig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 137u8, 130u8, 173u8, 65u8, 126u8, 244u8, 194u8, 167u8, 93u8, 174u8, - 104u8, 131u8, 115u8, 155u8, 93u8, 185u8, 54u8, 204u8, 155u8, 149u8, - 184u8, 24u8, 111u8, 40u8, 249u8, 215u8, 34u8, 251u8, 224u8, 110u8, - 202u8, 2u8, - ] - { - let entry = Multisigs(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The set of open multisig operations."] - pub async fn multisigs_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Multisigs<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 137u8, 130u8, 173u8, 65u8, 126u8, 244u8, 194u8, 167u8, 93u8, 174u8, - 104u8, 131u8, 115u8, 155u8, 93u8, 185u8, 54u8, 204u8, 155u8, 149u8, - 184u8, 24u8, 111u8, 40u8, 249u8, 215u8, 34u8, 251u8, 224u8, 110u8, - 202u8, 2u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn calls( - &self, - _0: &[::core::primitive::u8; 32usize], - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::WrapperKeepOpaque, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 206u8, 127u8, 10u8, 116u8, 146u8, 156u8, 210u8, 49u8, 248u8, 139u8, - 117u8, 62u8, 21u8, 116u8, 13u8, 208u8, 129u8, 150u8, 83u8, 88u8, 106u8, - 108u8, 181u8, 227u8, 94u8, 111u8, 218u8, 194u8, 20u8, 113u8, 130u8, - 175u8, - ] - { - let entry = Calls(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - pub async fn calls_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Calls<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 206u8, 127u8, 10u8, 116u8, 146u8, 156u8, 210u8, 49u8, 248u8, 139u8, - 117u8, 62u8, 21u8, 116u8, 13u8, 208u8, 129u8, 150u8, 83u8, 88u8, 106u8, - 108u8, 181u8, 227u8, 94u8, 111u8, 218u8, 194u8, 20u8, 113u8, 130u8, - 175u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The base amount of currency needed to reserve for creating a multisig execution or to"] - #[doc = " store a dispatch call for later."] - #[doc = ""] - #[doc = " This is held for an additional storage item whose value size is"] - #[doc = " `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is"] - #[doc = " `32 + sizeof(AccountId)` bytes."] - pub fn deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Multisig", "DepositBase")? - == [ - 71u8, 154u8, 198u8, 152u8, 162u8, 128u8, 229u8, 128u8, 60u8, 108u8, - 172u8, 247u8, 145u8, 8u8, 159u8, 25u8, 36u8, 141u8, 28u8, 67u8, 30u8, - 14u8, 194u8, 98u8, 125u8, 161u8, 148u8, 41u8, 67u8, 120u8, 78u8, 162u8, - ] - { - let pallet = locked_metadata.pallet("Multisig")?; - let constant = pallet.constant("DepositBase")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The amount of currency needed per unit threshold when creating a multisig execution."] - #[doc = ""] - #[doc = " This is held for adding 32 bytes more into a pre-existing storage value."] - pub fn deposit_factor( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Multisig", "DepositFactor")? - == [ - 248u8, 238u8, 23u8, 116u8, 115u8, 32u8, 128u8, 25u8, 153u8, 128u8, - 14u8, 55u8, 124u8, 103u8, 61u8, 140u8, 106u8, 176u8, 226u8, 232u8, - 255u8, 246u8, 68u8, 23u8, 111u8, 168u8, 45u8, 130u8, 182u8, 15u8, 66u8, - 64u8, - ] - { - let pallet = locked_metadata.pallet("Multisig")?; - let constant = pallet.constant("DepositFactor")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The maximum amount of signatories allowed in the multisig."] - pub fn max_signatories( - &self, - ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> - { - let locked_metadata = self.client.metadata(); - if locked_metadata.constant_hash("Multisig", "MaxSignatories")? - == [ - 139u8, 36u8, 140u8, 198u8, 176u8, 106u8, 89u8, 194u8, 33u8, 23u8, 60u8, - 134u8, 143u8, 24u8, 176u8, 64u8, 47u8, 109u8, 159u8, 134u8, 240u8, - 231u8, 181u8, 146u8, 136u8, 249u8, 175u8, 67u8, 41u8, 152u8, 90u8, - 15u8, - ] - { - let pallet = locked_metadata.pallet("Multisig")?; - let constant = pallet.constant("MaxSignatories")?; - let value = ::subxt::codec::Decode::decode(&mut &constant.value[..])?; - Ok(value) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod xcm_pallet { - use super::root_mod; - use super::runtime_types; - pub mod calls { - use super::root_mod; - use super::runtime_types; - type DispatchError = runtime_types::sp_runtime::DispatchError; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Send { - pub dest: ::std::boxed::Box, - pub message: ::std::boxed::Box, - } - impl ::subxt::Call for Send { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "send"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct TeleportAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - } - impl ::subxt::Call for TeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "teleport_assets"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReserveTransferAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - } - impl ::subxt::Call for ReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "reserve_transfer_assets"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Execute { - pub message: ::std::boxed::Box, - pub max_weight: ::core::primitive::u64, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceXcmVersion { - pub location: - ::std::boxed::Box, - pub xcm_version: ::core::primitive::u32, - } - impl ::subxt::Call for ForceXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_xcm_version"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceDefaultXcmVersion { - pub maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - } - impl ::subxt::Call for ForceDefaultXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_default_xcm_version"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceSubscribeVersionNotify { - pub location: ::std::boxed::Box, - } - impl ::subxt::Call for ForceSubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_subscribe_version_notify"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ForceUnsubscribeVersionNotify { - pub location: ::std::boxed::Box, - } - impl ::subxt::Call for ForceUnsubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_unsubscribe_version_notify"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct LimitedReserveTransferAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - pub weight_limit: runtime_types::xcm::v2::WeightLimit, - } - impl ::subxt::Call for LimitedReserveTransferAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "limited_reserve_transfer_assets"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct LimitedTeleportAssets { - pub dest: ::std::boxed::Box, - pub beneficiary: ::std::boxed::Box, - pub assets: ::std::boxed::Box, - pub fee_asset_item: ::core::primitive::u32, - pub weight_limit: runtime_types::xcm::v2::WeightLimit, - } - impl ::subxt::Call for LimitedTeleportAssets { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "limited_teleport_assets"; - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - pub fn send( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - message: runtime_types::xcm::VersionedXcm, - ) -> Result< - ::subxt::SubmittableExtrinsic<'a, T, X, Send, DispatchError, root_mod::Event>, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 232u8, 188u8, 205u8, 27u8, 92u8, 141u8, 251u8, 24u8, 90u8, 155u8, 20u8, - 139u8, 7u8, 160u8, 39u8, 85u8, 205u8, 11u8, 111u8, 1u8, 250u8, 168u8, - 134u8, 61u8, 19u8, 216u8, 239u8, 127u8, 137u8, 136u8, 48u8, 19u8, - ] - { - let call = Send { - dest: ::std::boxed::Box::new(dest), - message: ::std::boxed::Box::new(message), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub fn teleport_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - TeleportAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 55u8, 192u8, 217u8, 186u8, 230u8, 234u8, 26u8, 194u8, 243u8, 199u8, - 16u8, 227u8, 225u8, 88u8, 130u8, 219u8, 228u8, 110u8, 20u8, 255u8, - 233u8, 147u8, 121u8, 173u8, 126u8, 248u8, 192u8, 243u8, 211u8, 91u8, - 115u8, 148u8, - ] - { - let call = TeleportAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - pub fn reserve_transfer_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ReserveTransferAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 134u8, 229u8, 104u8, 209u8, 160u8, 7u8, 99u8, 175u8, 128u8, 110u8, - 189u8, 225u8, 141u8, 1u8, 10u8, 17u8, 247u8, 233u8, 146u8, 19u8, 31u8, - 145u8, 217u8, 144u8, 85u8, 223u8, 197u8, 249u8, 1u8, 222u8, 98u8, 13u8, - ] - { - let call = ReserveTransferAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Execute an XCM message from a local, signed, origin."] - #[doc = ""] - #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] - #[doc = "partially."] - #[doc = ""] - #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than the"] - #[doc = "maximum amount of weight that the message could take to be executed, then no execution"] - #[doc = "attempt will be made."] - #[doc = ""] - #[doc = "NOTE: A successful return to this does *not* imply that the `msg` was executed successfully"] - #[doc = "to completion; only that *some* of it was executed."] - pub fn execute( - &self, - message: runtime_types::xcm::VersionedXcm, - max_weight: ::core::primitive::u64, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - Execute, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 95u8, 48u8, 201u8, 232u8, 83u8, 23u8, 20u8, 126u8, 116u8, 116u8, 176u8, - 206u8, 145u8, 9u8, 155u8, 109u8, 141u8, 226u8, 253u8, 196u8, 37u8, - 230u8, 243u8, 68u8, 39u8, 133u8, 233u8, 108u8, 226u8, 87u8, 5u8, 247u8, - ] - { - let call = Execute { - message: ::std::boxed::Box::new(message), - max_weight, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Extoll that a particular destination can be communicated with through a particular"] - #[doc = "version of XCM."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The destination that is being described."] - #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] - pub fn force_xcm_version( - &self, - location: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm_version: ::core::primitive::u32, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceXcmVersion, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 32u8, 219u8, 213u8, 152u8, 203u8, 73u8, 121u8, 64u8, 78u8, 53u8, 110u8, - 23u8, 87u8, 93u8, 34u8, 166u8, 205u8, 189u8, 25u8, 160u8, 172u8, 178u8, - 125u8, 182u8, 37u8, 254u8, 220u8, 179u8, 70u8, 252u8, 63u8, 94u8, - ] - { - let call = ForceXcmVersion { - location: ::std::boxed::Box::new(location), - xcm_version, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] - #[doc = "version a destination can accept is unknown)."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] - pub fn force_default_xcm_version( - &self, - maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceDefaultXcmVersion, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 44u8, 161u8, 28u8, 189u8, 162u8, 221u8, 14u8, 31u8, 8u8, 211u8, 181u8, - 51u8, 197u8, 14u8, 87u8, 198u8, 3u8, 240u8, 90u8, 78u8, 141u8, 131u8, - 205u8, 250u8, 211u8, 150u8, 237u8, 160u8, 239u8, 226u8, 233u8, 29u8, - ] - { - let call = ForceDefaultXcmVersion { maybe_xcm_version }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] - pub fn force_subscribe_version_notify( - &self, - location: runtime_types::xcm::VersionedMultiLocation, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceSubscribeVersionNotify, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 41u8, 248u8, 187u8, 195u8, 146u8, 143u8, 0u8, 246u8, 248u8, 38u8, - 128u8, 200u8, 143u8, 149u8, 127u8, 73u8, 3u8, 247u8, 106u8, 6u8, 56u8, - 50u8, 207u8, 234u8, 137u8, 201u8, 16u8, 21u8, 226u8, 148u8, 181u8, - 44u8, - ] - { - let call = ForceSubscribeVersionNotify { - location: ::std::boxed::Box::new(location), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] - #[doc = "version changes."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] - #[doc = " notifications which we no longer desire."] - pub fn force_unsubscribe_version_notify( - &self, - location: runtime_types::xcm::VersionedMultiLocation, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - ForceUnsubscribeVersionNotify, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 150u8, 202u8, 148u8, 13u8, 187u8, 169u8, 5u8, 60u8, 25u8, 144u8, 43u8, - 196u8, 35u8, 215u8, 184u8, 72u8, 143u8, 220u8, 176u8, 27u8, 100u8, - 245u8, 31u8, 243u8, 0u8, 83u8, 165u8, 7u8, 102u8, 172u8, 218u8, 133u8, - ] - { - let call = ForceUnsubscribeVersionNotify { - location: ::std::boxed::Box::new(location), - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn limited_reserve_transfer_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - LimitedReserveTransferAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 242u8, 206u8, 126u8, 164u8, 44u8, 116u8, 181u8, 90u8, 121u8, 124u8, - 120u8, 240u8, 129u8, 217u8, 131u8, 100u8, 248u8, 149u8, 56u8, 154u8, - 35u8, 91u8, 210u8, 118u8, 207u8, 110u8, 42u8, 249u8, 160u8, 155u8, - 251u8, 68u8, - ] - { - let call = LimitedReserveTransferAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - pub fn limited_teleport_assets( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - beneficiary: runtime_types::xcm::VersionedMultiLocation, - assets: runtime_types::xcm::VersionedMultiAssets, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - ) -> Result< - ::subxt::SubmittableExtrinsic< - 'a, - T, - X, - LimitedTeleportAssets, - DispatchError, - root_mod::Event, - >, - ::subxt::BasicError, - > { - let runtime_call_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.call_hash::()? - }; - if runtime_call_hash - == [ - 189u8, 233u8, 43u8, 16u8, 158u8, 114u8, 154u8, 233u8, 179u8, 144u8, - 81u8, 179u8, 169u8, 38u8, 4u8, 130u8, 95u8, 237u8, 172u8, 167u8, 2u8, - 169u8, 53u8, 252u8, 159u8, 42u8, 143u8, 216u8, 112u8, 155u8, 48u8, - 129u8, - ] - { - let call = LimitedTeleportAssets { - dest: ::std::boxed::Box::new(dest), - beneficiary: ::std::boxed::Box::new(beneficiary), - assets: ::std::boxed::Box::new(assets), - fee_asset_item, - weight_limit, - }; - Ok(::subxt::SubmittableExtrinsic::new(self.client, call)) - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - pub type Event = runtime_types::pallet_xcm::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Execution of an XCM message was attempted."] - #[doc = ""] - #[doc = "\\[ outcome \\]"] - pub struct Attempted(pub runtime_types::xcm::v2::traits::Outcome); - impl ::subxt::Event for Attempted { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Attempted"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A XCM message was sent."] - #[doc = ""] - #[doc = "\\[ origin, destination, message \\]"] - pub struct Sent( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub runtime_types::xcm::v2::Xcm, - ); - impl ::subxt::Event for Sent { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Sent"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Query response received which does not match a registered query. This may be because a"] - #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] - #[doc = "because the query timed out."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - pub struct UnexpectedResponse( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for UnexpectedResponse { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "UnexpectedResponse"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] - #[doc = "no registered notification call."] - #[doc = ""] - #[doc = "\\[ id, response \\]"] - pub struct ResponseReady( - pub ::core::primitive::u64, - pub runtime_types::xcm::v2::Response, - ); - impl ::subxt::Event for ResponseReady { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "ResponseReady"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Query response has been received and query is removed. The registered notification has"] - #[doc = "been dispatched and executed successfully."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - pub struct Notified( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - ); - impl ::subxt::Event for Notified { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "Notified"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Query response has been received and query is removed. The registered notification could"] - #[doc = "not be dispatched because the dispatch weight is greater than the maximum weight"] - #[doc = "originally budgeted by this runtime for the query result."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index, actual weight, max budgeted weight \\]"] - pub struct NotifyOverweight( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - pub ::core::primitive::u64, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for NotifyOverweight { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyOverweight"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Query response has been received and query is removed. There was a general error with"] - #[doc = "dispatching the notification call."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - pub struct NotifyDispatchError( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - ); - impl ::subxt::Event for NotifyDispatchError { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyDispatchError"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] - #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] - #[doc = "is not `(origin, QueryId, Response)`."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - pub struct NotifyDecodeFailed( - pub ::core::primitive::u64, - pub ::core::primitive::u8, - pub ::core::primitive::u8, - ); - impl ::subxt::Event for NotifyDecodeFailed { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyDecodeFailed"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Expected query response has been received but the origin location of the response does"] - #[doc = "not match that expected. The query remains registered for a later, valid, response to"] - #[doc = "be received and acted upon."] - #[doc = ""] - #[doc = "\\[ origin location, id, expected location \\]"] - pub struct InvalidResponder( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - pub ::core::option::Option, - ); - impl ::subxt::Event for InvalidResponder { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidResponder"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Expected query response has been received but the expected origin location placed in"] - #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] - #[doc = ""] - #[doc = "This is unexpected (since a location placed in storage in a previously executing"] - #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] - #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] - #[doc = "needed."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - pub struct InvalidResponderVersion( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for InvalidResponderVersion { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidResponderVersion"; - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - #[doc = "Received query response has been read and removed."] - #[doc = ""] - #[doc = "\\[ id \\]"] - pub struct ResponseTaken(pub ::core::primitive::u64); - impl ::subxt::Event for ResponseTaken { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "ResponseTaken"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "Some assets have been placed in an asset trap."] - #[doc = ""] - #[doc = "\\[ hash, origin, assets \\]"] - pub struct AssetsTrapped( - pub ::subxt::sp_core::H256, - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub runtime_types::xcm::VersionedMultiAssets, - ); - impl ::subxt::Event for AssetsTrapped { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "AssetsTrapped"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "An XCM version change notification message has been attempted to be sent."] - #[doc = ""] - #[doc = "\\[ destination, result \\]"] - pub struct VersionChangeNotified( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for VersionChangeNotified { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "VersionChangeNotified"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "The supported version of a location has been changed. This might be through an"] - #[doc = "automatic notification or a manual intervention."] - #[doc = ""] - #[doc = "\\[ location, XCM version \\]"] - pub struct SupportedVersionChanged( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for SupportedVersionChanged { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "SupportedVersionChanged"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "sending the notification to it."] - #[doc = ""] - #[doc = "\\[ location, query ID, error \\]"] - pub struct NotifyTargetSendFail( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - pub runtime_types::xcm::v2::traits::Error, - ); - impl ::subxt::Event for NotifyTargetSendFail { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyTargetSendFail"; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "migrating the location to our new XCM format."] - #[doc = ""] - #[doc = "\\[ location, query ID \\]"] - pub struct NotifyTargetMigrationFail( - pub runtime_types::xcm::VersionedMultiLocation, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for NotifyTargetMigrationFail { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "NotifyTargetMigrationFail"; - } - } - pub mod storage { - use super::runtime_types; - pub struct QueryCounter; - impl ::subxt::StorageEntry for QueryCounter { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "QueryCounter"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Queries<'a>(pub &'a ::core::primitive::u64); - impl ::subxt::StorageEntry for Queries<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "Queries"; - type Value = runtime_types::pallet_xcm::pallet::QueryStatus<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct AssetTraps<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for AssetTraps<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "AssetTraps"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct SafeXcmVersion; - impl ::subxt::StorageEntry for SafeXcmVersion { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "SafeXcmVersion"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SupportedVersion<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for SupportedVersion<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "SupportedVersion"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionNotifiers<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for VersionNotifiers<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionNotifiers"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionNotifyTargets<'a>( - pub &'a ::core::primitive::u32, - pub &'a runtime_types::xcm::VersionedMultiLocation, - ); - impl ::subxt::StorageEntry for VersionNotifyTargets<'_> { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionNotifyTargets"; - type Value = ( - ::core::primitive::u64, - ::core::primitive::u64, - ::core::primitive::u32, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new(&self.0, ::subxt::StorageHasher::Twox64Concat), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct VersionDiscoveryQueue; - impl ::subxt::StorageEntry for VersionDiscoveryQueue { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "VersionDiscoveryQueue"; - type Value = runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentMigration; - impl ::subxt::StorageEntry for CurrentMigration { - const PALLET: &'static str = "XcmPallet"; - const STORAGE: &'static str = "CurrentMigration"; - type Value = runtime_types::pallet_xcm::pallet::VersionMigrationStage; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - #[doc = " The latest available query index."] - pub async fn query_counter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 137u8, 58u8, 184u8, 88u8, 247u8, 22u8, 151u8, 64u8, 50u8, 77u8, 49u8, - 10u8, 234u8, 84u8, 213u8, 156u8, 26u8, 200u8, 214u8, 225u8, 125u8, - 231u8, 42u8, 93u8, 159u8, 168u8, 86u8, 201u8, 116u8, 153u8, 41u8, - 127u8, - ] - { - let entry = QueryCounter; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The ongoing queries."] - pub async fn queries( - &self, - _0: &::core::primitive::u64, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::QueryStatus<::core::primitive::u32>, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 47u8, 241u8, 126u8, 71u8, 203u8, 121u8, 171u8, 226u8, 89u8, 17u8, 61u8, - 198u8, 123u8, 73u8, 20u8, 197u8, 6u8, 23u8, 34u8, 127u8, 89u8, 35u8, - 49u8, 101u8, 110u8, 15u8, 206u8, 203u8, 155u8, 93u8, 0u8, 97u8, - ] - { - let entry = Queries(_0); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The ongoing queries."] - pub async fn queries_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Queries<'a>>, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 47u8, 241u8, 126u8, 71u8, 203u8, 121u8, 171u8, 226u8, 89u8, 17u8, 61u8, - 198u8, 123u8, 73u8, 20u8, 197u8, 6u8, 23u8, 34u8, 127u8, 89u8, 35u8, - 49u8, 101u8, 110u8, 15u8, 206u8, 203u8, 155u8, 93u8, 0u8, 97u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The existing asset traps."] - #[doc = ""] - #[doc = " Key is the blake2 256 hash of (origin, versioned `MultiAssets`) pair. Value is the number of"] - #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] - pub async fn asset_traps( - &self, - _0: &::subxt::sp_core::H256, - block_hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 46u8, 170u8, 126u8, 101u8, 101u8, 243u8, 31u8, 53u8, 166u8, 45u8, 90u8, - 63u8, 2u8, 87u8, 36u8, 221u8, 101u8, 190u8, 51u8, 103u8, 66u8, 193u8, - 76u8, 224u8, 74u8, 160u8, 120u8, 212u8, 45u8, 230u8, 57u8, 122u8, - ] - { - let entry = AssetTraps(_0); - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The existing asset traps."] - #[doc = ""] - #[doc = " Key is the blake2 256 hash of (origin, versioned `MultiAssets`) pair. Value is the number of"] - #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] - pub async fn asset_traps_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AssetTraps<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 46u8, 170u8, 126u8, 101u8, 101u8, 243u8, 31u8, 53u8, 166u8, 45u8, 90u8, - 63u8, 2u8, 87u8, 36u8, 221u8, 101u8, 190u8, 51u8, 103u8, 66u8, 193u8, - 76u8, 224u8, 74u8, 160u8, 120u8, 212u8, 45u8, 230u8, 57u8, 122u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Default version to encode XCM when latest version of destination is unknown. If `None`,"] - #[doc = " then the destinations whose XCM version is unknown are considered unreachable."] - pub async fn safe_xcm_version( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 1u8, 223u8, 218u8, 204u8, 222u8, 129u8, 137u8, 237u8, 197u8, 142u8, - 233u8, 66u8, 229u8, 153u8, 138u8, 222u8, 113u8, 164u8, 135u8, 213u8, - 233u8, 34u8, 24u8, 23u8, 215u8, 59u8, 40u8, 188u8, 45u8, 244u8, 205u8, - 199u8, - ] - { - let entry = SafeXcmVersion; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The Latest versions that we know various locations support."] - pub async fn supported_version( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 231u8, 202u8, 129u8, 82u8, 121u8, 63u8, 67u8, 57u8, 191u8, 190u8, 25u8, - 27u8, 219u8, 42u8, 180u8, 142u8, 71u8, 119u8, 212u8, 211u8, 21u8, 11u8, - 8u8, 7u8, 9u8, 243u8, 11u8, 117u8, 66u8, 47u8, 246u8, 85u8, - ] - { - let entry = SupportedVersion(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The Latest versions that we know various locations support."] - pub async fn supported_version_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SupportedVersion<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 231u8, 202u8, 129u8, 82u8, 121u8, 63u8, 67u8, 57u8, 191u8, 190u8, 25u8, - 27u8, 219u8, 42u8, 180u8, 142u8, 71u8, 119u8, 212u8, 211u8, 21u8, 11u8, - 8u8, 7u8, 9u8, 243u8, 11u8, 117u8, 66u8, 47u8, 246u8, 85u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All locations that we have requested version notifications from."] - pub async fn version_notifiers( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u64>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 126u8, 49u8, 13u8, 135u8, 137u8, 68u8, 248u8, 211u8, 160u8, 160u8, - 93u8, 128u8, 157u8, 230u8, 62u8, 119u8, 191u8, 51u8, 147u8, 149u8, - 60u8, 227u8, 154u8, 97u8, 244u8, 249u8, 0u8, 220u8, 189u8, 92u8, 178u8, - 149u8, - ] - { - let entry = VersionNotifiers(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " All locations that we have requested version notifications from."] - pub async fn version_notifiers_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifiers<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 126u8, 49u8, 13u8, 135u8, 137u8, 68u8, 248u8, 211u8, 160u8, 160u8, - 93u8, 128u8, 157u8, 230u8, 62u8, 119u8, 191u8, 51u8, 147u8, 149u8, - 60u8, 227u8, 154u8, 97u8, 244u8, 249u8, 0u8, 220u8, 189u8, 92u8, 178u8, - 149u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn version_notify_targets( - &self, - _0: &::core::primitive::u32, - _1: &runtime_types::xcm::VersionedMultiLocation, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u64, - ::core::primitive::u64, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 251u8, 128u8, 243u8, 94u8, 162u8, 11u8, 206u8, 101u8, 33u8, 24u8, - 163u8, 157u8, 112u8, 50u8, 91u8, 155u8, 241u8, 73u8, 77u8, 185u8, - 231u8, 3u8, 220u8, 161u8, 36u8, 208u8, 116u8, 183u8, 80u8, 38u8, 56u8, - 104u8, - ] - { - let entry = VersionNotifyTargets(_0, _1); - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[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 async fn version_notify_targets_iter( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifyTargets<'a>>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 251u8, 128u8, 243u8, 94u8, 162u8, 11u8, 206u8, 101u8, 33u8, 24u8, - 163u8, 157u8, 112u8, 50u8, 91u8, 155u8, 241u8, 73u8, 77u8, 185u8, - 231u8, 3u8, 220u8, 161u8, 36u8, 208u8, 116u8, 183u8, 80u8, 38u8, 56u8, - 104u8, - ] - { - self.client.storage().iter(block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " Destinations whose latest XCM version we would like to know. Duplicates not allowed, and"] - #[doc = " the `u32` counter is the number of times that a send to the destination has been attempted,"] - #[doc = " which is used as a prioritization."] - pub async fn version_discovery_queue( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u32, - )>, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 45u8, 28u8, 29u8, 233u8, 239u8, 65u8, 24u8, 214u8, 153u8, 189u8, 132u8, - 235u8, 62u8, 197u8, 252u8, 56u8, 38u8, 97u8, 13u8, 16u8, 149u8, 25u8, - 252u8, 181u8, 206u8, 54u8, 250u8, 133u8, 133u8, 74u8, 186u8, 22u8, - ] - { - let entry = VersionDiscoveryQueue; - self.client - .storage() - .fetch_or_default(&entry, block_hash) - .await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - #[doc = " The current migration's stage, if any."] - pub async fn current_migration( - &self, - block_hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::VersionMigrationStage, - >, - ::subxt::BasicError, - > { - let runtime_storage_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.storage_hash::()? - }; - if runtime_storage_hash - == [ - 228u8, 254u8, 240u8, 20u8, 92u8, 79u8, 40u8, 65u8, 176u8, 111u8, 243u8, - 168u8, 238u8, 147u8, 247u8, 170u8, 185u8, 107u8, 58u8, 54u8, 224u8, - 222u8, 141u8, 113u8, 95u8, 92u8, 17u8, 69u8, 162u8, 242u8, 245u8, 95u8, - ] - { - let entry = CurrentMigration; - self.client.storage().fetch(&entry, block_hash).await - } else { - Err(::subxt::MetadataError::IncompatibleMetadata.into()) - } - } - } - } - } - pub mod runtime_types { - use super::runtime_types; - pub mod beefy_primitives { - use super::runtime_types; - pub mod crypto { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::ecdsa::Public); - } - pub mod mmr { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BeefyNextAuthoritySet<_0> { - pub id: ::core::primitive::u64, - pub len: ::core::primitive::u32, - pub root: _0, - } - } - } - pub mod bitvec { - use super::runtime_types; - pub mod order { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Lsb0; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Msb0; - } - } - pub mod bp_header_chain { - use super::runtime_types; - pub mod justification { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct GrandpaJustification<_0> { - pub round: ::core::primitive::u64, - pub commit: runtime_types::finality_grandpa::Commit< - ::subxt::sp_core::H256, - ::core::primitive::u32, - runtime_types::sp_finality_grandpa::app::Signature, - runtime_types::sp_finality_grandpa::app::Public, - >, - pub votes_ancestries: ::std::vec::Vec<_0>, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AuthoritySet { - pub authorities: ::std::vec::Vec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - pub set_id: ::core::primitive::u64, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct InitializationData<_0> { - pub header: ::std::boxed::Box<_0>, - pub authority_list: ::std::vec::Vec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - pub set_id: ::core::primitive::u64, - pub is_halted: ::core::primitive::bool, - } - } - pub mod bp_message_dispatch { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum CallOrigin<_0, _1, _2> { - #[codec(index = 0)] - SourceRoot, - #[codec(index = 1)] - TargetAccount(_0, _1, _2), - #[codec(index = 2)] - SourceAccount(_0), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct MessagePayload<_0, _1, _2, _3> { - pub spec_version: ::core::primitive::u32, - pub weight: ::core::primitive::u64, - pub origin: runtime_types::bp_message_dispatch::CallOrigin<_0, _1, _2>, - pub dispatch_fee_payment: runtime_types::bp_runtime::messages::DispatchFeePayment, - pub call: _3, - } - } - pub mod bp_messages { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DeliveredMessages { - pub begin: ::core::primitive::u64, - pub end: ::core::primitive::u64, - pub dispatch_results: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Msb0, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct InboundLaneData<_0> { - pub relayers: ::std::vec::Vec>, - pub last_confirmed_nonce: ::core::primitive::u64, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct MessageData<_0> { - pub payload: ::std::vec::Vec<::core::primitive::u8>, - pub fee: _0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct MessageKey { - pub lane_id: [::core::primitive::u8; 4usize], - pub nonce: ::core::primitive::u64, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum OperatingMode { - #[codec(index = 0)] - Normal, - #[codec(index = 1)] - RejectingOutboundMessages, - #[codec(index = 2)] - Halted, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct OutboundLaneData { - pub oldest_unpruned_nonce: ::core::primitive::u64, - pub latest_received_nonce: ::core::primitive::u64, - pub latest_generated_nonce: ::core::primitive::u64, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct UnrewardedRelayer<_0> { - pub relayer: _0, - pub messages: runtime_types::bp_messages::DeliveredMessages, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct UnrewardedRelayersState { - pub unrewarded_relayer_entries: ::core::primitive::u64, - pub messages_in_oldest_entry: ::core::primitive::u64, - pub total_messages: ::core::primitive::u64, - } - } - pub mod bp_runtime { - use super::runtime_types; - pub mod messages { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum DispatchFeePayment { - #[codec(index = 0)] - AtSourceChain, - #[codec(index = 1)] - AtTargetChain, - } - } - } - pub mod bridge_runtime_common { - use super::runtime_types; - pub mod messages { - use super::runtime_types; - pub mod source { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct FromBridgedChainMessagesDeliveryProof<_0> { - pub bridged_header_hash: _0, - pub storage_proof: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - pub lane: [::core::primitive::u8; 4usize], - } - } - pub mod target { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct FromBridgedChainMessagesProof<_0> { - pub bridged_header_hash: _0, - pub storage_proof: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - pub lane: [::core::primitive::u8; 4usize], - pub nonces_start: ::core::primitive::u64, - pub nonces_end: ::core::primitive::u64, - } - } - } - } - pub mod finality_grandpa { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Commit<_0, _1, _2, _3> { - pub target_hash: _0, - pub target_number: _1, - pub precommits: ::std::vec::Vec< - runtime_types::finality_grandpa::SignedPrecommit<_0, _1, _2, _3>, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Equivocation<_0, _1, _2> { - pub round_number: ::core::primitive::u64, - pub identity: _0, - pub first: (_1, _2), - pub second: (_1, _2), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Precommit<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Prevote<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SignedPrecommit<_0, _1, _2, _3> { - pub precommit: runtime_types::finality_grandpa::Precommit<_0, _1>, - pub signature: _2, - pub id: _3, - } - } - pub mod frame_support { - use super::runtime_types; - pub mod dispatch { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum RawOrigin<_0> { - #[codec(index = 0)] - Root, - #[codec(index = 1)] - Signed(_0), - #[codec(index = 2)] - None, - } - } - pub mod storage { - use super::runtime_types; - pub mod bounded_vec { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BoundedVec<_0>(pub ::std::vec::Vec<_0>); - } - pub mod weak_bounded_vec { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); - } - } - pub mod traits { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct WrapperKeepOpaque<_0>( - #[codec(compact)] pub ::core::primitive::u32, - pub _0, - ); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct WrapperOpaque<_0>( - #[codec(compact)] pub ::core::primitive::u32, - pub _0, - ); - } - pub mod tokens { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug, - )] - pub enum BalanceStatus { - #[codec(index = 0)] - Free, - #[codec(index = 1)] - Reserved, - } - } - } - } - pub mod weights { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum DispatchClass { - #[codec(index = 0)] - Normal, - #[codec(index = 1)] - Operational, - #[codec(index = 2)] - Mandatory, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DispatchInfo { - pub weight: ::core::primitive::u64, - pub class: runtime_types::frame_support::weights::DispatchClass, - pub pays_fee: runtime_types::frame_support::weights::Pays, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Pays { - #[codec(index = 0)] - Yes, - #[codec(index = 1)] - No, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PerDispatchClass<_0> { - pub normal: _0, - pub operational: _0, - pub mandatory: _0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RuntimeDbWeight { - pub read: ::core::primitive::u64, - pub write: ::core::primitive::u64, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct WeightToFeeCoefficient<_0> { - pub coeff_integer: _0, - pub coeff_frac: runtime_types::sp_arithmetic::per_things::Perbill, - pub negative: ::core::primitive::bool, - pub degree: ::core::primitive::u8, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PalletId(pub [::core::primitive::u8; 8usize]); - } - pub mod frame_system { - use super::runtime_types; - pub mod extensions { - use super::runtime_types; - pub mod check_genesis { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CheckGenesis; - } - pub mod check_mortality { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CheckMortality(pub runtime_types::sp_runtime::generic::era::Era); - } - pub mod check_non_zero_sender { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CheckNonZeroSender; - } - pub mod check_nonce { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); - } - pub mod check_spec_version { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CheckSpecVersion; - } - pub mod check_tx_version { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CheckTxVersion; - } - pub mod check_weight { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CheckWeight; - } - } - pub mod limits { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BlockLength { - pub max: runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u32, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BlockWeights { - pub base_block: ::core::primitive::u64, - pub max_block: ::core::primitive::u64, - pub per_class: runtime_types::frame_support::weights::PerDispatchClass< - runtime_types::frame_system::limits::WeightsPerClass, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct WeightsPerClass { - pub base_extrinsic: ::core::primitive::u64, - pub max_extrinsic: ::core::option::Option<::core::primitive::u64>, - pub max_total: ::core::option::Option<::core::primitive::u64>, - pub reserved: ::core::option::Option<::core::primitive::u64>, - } - } - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "A dispatch that will fill the block weight up to the given ratio."] - fill_block { - ratio: runtime_types::sp_arithmetic::per_things::Perbill, - }, - #[codec(index = 1)] - #[doc = "Make some on-chain remark."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`"] - #[doc = "# "] - remark { - remark: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 2)] - #[doc = "Set the number of pages in the WebAssembly environment's heap."] - set_heap_pages { pages: ::core::primitive::u64 }, - #[codec(index = 3)] - #[doc = "Set the new runtime code."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] - #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] - #[doc = " expensive)."] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] - #[doc = "expensive. We will treat this as a full block."] - #[doc = "# "] - set_code { - code: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 4)] - #[doc = "Set the new runtime code without doing any checks of the given `code`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(C)` where `C` length of `code`"] - #[doc = "- 1 storage write (codec `O(C)`)."] - #[doc = "- 1 digest item."] - #[doc = "- 1 event."] - #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] - #[doc = "block. # "] - set_code_without_checks { - code: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 5)] - #[doc = "Set some items of storage."] - set_storage { - items: ::std::vec::Vec<( - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - )>, - }, - #[codec(index = 6)] - #[doc = "Kill some items from storage."] - kill_storage { - keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - }, - #[codec(index = 7)] - #[doc = "Kill all storage items with a key that starts with the given prefix."] - #[doc = ""] - #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] - #[doc = "the prefix we are removing to accurately calculate the weight of this function."] - kill_prefix { - prefix: ::std::vec::Vec<::core::primitive::u8>, - subkeys: ::core::primitive::u32, - }, - #[codec(index = 8)] - #[doc = "Make some on-chain remark and emit event."] - remark_with_event { - remark: ::std::vec::Vec<::core::primitive::u8>, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The name of specification does not match between the current runtime"] - #[doc = "and the new runtime."] - InvalidSpecName, - #[codec(index = 1)] - #[doc = "The specification version is not allowed to decrease between the current runtime"] - #[doc = "and the new runtime."] - SpecVersionNeedsToIncrease, - #[codec(index = 2)] - #[doc = "Failed to extract the runtime version from the new runtime."] - #[doc = ""] - #[doc = "Either calling `Core_version` or decoding `RuntimeVersion` failed."] - FailedToExtractRuntimeVersion, - #[codec(index = 3)] - #[doc = "Suicide called when the account has non-default composite data."] - NonDefaultComposite, - #[codec(index = 4)] - #[doc = "There is a non-zero reference count preventing the account from being purged."] - NonZeroRefCount, - #[codec(index = 5)] - #[doc = "The origin filter prevent the call to be dispatched."] - CallFiltered, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "An extrinsic completed successfully."] - ExtrinsicSuccess { - dispatch_info: runtime_types::frame_support::weights::DispatchInfo, - }, - #[codec(index = 1)] - #[doc = "An extrinsic failed."] - ExtrinsicFailed { - dispatch_error: runtime_types::sp_runtime::DispatchError, - dispatch_info: runtime_types::frame_support::weights::DispatchInfo, - }, - #[codec(index = 2)] - #[doc = "`:code` was updated."] - CodeUpdated, - #[codec(index = 3)] - #[doc = "A new account was created."] - NewAccount { - account: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 4)] - #[doc = "An account was reaped."] - KilledAccount { - account: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 5)] - #[doc = "On on-chain remark happened."] - Remarked { - sender: ::subxt::sp_core::crypto::AccountId32, - hash: ::subxt::sp_core::H256, - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AccountInfo<_0, _1> { - pub nonce: _0, - pub consumers: _0, - pub providers: _0, - pub sufficients: _0, - pub data: _1, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct EventRecord<_0, _1> { - pub phase: runtime_types::frame_system::Phase, - pub event: _0, - pub topics: ::std::vec::Vec<_1>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct LastRuntimeUpgradeInfo { - #[codec(compact)] - pub spec_version: ::core::primitive::u32, - pub spec_name: ::std::string::String, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Phase { - #[codec(index = 0)] - ApplyExtrinsic(::core::primitive::u32), - #[codec(index = 1)] - Finalization, - #[codec(index = 2)] - Initialization, - } - } - pub mod pallet_authorship { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Provide a set of uncles."] - set_uncles { - new_uncles: ::std::vec::Vec< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The uncle parent not in the chain."] - InvalidUncleParent, - #[codec(index = 1)] - #[doc = "Uncles already set in the block."] - UnclesAlreadySet, - #[codec(index = 2)] - #[doc = "Too many uncles."] - TooManyUncles, - #[codec(index = 3)] - #[doc = "The uncle is genesis."] - GenesisUncle, - #[codec(index = 4)] - #[doc = "The uncle is too high in chain."] - TooHighUncle, - #[codec(index = 5)] - #[doc = "The uncle is already included."] - UncleAlreadyIncluded, - #[codec(index = 6)] - #[doc = "The uncle isn't recent enough to be included."] - OldUncle, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum UncleEntryItem<_0, _1, _2> { - #[codec(index = 0)] - InclusionHeight(_0), - #[codec(index = 1)] - Uncle(_1, ::core::option::Option<_2>), - } - } - pub mod pallet_babe { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - report_equivocation { - equivocation_proof: ::std::boxed::Box< - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - }, - #[codec(index = 1)] - #[doc = "Report authority equivocation/misbehavior. This method will verify"] - #[doc = "the equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence will"] - #[doc = "be reported."] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - report_equivocation_unsigned { - equivocation_proof: ::std::boxed::Box< - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - }, - #[codec(index = 2)] - #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] - #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] - #[doc = "Multiple calls to this method will replace any existing planned config change that had"] - #[doc = "not been enacted yet."] - plan_config_change { - config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] - InvalidEquivocationProof, - #[codec(index = 1)] - #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] - InvalidKeyOwnershipProof, - #[codec(index = 2)] - #[doc = "A given equivocation report is valid but already previously reported."] - DuplicateOffenceReport, - #[codec(index = 3)] - #[doc = "Submitted configuration is invalid."] - InvalidConfiguration, - } - } - } - pub mod pallet_balances { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Transfer some liquid free balance to another account."] - #[doc = ""] - #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] - #[doc = " types. See related functions below."] - #[doc = "- It contains a limited number of reads and writes internally and no complex"] - #[doc = " computation."] - #[doc = ""] - #[doc = "Related functions:"] - #[doc = ""] - #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] - #[doc = " - Transferring balances to accounts that did not exist before will cause"] - #[doc = " `T::OnNewAccount::on_new_account` to be called."] - #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] - #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] - #[doc = " that the transfer will not kill the origin account."] - #[doc = "---------------------------------"] - #[doc = "- Origin account is already in memory, so no DB operations for them."] - #[doc = "# "] - transfer { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "Set the balances of a given account."] - #[doc = ""] - #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] - #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] - #[doc = "If the new free or reserved balance is below the existential deposit,"] - #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] - #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - set_balance { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - new_free: ::core::primitive::u128, - #[codec(compact)] - new_reserved: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] - #[doc = "specified."] - #[doc = "# "] - #[doc = "- Same as transfer, but additional read and write because the source account is not"] - #[doc = " assumed to be in the overlay."] - #[doc = "# "] - force_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] - #[doc = "origin account."] - #[doc = ""] - #[doc = "99% of the time you want [`transfer`] instead."] - #[doc = ""] - #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] - transfer_keep_alive { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 4)] - #[doc = "Transfer the entire transferable balance from the caller account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true). # "] - #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] - #[doc = " #"] - transfer_all { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - keep_alive: ::core::primitive::bool, - }, - #[codec(index = 5)] - #[doc = "Unreserve some balance from a user by force."] - #[doc = ""] - #[doc = "Can only be called by ROOT."] - force_unreserve { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - amount: ::core::primitive::u128, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Vesting balance too high to send value"] - VestingBalance, - #[codec(index = 1)] - #[doc = "Account liquidity restrictions prevent withdrawal"] - LiquidityRestrictions, - #[codec(index = 2)] - #[doc = "Balance too low to send value"] - InsufficientBalance, - #[codec(index = 3)] - #[doc = "Value too low to create account due to existential deposit"] - ExistentialDeposit, - #[codec(index = 4)] - #[doc = "Transfer/payment would kill account"] - KeepAlive, - #[codec(index = 5)] - #[doc = "A vesting schedule already exists for this account"] - ExistingVestingSchedule, - #[codec(index = 6)] - #[doc = "Beneficiary account must pre-exist"] - DeadAccount, - #[codec(index = 7)] - #[doc = "Number of named reserves exceed MaxReserves"] - TooManyReserves, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "An account was created with some free balance."] - Endowed { - account: ::subxt::sp_core::crypto::AccountId32, - free_balance: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] - #[doc = "resulting in an outright loss."] - DustLost { - account: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Transfer succeeded."] - Transfer { - from: ::subxt::sp_core::crypto::AccountId32, - to: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "A balance was set by root."] - BalanceSet { - who: ::subxt::sp_core::crypto::AccountId32, - free: ::core::primitive::u128, - reserved: ::core::primitive::u128, - }, - #[codec(index = 4)] - #[doc = "Some balance was reserved (moved from free to reserved)."] - Reserved { - who: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 5)] - #[doc = "Some balance was unreserved (moved from reserved to free)."] - Unreserved { - who: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 6)] - #[doc = "Some balance was moved from the reserve of the first account to the second account."] - #[doc = "Final argument indicates the destination balance type."] - ReserveRepatriated { - from: ::subxt::sp_core::crypto::AccountId32, - to: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - destination_status: - runtime_types::frame_support::traits::tokens::misc::BalanceStatus, - }, - #[codec(index = 7)] - #[doc = "Some amount was deposited (e.g. for transaction fees)."] - Deposit { - who: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 8)] - #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] - Withdraw { - who: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 9)] - #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] - Slashed { - who: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AccountData<_0> { - pub free: _0, - pub reserved: _0, - pub misc_frozen: _0, - pub fee_frozen: _0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BalanceLock<_0> { - pub id: [::core::primitive::u8; 8usize], - pub amount: _0, - pub reasons: runtime_types::pallet_balances::Reasons, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Reasons { - #[codec(index = 0)] - Fee, - #[codec(index = 1)] - Misc, - #[codec(index = 2)] - All, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V1_0_0, - #[codec(index = 1)] - V2_0_0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReserveData<_0, _1> { - pub id: _0, - pub amount: _1, - } - } - pub mod pallet_beefy { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call {} - } - } - pub mod pallet_bridge_dispatch { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Message has been rejected before reaching dispatch."] - MessageRejected( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ), - #[codec(index = 1)] - #[doc = "Message has been rejected by dispatcher because of spec version mismatch."] - #[doc = "Last two arguments are: expected and passed spec version."] - MessageVersionSpecMismatch( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ::core::primitive::u32, - ::core::primitive::u32, - ), - #[codec(index = 2)] - #[doc = "Message has been rejected by dispatcher because of weight mismatch."] - #[doc = "Last two arguments are: expected and passed call weight."] - MessageWeightMismatch( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 3)] - #[doc = "Message signature mismatch."] - MessageSignatureMismatch( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ), - #[codec(index = 4)] - #[doc = "We have failed to decode Call from the message."] - MessageCallDecodeFailed( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ), - #[codec(index = 5)] - #[doc = "The call from the message has been rejected by the call filter."] - MessageCallRejected( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ), - #[codec(index = 6)] - #[doc = "The origin account has failed to pay fee for dispatching the message."] - MessageDispatchPaymentFailed( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - ), - #[codec(index = 7)] - #[doc = "Message has been dispatched with given result."] - MessageDispatched( - [::core::primitive::u8; 4usize], - ([::core::primitive::u8; 4usize], ::core::primitive::u64), - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ), - #[codec(index = 8)] - #[doc = "Phantom member, never used. Needed to handle multiple pallet instances."] - _Dummy, - } - } - } - pub mod pallet_bridge_grandpa { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Verify a target header is finalized according to the given finality proof."] - #[doc = ""] - #[doc = "It will use the underlying storage pallet to fetch information about the current"] - #[doc = "authorities and best finalized header in order to verify that the header is finalized."] - #[doc = ""] - #[doc = "If successful in verification, it will write the target header to the underlying storage"] - #[doc = "pallet."] - submit_finality_proof { - finality_target: ::std::boxed::Box< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - justification: - runtime_types::bp_header_chain::justification::GrandpaJustification< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - #[codec(index = 1)] - #[doc = "Bootstrap the bridge pallet with an initial header and authority set from which to sync."] - #[doc = ""] - #[doc = "The initial configuration provided does not need to be the genesis header of the bridged"] - #[doc = "chain, it can be any arbitrary header. You can also provide the next scheduled set"] - #[doc = "change if it is already know."] - #[doc = ""] - #[doc = "This function is only allowed to be called from a trusted origin and writes to storage"] - #[doc = "with practically no checks in terms of the validity of the data. It is important that"] - #[doc = "you ensure that valid data is being passed in."] - initialize { - init_data: runtime_types::bp_header_chain::InitializationData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - #[codec(index = 2)] - #[doc = "Change `PalletOwner`."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - set_owner { - new_owner: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - }, - #[codec(index = 3)] - #[doc = "Halt or resume all pallet operations."] - #[doc = ""] - #[doc = "May only be called either by root, or by `PalletOwner`."] - set_operational { - operational: ::core::primitive::bool, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The given justification is invalid for the given header."] - InvalidJustification, - #[codec(index = 1)] - #[doc = "The authority set from the underlying header chain is invalid."] - InvalidAuthoritySet, - #[codec(index = 2)] - #[doc = "There are too many requests for the current window to handle."] - TooManyRequests, - #[codec(index = 3)] - #[doc = "The header being imported is older than the best finalized header known to the pallet."] - OldHeader, - #[codec(index = 4)] - #[doc = "The header is unknown to the pallet."] - UnknownHeader, - #[codec(index = 5)] - #[doc = "The scheduled authority set change found in the header is unsupported by the pallet."] - #[doc = ""] - #[doc = "This is the case for non-standard (e.g forced) authority set changes."] - UnsupportedScheduledChange, - #[codec(index = 6)] - #[doc = "The pallet is not yet initialized."] - NotInitialized, - #[codec(index = 7)] - #[doc = "The pallet has already been initialized."] - AlreadyInitialized, - #[codec(index = 8)] - #[doc = "All pallet operations are halted."] - Halted, - #[codec(index = 9)] - #[doc = "The storage proof doesn't contains storage root. So it is invalid for given header."] - StorageRootMismatch, - } - } - } - pub mod pallet_bridge_messages { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - # [codec (index = 0)] # [doc = "Change `PalletOwner`."] # [doc = ""] # [doc = "May only be called either by root, or by `PalletOwner`."] set_owner { new_owner : :: core :: option :: Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 1)] # [doc = "Halt or resume all/some pallet operations."] # [doc = ""] # [doc = "May only be called either by root, or by `PalletOwner`."] set_operating_mode { operating_mode : runtime_types :: bp_messages :: OperatingMode , } , # [codec (index = 2)] # [doc = "Update pallet parameter."] # [doc = ""] # [doc = "May only be called either by root, or by `PalletOwner`."] # [doc = ""] # [doc = "The weight is: single read for permissions check + 2 writes for parameter value and"] # [doc = "event."] update_pallet_parameter { parameter : () , } , # [codec (index = 3)] # [doc = "Send message over lane."] send_message { lane_id : [:: core :: primitive :: u8 ; 4usize] , payload : runtime_types :: bp_message_dispatch :: MessagePayload < :: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_runtime :: MultiSigner , runtime_types :: sp_runtime :: MultiSignature , :: std :: vec :: Vec < :: core :: primitive :: u8 > > , delivery_and_dispatch_fee : :: core :: primitive :: u128 , } , # [codec (index = 4)] # [doc = "Pay additional fee for the message."] increase_message_fee { lane_id : [:: core :: primitive :: u8 ; 4usize] , nonce : :: core :: primitive :: u64 , additional_fee : :: core :: primitive :: u128 , } , # [codec (index = 5)] # [doc = "Receive messages proof from bridged chain."] # [doc = ""] # [doc = "The weight of the call assumes that the transaction always brings outbound lane"] # [doc = "state update. Because of that, the submitter (relayer) has no benefit of not including"] # [doc = "this data in the transaction, so reward confirmations lags should be minimal."] receive_messages_proof { relayer_id_at_bridged_chain : :: subxt :: sp_core :: crypto :: AccountId32 , proof : runtime_types :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: sp_core :: H256 > , messages_count : :: core :: primitive :: u32 , dispatch_weight : :: core :: primitive :: u64 , } , # [codec (index = 6)] # [doc = "Receive messages delivery proof from bridged chain."] receive_messages_delivery_proof { proof : runtime_types :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: sp_core :: H256 > , relayers_state : runtime_types :: bp_messages :: UnrewardedRelayersState , } , } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "All pallet operations are halted."] - Halted, - #[codec(index = 1)] - #[doc = "Message has been treated as invalid by chain verifier."] - MessageRejectedByChainVerifier, - #[codec(index = 2)] - #[doc = "Message has been treated as invalid by lane verifier."] - MessageRejectedByLaneVerifier, - #[codec(index = 3)] - #[doc = "Submitter has failed to pay fee for delivering and dispatching messages."] - FailedToWithdrawMessageFee, - #[codec(index = 4)] - #[doc = "The transaction brings too many messages."] - TooManyMessagesInTheProof, - #[codec(index = 5)] - #[doc = "Invalid messages has been submitted."] - InvalidMessagesProof, - #[codec(index = 6)] - #[doc = "Invalid messages delivery proof has been submitted."] - InvalidMessagesDeliveryProof, - #[codec(index = 7)] - #[doc = "The bridged chain has invalid `UnrewardedRelayers` in its storage (fatal for the lane)."] - InvalidUnrewardedRelayers, - #[codec(index = 8)] - #[doc = "The relayer has declared invalid unrewarded relayers state in the"] - #[doc = "`receive_messages_delivery_proof` call."] - InvalidUnrewardedRelayersState, - #[codec(index = 9)] - #[doc = "The message someone is trying to work with (i.e. increase fee) is already-delivered."] - MessageIsAlreadyDelivered, - #[codec(index = 10)] - #[doc = "The message someone is trying to work with (i.e. increase fee) is not yet sent."] - MessageIsNotYetSent, - #[codec(index = 11)] - #[doc = "The number of actually confirmed messages is going to be larger than the number of"] - #[doc = "messages in the proof. This may mean that this or bridged chain storage is corrupted."] - TryingToConfirmMoreMessagesThanExpected, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Pallet parameter has been updated."] - ParameterUpdated(()), - #[codec(index = 1)] - #[doc = "Message has been accepted and is waiting to be delivered."] - MessageAccepted([::core::primitive::u8; 4usize], ::core::primitive::u64), - #[codec(index = 2)] - #[doc = "Messages in the inclusive range have been delivered to the bridged chain."] - MessagesDelivered( - [::core::primitive::u8; 4usize], - runtime_types::bp_messages::DeliveredMessages, - ), - } - } - } - pub mod pallet_collective { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Set the collective's membership."] - #[doc = ""] - #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] - #[doc = "- `prime`: The prime member whose vote sets the default."] - #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] - #[doc = " weight estimation."] - #[doc = ""] - #[doc = "Requires root origin."] - #[doc = ""] - #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] - #[doc = " the weight estimations rely on it to estimate dispatchable weight."] - #[doc = ""] - #[doc = "# WARNING:"] - #[doc = ""] - #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] - #[doc = "implementation of the trait [`ChangeMembers`]."] - #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] - #[doc = "with other logic managing the member set."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(MP + N)` where:"] - #[doc = " - `M` old-members-count (code- and governance-bounded)"] - #[doc = " - `N` new-members-count (code- and governance-bounded)"] - #[doc = " - `P` proposals-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] - #[doc = " members"] - #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] - #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] - #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] - #[doc = "# "] - set_members { - new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - old_count: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Dispatch a proposal from a member using the `Member` origin."] - #[doc = ""] - #[doc = "Origin must be a member of the collective."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] - #[doc = " `proposal`"] - #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] - #[doc = "- 1 event"] - #[doc = "# "] - execute { - proposal: ::std::boxed::Box, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Add a new proposal to either be voted on or executed directly."] - #[doc = ""] - #[doc = "Requires the sender to be member."] - #[doc = ""] - #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] - #[doc = "or put up for voting."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - branching is influenced by `threshold` where:"] - #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] - #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] - #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] - #[doc = " - DB accesses influenced by `threshold`:"] - #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] - #[doc = " - OR proposal insertion (`threshold <= 2`)"] - #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] - #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] - #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] - #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] - #[doc = " - 1 event"] - #[doc = "# "] - propose { - #[codec(compact)] - threshold: ::core::primitive::u32, - proposal: ::std::boxed::Box, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "Requires the sender to be a member."] - #[doc = ""] - #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] - #[doc = "- DB:"] - #[doc = " - 1 storage read `Members` (codec `O(M)`)"] - #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] - #[doc = "- 1 event"] - #[doc = "# "] - vote { - proposal: ::subxt::sp_core::H256, - #[codec(compact)] - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - }, - #[codec(index = 4)] - #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] - #[doc = ""] - #[doc = "May be called by any signed account in order to finish voting and close the proposal."] - #[doc = ""] - #[doc = "If called before the end of the voting period it will only close the vote if it is"] - #[doc = "has enough votes to be approved or disapproved."] - #[doc = ""] - #[doc = "If called after the end of the voting period abstentions are counted as rejections"] - #[doc = "unless there is a prime member set and the prime member cast an approval."] - #[doc = ""] - #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] - #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] - #[doc = ""] - #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] - #[doc = "proposal."] - #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] - #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] - #[doc = ""] - #[doc = "# "] - #[doc = "## Weight"] - #[doc = "- `O(B + M + P1 + P2)` where:"] - #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] - #[doc = " - `M` is members-count (code- and governance-bounded)"] - #[doc = " - `P1` is the complexity of `proposal` preimage."] - #[doc = " - `P2` is proposal-count (code-bounded)"] - #[doc = "- DB:"] - #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] - #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] - #[doc = " `O(P2)`)"] - #[doc = " - any mutations done while executing `proposal` (`P1`)"] - #[doc = "- up to 3 events"] - #[doc = "# "] - close { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - index: ::core::primitive::u32, - #[codec(compact)] - proposal_weight_bound: ::core::primitive::u64, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] - #[doc = "state."] - #[doc = ""] - #[doc = "Must be called by the Root origin."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity: O(P) where P is the number of max proposals"] - #[doc = "DB Weight:"] - #[doc = "* Reads: Proposals"] - #[doc = "* Writes: Voting, Proposals, ProposalOf"] - #[doc = "# "] - disapprove_proposal { - proposal_hash: ::subxt::sp_core::H256, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Account is not a member"] - NotMember, - #[codec(index = 1)] - #[doc = "Duplicate proposals not allowed"] - DuplicateProposal, - #[codec(index = 2)] - #[doc = "Proposal must exist"] - ProposalMissing, - #[codec(index = 3)] - #[doc = "Mismatched index"] - WrongIndex, - #[codec(index = 4)] - #[doc = "Duplicate vote ignored"] - DuplicateVote, - #[codec(index = 5)] - #[doc = "Members are already initialized!"] - AlreadyInitialized, - #[codec(index = 6)] - #[doc = "The close call was made too early, before the end of the voting."] - TooEarly, - #[codec(index = 7)] - #[doc = "There can only be a maximum of `MaxProposals` active proposals."] - TooManyProposals, - #[codec(index = 8)] - #[doc = "The given weight bound for the proposal was too low."] - WrongProposalWeight, - #[codec(index = 9)] - #[doc = "The given length bound for the proposal was too low."] - WrongProposalLength, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] - #[doc = "`MemberCount`)."] - Proposed { - account: ::subxt::sp_core::crypto::AccountId32, - proposal_index: ::core::primitive::u32, - proposal_hash: ::subxt::sp_core::H256, - threshold: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "A motion (given hash) has been voted on by given account, leaving"] - #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] - Voted { - account: ::subxt::sp_core::crypto::AccountId32, - proposal_hash: ::subxt::sp_core::H256, - voted: ::core::primitive::bool, - yes: ::core::primitive::u32, - no: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "A motion was approved by the required threshold."] - Approved { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 3)] - #[doc = "A motion was not approved by the required threshold."] - Disapproved { - proposal_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 4)] - #[doc = "A motion was executed; result will be `Ok` if it returned without error."] - Executed { - proposal_hash: ::subxt::sp_core::H256, - result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - }, - #[codec(index = 5)] - #[doc = "A single member did some action; result will be `Ok` if it returned without error."] - MemberExecuted { - proposal_hash: ::subxt::sp_core::H256, - result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - }, - #[codec(index = 6)] - #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] - Closed { - proposal_hash: ::subxt::sp_core::H256, - yes: ::core::primitive::u32, - no: ::core::primitive::u32, - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum RawOrigin<_0> { - #[codec(index = 0)] - Members(::core::primitive::u32, ::core::primitive::u32), - #[codec(index = 1)] - Member(_0), - #[codec(index = 2)] - _Phantom, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Votes<_0, _1> { - pub index: _1, - pub threshold: _1, - pub ayes: ::std::vec::Vec<_0>, - pub nays: ::std::vec::Vec<_0>, - pub end: _1, - } - } - pub mod pallet_grandpa { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - report_equivocation { - equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - }, - #[codec(index = 1)] - #[doc = "Report voter equivocation/misbehavior. This method will verify the"] - #[doc = "equivocation proof and validate the given key ownership proof"] - #[doc = "against the extracted offender. If both are valid, the offence"] - #[doc = "will be reported."] - #[doc = ""] - #[doc = "This extrinsic must be called unsigned and it is expected that only"] - #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] - #[doc = "if the block author is defined it will be defined as the equivocation"] - #[doc = "reporter."] - report_equivocation_unsigned { - equivocation_proof: ::std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - ::core::primitive::u32, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - }, - #[codec(index = 2)] - #[doc = "Note that the current authority set of the GRANDPA finality gadget has"] - #[doc = "stalled. This will trigger a forced authority set change at the beginning"] - #[doc = "of the next session, to be enacted `delay` blocks after that. The delay"] - #[doc = "should be high enough to safely assume that the block signalling the"] - #[doc = "forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters"] - #[doc = "will start the new authority set using the given finalized block as base."] - #[doc = "Only callable by root."] - note_stalled { - delay: ::core::primitive::u32, - best_finalized_block_number: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Attempt to signal GRANDPA pause when the authority set isn't live"] - #[doc = "(either paused or already pending pause)."] - PauseFailed, - #[codec(index = 1)] - #[doc = "Attempt to signal GRANDPA resume when the authority set isn't paused"] - #[doc = "(either live or already pending resume)."] - ResumeFailed, - #[codec(index = 2)] - #[doc = "Attempt to signal GRANDPA change with one already pending."] - ChangePending, - #[codec(index = 3)] - #[doc = "Cannot signal forced change so soon after last."] - TooSoon, - #[codec(index = 4)] - #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] - InvalidKeyOwnershipProof, - #[codec(index = 5)] - #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] - InvalidEquivocationProof, - #[codec(index = 6)] - #[doc = "A given equivocation report is valid but already previously reported."] - DuplicateOffenceReport, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "New authority set has been applied."] - NewAuthorities { - authority_set: ::std::vec::Vec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - }, - #[codec(index = 1)] - #[doc = "Current authority set has been paused."] - Paused, - #[codec(index = 2)] - #[doc = "Current authority set has been resumed."] - Resumed, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct StoredPendingChange<_0> { - pub scheduled_at: _0, - pub delay: _0, - pub next_authorities: - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - pub forced: ::core::option::Option<_0>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum StoredState<_0> { - #[codec(index = 0)] - Live, - #[codec(index = 1)] - PendingPause { scheduled_at: _0, delay: _0 }, - #[codec(index = 2)] - Paused, - #[codec(index = 3)] - PendingResume { scheduled_at: _0, delay: _0 }, - } - } - pub mod pallet_im_online { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "# "] - #[doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] - #[doc = " length of `heartbeat.network_state.external_address`"] - #[doc = " - `O(K)`: decoding of length `K`"] - #[doc = " - `O(E)`: decoding/encoding of length `E`"] - #[doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] - #[doc = " `ReceivedHeartbeats`"] - #[doc = "- DbWrites: `ReceivedHeartbeats`"] - #[doc = "# "] - heartbeat { - heartbeat: - runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, - signature: runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Non existent public key."] - InvalidKey, - #[codec(index = 1)] - #[doc = "Duplicated heartbeat."] - DuplicatedHeartbeat, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new heartbeat was received from `AuthorityId`."] - HeartbeatReceived { - authority_id: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - }, - #[codec(index = 1)] - #[doc = "At the end of the session, no offence was committed."] - AllGood, - #[codec(index = 2)] - #[doc = "At the end of the session, at least one validator was found to be offline."] - SomeOffline { - offline: ::std::vec::Vec<(::subxt::sp_core::crypto::AccountId32, ())>, - }, - } - } - pub mod sr25519 { - use super::runtime_types; - pub mod app_sr25519 { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BoundedOpaqueNetworkState { - pub peer_id: - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - ::core::primitive::u8, - >, - pub external_addresses: - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< - ::core::primitive::u8, - >, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Heartbeat<_0> { - pub block_number: _0, - pub network_state: runtime_types::sp_core::offchain::OpaqueNetworkState, - pub session_index: _0, - pub authority_index: _0, - pub validators_len: _0, - } - } - pub mod pallet_indices { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Assign an previously unassigned index."] - #[doc = ""] - #[doc = "Payment: `Deposit` is reserved from the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be claimed. This must not be in use."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - claim { index: ::core::primitive::u32 }, - #[codec(index = 1)] - #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] - #[doc = "is effectively transferred to the new account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One transfer operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (recipient)"] - #[doc = " - Writes: Indices Accounts, System Account (recipient)"] - #[doc = "# "] - transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Free up an index owned by the sender."] - #[doc = ""] - #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] - #[doc = ""] - #[doc = "- `index`: the index to be freed. This must be owned by the sender."] - #[doc = ""] - #[doc = "Emits `IndexFreed` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- One reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - free { index: ::core::primitive::u32 }, - #[codec(index = 3)] - #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] - #[doc = "held, then any deposit is reimbursed to its current owner."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `index`: the index to be (re-)assigned."] - #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] - #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] - #[doc = ""] - #[doc = "Emits `IndexAssigned` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one reserve operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Indices Accounts, System Account (original owner)"] - #[doc = " - Writes: Indices Accounts, System Account (original owner)"] - #[doc = "# "] - force_transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - freeze: ::core::primitive::bool, - }, - #[codec(index = 4)] - #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] - #[doc = "deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] - #[doc = "non-frozen account `index`."] - #[doc = ""] - #[doc = "- `index`: the index to be frozen in place."] - #[doc = ""] - #[doc = "Emits `IndexFrozen` if successful."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)`."] - #[doc = "- One storage mutation (codec `O(1)`)."] - #[doc = "- Up to one slash operation."] - #[doc = "- One event."] - #[doc = "-------------------"] - #[doc = "- DB Weight: 1 Read/Write (Accounts)"] - #[doc = "# "] - freeze { index: ::core::primitive::u32 }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The index was not already assigned."] - NotAssigned, - #[codec(index = 1)] - #[doc = "The index is assigned to another account."] - NotOwner, - #[codec(index = 2)] - #[doc = "The index was not available."] - InUse, - #[codec(index = 3)] - #[doc = "The source and destination accounts are identical."] - NotTransfer, - #[codec(index = 4)] - #[doc = "The index is permanent and may not be freed/changed."] - Permanent, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A account index was assigned."] - IndexAssigned { - who: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "A account index has been freed up (unassigned)."] - IndexFreed { index: ::core::primitive::u32 }, - #[codec(index = 2)] - #[doc = "A account index has been frozen to its current account ID."] - IndexFrozen { - index: ::core::primitive::u32, - who: ::subxt::sp_core::crypto::AccountId32, - }, - } - } - } - pub mod pallet_membership { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Add a member `who` to the set."] - #[doc = ""] - #[doc = "May only be called from `T::AddOrigin`."] - add_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 1)] - #[doc = "Remove a member `who` from the set."] - #[doc = ""] - #[doc = "May only be called from `T::RemoveOrigin`."] - remove_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 2)] - #[doc = "Swap out one member `remove` for another `add`."] - #[doc = ""] - #[doc = "May only be called from `T::SwapOrigin`."] - #[doc = ""] - #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] - swap_member { - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 3)] - #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] - #[doc = "pass `members` pre-sorted."] - #[doc = ""] - #[doc = "May only be called from `T::ResetOrigin`."] - reset_members { - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - #[codec(index = 4)] - #[doc = "Swap out the sending member for some other key `new`."] - #[doc = ""] - #[doc = "May only be called from `Signed` origin of a current member."] - #[doc = ""] - #[doc = "Prime membership is passed from the origin account to `new`, if extant."] - change_key { - new: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 5)] - #[doc = "Set the prime member. Must be a current member."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - set_prime { - who: ::subxt::sp_core::crypto::AccountId32, - }, - #[codec(index = 6)] - #[doc = "Remove the prime member if it exists."] - #[doc = ""] - #[doc = "May only be called from `T::PrimeOrigin`."] - clear_prime, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Already a member."] - AlreadyMember, - #[codec(index = 1)] - #[doc = "Not a member."] - NotMember, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "The given member was added; see the transaction for who."] - MemberAdded, - #[codec(index = 1)] - #[doc = "The given member was removed; see the transaction for who."] - MemberRemoved, - #[codec(index = 2)] - #[doc = "Two members were swapped; see the transaction for who."] - MembersSwapped, - #[codec(index = 3)] - #[doc = "The membership was reset; see the transaction for who the new set is."] - MembersReset, - #[codec(index = 4)] - #[doc = "One of the members' keys changed."] - KeyChanged, - #[codec(index = 5)] - #[doc = "Phantom member, never used."] - Dummy, - } - } - } - pub mod pallet_multisig { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] - #[doc = "multi-signature, but do not participate in the approval process."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result."] - #[doc = ""] - #[doc = "# "] - #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight: None"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - as_multi_threshold_1 { - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - call: ::std::boxed::Box, - }, - #[codec(index = 1)] - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "If there are enough, then dispatch the call."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call`: The call to be executed."] - #[doc = ""] - #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] - #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] - #[doc = ""] - #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] - #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] - #[doc = "may be found in the deposited `MultisigExecuted` event."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S + Z + Call)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- The weight of the `call`."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "-------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = "- Plus Call Weight"] - #[doc = "# "] - as_multi { - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - call: ::subxt::WrapperKeepOpaque, - store_call: ::core::primitive::bool, - max_weight: ::core::primitive::u64, - }, - #[codec(index = 2)] - #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] - #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] - #[doc = ""] - #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] - #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] - #[doc = "is cancelled."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] - #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] - #[doc = "transaction index) of the first approval transaction."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] - #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] - #[doc = "- One event."] - #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] - #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account]"] - #[doc = " - Write: Multisig Storage, [Caller Account]"] - #[doc = "# "] - approve_as_multi { - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: ::core::option::Option< - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - >, - call_hash: [::core::primitive::u8; 32usize], - max_weight: ::core::primitive::u64, - }, - #[codec(index = 3)] - #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] - #[doc = "for this operation will be unreserved on success."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] - #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] - #[doc = "dispatch. May not be empty."] - #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] - #[doc = "transaction for this dispatch."] - #[doc = "- `call_hash`: The hash of the call to be executed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(S)`."] - #[doc = "- Up to one balance-reserve or unreserve operation."] - #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] - #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] - #[doc = "- One encode & hash, both of complexity `O(S)`."] - #[doc = "- One event."] - #[doc = "- I/O: 1 read `O(S)`, one remove."] - #[doc = "- Storage: removes one item."] - #[doc = "----------------------------------"] - #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = "# "] - cancel_as_multi { - threshold: ::core::primitive::u16, - other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - call_hash: [::core::primitive::u8; 32usize], - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Threshold must be 2 or greater."] - MinimumThreshold, - #[codec(index = 1)] - #[doc = "Call is already approved by this signatory."] - AlreadyApproved, - #[codec(index = 2)] - #[doc = "Call doesn't need any (more) approvals."] - NoApprovalsNeeded, - #[codec(index = 3)] - #[doc = "There are too few signatories in the list."] - TooFewSignatories, - #[codec(index = 4)] - #[doc = "There are too many signatories in the list."] - TooManySignatories, - #[codec(index = 5)] - #[doc = "The signatories were provided out of order; they should be ordered."] - SignatoriesOutOfOrder, - #[codec(index = 6)] - #[doc = "The sender was contained in the other signatories; it shouldn't be."] - SenderInSignatories, - #[codec(index = 7)] - #[doc = "Multisig operation not found when attempting to cancel."] - NotFound, - #[codec(index = 8)] - #[doc = "Only the account that originally created the multisig is able to cancel it."] - NotOwner, - #[codec(index = 9)] - #[doc = "No timepoint was given, yet the multisig operation is already underway."] - NoTimepoint, - #[codec(index = 10)] - #[doc = "A different timepoint was given to the multisig operation that is underway."] - WrongTimepoint, - #[codec(index = 11)] - #[doc = "A timepoint was given, yet no multisig operation is underway."] - UnexpectedTimepoint, - #[codec(index = 12)] - #[doc = "The maximum weight information provided was too low."] - MaxWeightTooLow, - #[codec(index = 13)] - #[doc = "The data to be stored is already stored."] - AlreadyStored, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new multisig operation has begun."] - NewMultisig { - approving: ::subxt::sp_core::crypto::AccountId32, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - }, - #[codec(index = 1)] - #[doc = "A multisig operation has been approved by someone."] - MultisigApproval { - approving: ::subxt::sp_core::crypto::AccountId32, - timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - }, - #[codec(index = 2)] - #[doc = "A multisig operation has been executed."] - MultisigExecuted { - approving: ::subxt::sp_core::crypto::AccountId32, - timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - }, - #[codec(index = 3)] - #[doc = "A multisig operation has been cancelled."] - MultisigCancelled { - cancelling: ::subxt::sp_core::crypto::AccountId32, - timepoint: - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - multisig: ::subxt::sp_core::crypto::AccountId32, - call_hash: [::core::primitive::u8; 32usize], - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Multisig<_0, _1, _2> { - pub when: runtime_types::pallet_multisig::Timepoint<_0>, - pub deposit: _1, - pub depositor: _2, - pub approvals: ::std::vec::Vec<_2>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Timepoint<_0> { - pub height: _0, - pub index: _0, - } - } - pub mod pallet_offences { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] - #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] - #[doc = "\\[kind, timeslot\\]."] - Offence { - kind: [::core::primitive::u8; 16usize], - timeslot: ::std::vec::Vec<::core::primitive::u8>, - }, - } - } - } - pub mod pallet_proxy { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Dispatch the given `call` from an account that the sender is authorised for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - proxy { - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: - ::core::option::Option, - call: ::std::boxed::Box, - }, - #[codec(index = 1)] - #[doc = "Register a proxy account for the sender that is able to make calls on its behalf."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to make a proxy."] - #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - add_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Unregister a proxy account for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] - #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - remove_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Unregister all proxy accounts for the sender."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] - #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - remove_proxies, - #[codec(index = 4)] - #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] - #[doc = "initialize it with a proxy of `proxy_type` for `origin` sender."] - #[doc = ""] - #[doc = "Requires a `Signed` origin."] - #[doc = ""] - #[doc = "- `proxy_type`: The type of the proxy that the sender will be registered as over the"] - #[doc = "new account. This will almost always be the most permissive `ProxyType` possible to"] - #[doc = "allow for maximum flexibility."] - #[doc = "- `index`: A disambiguation index, in case this is called multiple times in the same"] - #[doc = "transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just"] - #[doc = "want to use `0`."] - #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] - #[doc = "zero."] - #[doc = ""] - #[doc = "Fails with `Duplicate` if this has already been called in this transaction, from the"] - #[doc = "same sender, with the same parameters."] - #[doc = ""] - #[doc = "Fails if there are insufficient funds to pay for deposit."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - #[doc = "TODO: Might be over counting 1 read"] - anonymous { - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - index: ::core::primitive::u16, - }, - #[codec(index = 5)] - #[doc = "Removes a previously spawned anonymous proxy."] - #[doc = ""] - #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] - #[doc = "inaccessible."] - #[doc = ""] - #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`anonymous` with corresponding parameters."] - #[doc = ""] - #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] - #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] - #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] - #[doc = "account whose `anonymous` call has corresponding parameters."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - kill_anonymous { - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - index: ::core::primitive::u16, - #[codec(compact)] - height: ::core::primitive::u32, - #[codec(compact)] - ext_index: ::core::primitive::u32, - }, - #[codec(index = 6)] - #[doc = "Publish the hash of a proxy-call that will be made in the future."] - #[doc = ""] - #[doc = "This must be called some number of blocks before the corresponding `proxy` is attempted"] - #[doc = "if the delay associated with the proxy relationship is greater than zero."] - #[doc = ""] - #[doc = "No more than `MaxPending` announcements may be made at any one time."] - #[doc = ""] - #[doc = "This will take a deposit of `AnnouncementDepositFactor` as well as"] - #[doc = "`AnnouncementDepositBase` if there are no other pending announcements."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and a proxy of `real`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - announce { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 7)] - #[doc = "Remove a given announcement."] - #[doc = ""] - #[doc = "May be called by a proxy account to remove a call they previously announced and return"] - #[doc = "the deposit."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - remove_announcement { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 8)] - #[doc = "Remove the given announcement of a delegate."] - #[doc = ""] - #[doc = "May be called by a target (proxied) account to remove a call that one of their delegates"] - #[doc = "(`delegate`) has announced they want to execute. The deposit is returned."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `delegate`: The account that previously announced the call."] - #[doc = "- `call_hash`: The hash of the call to be made."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - reject_announcement { - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 9)] - #[doc = "Dispatch the given `call` from an account that the sender is authorized for through"] - #[doc = "`add_proxy`."] - #[doc = ""] - #[doc = "Removes any corresponding announcement(s)."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `real`: The account that the proxy will make a call on behalf of."] - #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] - #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] - proxy_announced { - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: - ::core::option::Option, - call: ::std::boxed::Box, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "There are too many proxies registered or too many announcements pending."] - TooMany, - #[codec(index = 1)] - #[doc = "Proxy registration not found."] - NotFound, - #[codec(index = 2)] - #[doc = "Sender is not a proxy of the account to be proxied."] - NotProxy, - #[codec(index = 3)] - #[doc = "A call which is incompatible with the proxy type's filter was attempted."] - Unproxyable, - #[codec(index = 4)] - #[doc = "Account is already a proxy."] - Duplicate, - #[codec(index = 5)] - #[doc = "Call may not be made by proxy because it may escalate its privileges."] - NoPermission, - #[codec(index = 6)] - #[doc = "Announcement, if made at all, was made too recently."] - Unannounced, - #[codec(index = 7)] - #[doc = "Cannot add self as proxy."] - NoSelfProxy, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A proxy was executed correctly, with the given."] - ProxyExecuted { - result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - }, - #[codec(index = 1)] - #[doc = "Anonymous account has been created by new proxy with given"] - #[doc = "disambiguation index and proxy type."] - AnonymousCreated { - anonymous: ::subxt::sp_core::crypto::AccountId32, - who: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - disambiguation_index: ::core::primitive::u16, - }, - #[codec(index = 2)] - #[doc = "An announcement was placed to make a call in the future."] - Announced { - real: ::subxt::sp_core::crypto::AccountId32, - proxy: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - #[codec(index = 3)] - #[doc = "A proxy was added."] - ProxyAdded { - delegator: ::subxt::sp_core::crypto::AccountId32, - delegatee: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "A proxy was removed."] - ProxyRemoved { - delegator: ::subxt::sp_core::crypto::AccountId32, - delegatee: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Announcement<_0, _1, _2> { - pub real: _0, - pub call_hash: _1, - pub height: _2, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ProxyDefinition<_0, _1, _2> { - pub delegate: _0, - pub proxy_type: _1, - pub delay: _2, - } - } - pub mod pallet_session { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Sets the session key(s) of the function caller to `keys`."] - #[doc = "Allows an account to set its session key prior to becoming a validator."] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be signed."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] - #[doc = " `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] - #[doc = "- DbWrites: `origin account`, `NextKeys`"] - #[doc = "- DbReads per key id: `KeyOwner`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - set_keys { - keys: runtime_types::rococo_runtime::SessionKeys, - proof: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 1)] - #[doc = "Removes any session key(s) of the function caller."] - #[doc = ""] - #[doc = "This doesn't take effect until the next session."] - #[doc = ""] - #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] - #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] - #[doc = "means being a controller account) or directly convertible into a validator ID (which"] - #[doc = "usually means being a stash account)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] - #[doc = " of `T::Keys::key_ids()` which is fixed."] - #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] - #[doc = "- DbWrites: `NextKeys`, `origin account`"] - #[doc = "- DbWrites per key id: `KeyOwner`"] - #[doc = "# "] - purge_keys, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Invalid ownership proof."] - InvalidProof, - #[codec(index = 1)] - #[doc = "No associated validator ID for account."] - NoAssociatedValidatorId, - #[codec(index = 2)] - #[doc = "Registered duplicate key."] - DuplicatedKey, - #[codec(index = 3)] - #[doc = "No keys are associated with this account."] - NoKeys, - #[codec(index = 4)] - #[doc = "Key setting account is not live, so it's impossible to associate keys."] - NoAccount, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "New session has happened. Note that the argument is the session index, not the"] - #[doc = "block number as the type might suggest."] - NewSession { - session_index: ::core::primitive::u32, - }, - } - } - } - pub mod pallet_sudo { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + 10,000."] - #[doc = "# "] - sudo { - call: ::std::boxed::Box, - }, - #[codec(index = 1)] - #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] - #[doc = "This function does not check the weight of the call, and instead allows the"] - #[doc = "Sudo user to specify the weight of the call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- The weight of this call is defined by the caller."] - #[doc = "# "] - sudo_unchecked_weight { - call: ::std::boxed::Box, - weight: ::core::primitive::u64, - }, - #[codec(index = 2)] - #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] - #[doc = "key."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB change."] - #[doc = "# "] - set_key { - new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 3)] - #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] - #[doc = "a given account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + 10,000."] - #[doc = "# "] - sudo_as { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - call: ::std::boxed::Box, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Sender must be the Sudo account"] - RequireSudo, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A sudo just took place. \\[result\\]"] - Sudid { - sudo_result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - }, - #[codec(index = 1)] - #[doc = "The \\[sudoer\\] just switched identity; the old key is supplied if one existed."] - KeyChanged { - old_sudoer: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - }, - #[codec(index = 2)] - #[doc = "A sudo just took place. \\[result\\]"] - SudoAsDone { - sudo_result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - }, - } - } - } - pub mod pallet_timestamp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Set the current time."] - #[doc = ""] - #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] - #[doc = "phase, if this call hasn't been invoked by that time."] - #[doc = ""] - #[doc = "The timestamp should be greater than the previous one by the amount specified by"] - #[doc = "`MinimumPeriod`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be `Inherent`."] - #[doc = ""] - #[doc = "# "] - #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] - #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] - #[doc = " `on_finalize`)"] - #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] - #[doc = "# "] - set { - #[codec(compact)] - now: ::core::primitive::u64, - }, - } - } - } - pub mod pallet_transaction_payment { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ChargeTransactionPayment(#[codec(compact)] pub ::core::primitive::u128); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V1Ancient, - #[codec(index = 1)] - V2, - } - } - pub mod pallet_utility { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - batch { - calls: ::std::vec::Vec, - }, - #[codec(index = 1)] - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] - #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - as_derivative { - index: ::core::primitive::u16, - call: ::std::boxed::Box, - }, - #[codec(index = 2)] - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - batch_all { - calls: ::std::vec::Vec, - }, - #[codec(index = 3)] - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "# "] - #[doc = "- O(1)."] - #[doc = "- Limited storage reads."] - #[doc = "- One DB write (event)."] - #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] - #[doc = "# "] - dispatch_as { - as_origin: ::std::boxed::Box, - call: ::std::boxed::Box, - }, - #[codec(index = 4)] - #[doc = "Send a batch of dispatch calls."] - #[doc = "Unlike `batch`, it allows errors and won't interrupt."] - #[doc = ""] - #[doc = "May be called from any origin."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "# "] - #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] - #[doc = "# "] - force_batch { - calls: ::std::vec::Vec, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Too many calls batched."] - TooManyCalls, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] - #[doc = "well as the error."] - BatchInterrupted { - index: ::core::primitive::u32, - error: runtime_types::sp_runtime::DispatchError, - }, - #[codec(index = 1)] - #[doc = "Batch of dispatches completed fully with no error."] - BatchCompleted, - #[codec(index = 2)] - #[doc = "Batch of dispatches completed but has errors."] - BatchCompletedWithErrors, - #[codec(index = 3)] - #[doc = "A single item within a Batch of dispatches has completed with no error."] - ItemCompleted, - #[codec(index = 4)] - #[doc = "A single item within a Batch of dispatches has completed with error."] - ItemFailed { - error: runtime_types::sp_runtime::DispatchError, - }, - #[codec(index = 5)] - #[doc = "A call was dispatched."] - DispatchedAs { - result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - }, - } - } - } - pub mod pallet_xcm { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - send { - dest: ::std::boxed::Box, - message: ::std::boxed::Box, - }, - #[codec(index = 1)] - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - teleport_assets { - dest: ::std::boxed::Box, - beneficiary: ::std::boxed::Box, - assets: ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - }, - #[codec(index = 2)] - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] - #[doc = "with all fees taken as needed from the asset."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - reserve_transfer_assets { - dest: ::std::boxed::Box, - beneficiary: ::std::boxed::Box, - assets: ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Execute an XCM message from a local, signed, origin."] - #[doc = ""] - #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] - #[doc = "partially."] - #[doc = ""] - #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than the"] - #[doc = "maximum amount of weight that the message could take to be executed, then no execution"] - #[doc = "attempt will be made."] - #[doc = ""] - #[doc = "NOTE: A successful return to this does *not* imply that the `msg` was executed successfully"] - #[doc = "to completion; only that *some* of it was executed."] - execute { - message: ::std::boxed::Box, - max_weight: ::core::primitive::u64, - }, - #[codec(index = 4)] - #[doc = "Extoll that a particular destination can be communicated with through a particular"] - #[doc = "version of XCM."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The destination that is being described."] - #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] - force_xcm_version { - location: - ::std::boxed::Box, - xcm_version: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] - #[doc = "version a destination can accept is unknown)."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] - force_default_xcm_version { - maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 6)] - #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] - force_subscribe_version_notify { - location: ::std::boxed::Box, - }, - #[codec(index = 7)] - #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] - #[doc = "version changes."] - #[doc = ""] - #[doc = "- `origin`: Must be Root."] - #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] - #[doc = " notifications which we no longer desire."] - force_unsubscribe_version_notify { - location: ::std::boxed::Box, - }, - #[codec(index = 8)] - #[doc = "Transfer some assets from the local chain to the sovereign account of a destination"] - #[doc = "chain and forward a notification XCM."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the fee on the"] - #[doc = " `dest` side."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - limited_reserve_transfer_assets { - dest: ::std::boxed::Box, - beneficiary: ::std::boxed::Box, - assets: ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - }, - #[codec(index = 9)] - #[doc = "Teleport some assets from the local chain to some destination chain."] - #[doc = ""] - #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] - #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] - #[doc = "is needed than `weight_limit`, then the operation will fail and the assets send may be"] - #[doc = "at risk."] - #[doc = ""] - #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] - #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send"] - #[doc = " from parachain to parachain, or `X1(Parachain(..))` to send from relay to parachain."] - #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will generally be"] - #[doc = " an `AccountId32` value."] - #[doc = "- `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the"] - #[doc = " `dest` side. May not be empty."] - #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] - #[doc = " fees."] - #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] - limited_teleport_assets { - dest: ::std::boxed::Box, - beneficiary: ::std::boxed::Box, - assets: ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, - weight_limit: runtime_types::xcm::v2::WeightLimit, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The desired destination was unreachable, generally because there is a no way of routing"] - #[doc = "to it."] - Unreachable, - #[codec(index = 1)] - #[doc = "There was some other issue (i.e. not to do with routing) in sending the message. Perhaps"] - #[doc = "a lack of space for buffering the message."] - SendFailure, - #[codec(index = 2)] - #[doc = "The message execution fails the filter."] - Filtered, - #[codec(index = 3)] - #[doc = "The message's weight could not be determined."] - UnweighableMessage, - #[codec(index = 4)] - #[doc = "The destination `MultiLocation` provided cannot be inverted."] - DestinationNotInvertible, - #[codec(index = 5)] - #[doc = "The assets to be sent are empty."] - Empty, - #[codec(index = 6)] - #[doc = "Could not re-anchor the assets to declare the fees for the destination chain."] - CannotReanchor, - #[codec(index = 7)] - #[doc = "Too many assets have been attempted for transfer."] - TooManyAssets, - #[codec(index = 8)] - #[doc = "Origin is invalid for sending."] - InvalidOrigin, - #[codec(index = 9)] - #[doc = "The version of the `Versioned` value used is not able to be interpreted."] - BadVersion, - #[codec(index = 10)] - #[doc = "The given location could not be used (e.g. because it cannot be expressed in the"] - #[doc = "desired version of XCM)."] - BadLocation, - #[codec(index = 11)] - #[doc = "The referenced subscription could not be found."] - NoSubscription, - #[codec(index = 12)] - #[doc = "The location is invalid since it already has a subscription from us."] - AlreadySubscribed, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Execution of an XCM message was attempted."] - #[doc = ""] - #[doc = "\\[ outcome \\]"] - Attempted(runtime_types::xcm::v2::traits::Outcome), - #[codec(index = 1)] - #[doc = "A XCM message was sent."] - #[doc = ""] - #[doc = "\\[ origin, destination, message \\]"] - Sent( - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::v2::Xcm, - ), - #[codec(index = 2)] - #[doc = "Query response received which does not match a registered query. This may be because a"] - #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] - #[doc = "because the query timed out."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - UnexpectedResponse( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ), - #[codec(index = 3)] - #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] - #[doc = "no registered notification call."] - #[doc = ""] - #[doc = "\\[ id, response \\]"] - ResponseReady(::core::primitive::u64, runtime_types::xcm::v2::Response), - #[codec(index = 4)] - #[doc = "Query response has been received and query is removed. The registered notification has"] - #[doc = "been dispatched and executed successfully."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - Notified( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 5)] - #[doc = "Query response has been received and query is removed. The registered notification could"] - #[doc = "not be dispatched because the dispatch weight is greater than the maximum weight"] - #[doc = "originally budgeted by this runtime for the query result."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index, actual weight, max budgeted weight \\]"] - NotifyOverweight( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 6)] - #[doc = "Query response has been received and query is removed. There was a general error with"] - #[doc = "dispatching the notification call."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - NotifyDispatchError( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 7)] - #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] - #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] - #[doc = "is not `(origin, QueryId, Response)`."] - #[doc = ""] - #[doc = "\\[ id, pallet index, call index \\]"] - NotifyDecodeFailed( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 8)] - #[doc = "Expected query response has been received but the origin location of the response does"] - #[doc = "not match that expected. The query remains registered for a later, valid, response to"] - #[doc = "be received and acted upon."] - #[doc = ""] - #[doc = "\\[ origin location, id, expected location \\]"] - InvalidResponder( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ::core::option::Option< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - ), - #[codec(index = 9)] - #[doc = "Expected query response has been received but the expected origin location placed in"] - #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] - #[doc = ""] - #[doc = "This is unexpected (since a location placed in storage in a previously executing"] - #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] - #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] - #[doc = "needed."] - #[doc = ""] - #[doc = "\\[ origin location, id \\]"] - InvalidResponderVersion( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ), - #[codec(index = 10)] - #[doc = "Received query response has been read and removed."] - #[doc = ""] - #[doc = "\\[ id \\]"] - ResponseTaken(::core::primitive::u64), - #[codec(index = 11)] - #[doc = "Some assets have been placed in an asset trap."] - #[doc = ""] - #[doc = "\\[ hash, origin, assets \\]"] - AssetsTrapped( - ::subxt::sp_core::H256, - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::VersionedMultiAssets, - ), - #[codec(index = 12)] - #[doc = "An XCM version change notification message has been attempted to be sent."] - #[doc = ""] - #[doc = "\\[ destination, result \\]"] - VersionChangeNotified( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u32, - ), - #[codec(index = 13)] - #[doc = "The supported version of a location has been changed. This might be through an"] - #[doc = "automatic notification or a manual intervention."] - #[doc = ""] - #[doc = "\\[ location, XCM version \\]"] - SupportedVersionChanged( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u32, - ), - #[codec(index = 14)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "sending the notification to it."] - #[doc = ""] - #[doc = "\\[ location, query ID, error \\]"] - NotifyTargetSendFail( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - runtime_types::xcm::v2::traits::Error, - ), - #[codec(index = 15)] - #[doc = "A given location which had a version change subscription was dropped owing to an error"] - #[doc = "migrating the location to our new XCM format."] - #[doc = ""] - #[doc = "\\[ location, query ID \\]"] - NotifyTargetMigrationFail( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u64, - ), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Origin { - #[codec(index = 0)] - Xcm(runtime_types::xcm::v1::multilocation::MultiLocation), - #[codec(index = 1)] - Response(runtime_types::xcm::v1::multilocation::MultiLocation), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum QueryStatus<_0> { - #[codec(index = 0)] - Pending { - responder: runtime_types::xcm::VersionedMultiLocation, - maybe_notify: - ::core::option::Option<(::core::primitive::u8, ::core::primitive::u8)>, - timeout: _0, - }, - #[codec(index = 1)] - VersionNotifier { - origin: runtime_types::xcm::VersionedMultiLocation, - is_active: ::core::primitive::bool, - }, - #[codec(index = 2)] - Ready { - response: runtime_types::xcm::VersionedResponse, - at: _0, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum VersionMigrationStage { - #[codec(index = 0)] - MigrateSupportedVersion, - #[codec(index = 1)] - MigrateVersionNotifiers, - #[codec(index = 2)] - NotifyCurrentTargets( - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ), - #[codec(index = 3)] - MigrateAndNotifyOldTargets, - } - } - } - pub mod polkadot_core_primitives { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CandidateHash(pub ::subxt::sp_core::H256); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct InboundDownwardMessage<_0> { - pub sent_at: _0, - pub msg: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct InboundHrmpMessage<_0> { - pub sent_at: _0, - pub data: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct OutboundHrmpMessage<_0> { - pub recipient: _0, - pub data: ::std::vec::Vec<::core::primitive::u8>, - } - } - pub mod polkadot_parachain { - use super::runtime_types; - pub mod primitives { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HeadData(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HrmpChannelId { - pub sender: runtime_types::polkadot_parachain::primitives::Id, - pub recipient: runtime_types::polkadot_parachain::primitives::Id, - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct Id(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ValidationCode(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ValidationCodeHash(pub ::subxt::sp_core::H256); - } - } - pub mod polkadot_primitives { - use super::runtime_types; - pub mod v2 { - use super::runtime_types; - pub mod assignment_app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - pub mod collator_app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - pub mod signed { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct UncheckedSigned<_0, _1> { - pub payload: _0, - pub validator_index: runtime_types::polkadot_primitives::v2::ValidatorIndex, - pub signature: - runtime_types::polkadot_primitives::v2::validator_app::Signature, - #[codec(skip)] - pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, - } - } - pub mod validator_app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AvailabilityBitfield( - pub ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - ); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BackedCandidate<_0> { - pub candidate: - runtime_types::polkadot_primitives::v2::CommittedCandidateReceipt<_0>, - pub validity_votes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidityAttestation, - >, - pub validator_indices: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CandidateCommitments<_0> { - pub upward_messages: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - pub horizontal_messages: ::std::vec::Vec< - runtime_types::polkadot_core_primitives::OutboundHrmpMessage< - runtime_types::polkadot_parachain::primitives::Id, - >, - >, - pub new_validation_code: ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCode, - >, - pub head_data: runtime_types::polkadot_parachain::primitives::HeadData, - pub processed_downward_messages: _0, - pub hrmp_watermark: _0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CandidateDescriptor<_0> { - pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub relay_parent: _0, - pub collator: runtime_types::polkadot_primitives::v2::collator_app::Public, - pub persisted_validation_data_hash: _0, - pub pov_hash: _0, - pub erasure_root: _0, - pub signature: runtime_types::polkadot_primitives::v2::collator_app::Signature, - pub para_head: _0, - pub validation_code_hash: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CandidateReceipt<_0> { - pub descriptor: runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, - pub commitments_hash: _0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CommittedCandidateReceipt<_0> { - pub descriptor: runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, - pub commitments: runtime_types::polkadot_primitives::v2::CandidateCommitments< - ::core::primitive::u32, - >, - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct CoreIndex(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum CoreOccupied { - #[codec(index = 0)] - Parathread(runtime_types::polkadot_primitives::v2::ParathreadEntry), - #[codec(index = 1)] - Parachain, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DisputeState<_0> { - pub validators_for: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub validators_against: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub start: _0, - pub concluded_at: ::core::option::Option<_0>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum DisputeStatement { - #[codec(index = 0)] - Valid(runtime_types::polkadot_primitives::v2::ValidDisputeStatementKind), - #[codec(index = 1)] - Invalid(runtime_types::polkadot_primitives::v2::InvalidDisputeStatementKind), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DisputeStatementSet { - pub candidate_hash: runtime_types::polkadot_core_primitives::CandidateHash, - pub session: ::core::primitive::u32, - pub statements: ::std::vec::Vec<( - runtime_types::polkadot_primitives::v2::DisputeStatement, - runtime_types::polkadot_primitives::v2::ValidatorIndex, - runtime_types::polkadot_primitives::v2::validator_app::Signature, - )>, - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct GroupIndex(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct InherentData<_0> { - pub bitfields: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::signed::UncheckedSigned< - runtime_types::polkadot_primitives::v2::AvailabilityBitfield, - runtime_types::polkadot_primitives::v2::AvailabilityBitfield, - >, - >, - pub backed_candidates: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::BackedCandidate< - ::subxt::sp_core::H256, - >, - >, - pub disputes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::DisputeStatementSet, - >, - pub parent_header: _0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum InvalidDisputeStatementKind { - #[codec(index = 0)] - Explicit, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ParathreadClaim( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_primitives::v2::collator_app::Public, - ); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ParathreadEntry { - pub claim: runtime_types::polkadot_primitives::v2::ParathreadClaim, - pub retries: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PvfCheckStatement { - pub accept: ::core::primitive::bool, - pub subject: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub session_index: ::core::primitive::u32, - pub validator_index: runtime_types::polkadot_primitives::v2::ValidatorIndex, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ScrapedOnChainVotes<_0> { - pub session: ::core::primitive::u32, - pub backing_validators_per_candidate: ::std::vec::Vec<( - runtime_types::polkadot_primitives::v2::CandidateReceipt<_0>, - ::std::vec::Vec<( - runtime_types::polkadot_primitives::v2::ValidatorIndex, - runtime_types::polkadot_primitives::v2::ValidityAttestation, - )>, - )>, - pub disputes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::DisputeStatementSet, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SessionInfo { - pub active_validator_indices: - ::std::vec::Vec, - pub random_seed: [::core::primitive::u8; 32usize], - pub dispute_period: ::core::primitive::u32, - pub validators: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - pub discovery_keys: - ::std::vec::Vec, - pub assignment_keys: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::assignment_app::Public, - >, - pub validator_groups: ::std::vec::Vec< - ::std::vec::Vec, - >, - pub n_cores: ::core::primitive::u32, - pub zeroth_delay_tranche_width: ::core::primitive::u32, - pub relay_vrf_modulo_samples: ::core::primitive::u32, - pub n_delay_tranches: ::core::primitive::u32, - pub no_show_slots: ::core::primitive::u32, - pub needed_approvals: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum UpgradeGoAhead { - #[codec(index = 0)] - Abort, - #[codec(index = 1)] - GoAhead, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum UpgradeRestriction { - #[codec(index = 0)] - Present, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum ValidDisputeStatementKind { - #[codec(index = 0)] - Explicit, - #[codec(index = 1)] - BackingSeconded(::subxt::sp_core::H256), - #[codec(index = 2)] - BackingValid(::subxt::sp_core::H256), - #[codec(index = 3)] - ApprovalChecking, - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct ValidatorIndex(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum ValidityAttestation { - #[codec(index = 1)] - Implicit(runtime_types::polkadot_primitives::v2::validator_app::Signature), - #[codec(index = 2)] - Explicit(runtime_types::polkadot_primitives::v2::validator_app::Signature), - } - } - } - pub mod polkadot_runtime_common { - use super::runtime_types; - pub mod assigned_slots { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - # [codec (index = 0)] # [doc = "Assign a permanent parachain slot and immediately create a lease for it."] assign_perm_parachain_slot { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 1)] # [doc = "Assign a temporary parachain slot. The function tries to create a lease for it"] # [doc = "immediately if `SlotLeasePeriodStart::Current` is specified, and if the number"] # [doc = "of currently active temporary slots is below `MaxTemporarySlotPerLeasePeriod`."] assign_temp_parachain_slot { id : runtime_types :: polkadot_parachain :: primitives :: Id , lease_period_start : runtime_types :: polkadot_runtime_common :: assigned_slots :: SlotLeasePeriodStart , } , # [codec (index = 2)] # [doc = "Unassign a permanent or temporary parachain slot"] unassign_parachain_slot { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The specified parachain or parathread is not registered."] - ParaDoesntExist, - #[codec(index = 1)] - #[doc = "Not a parathread."] - NotParathread, - #[codec(index = 2)] - #[doc = "Cannot upgrade parathread."] - CannotUpgrade, - #[codec(index = 3)] - #[doc = "Cannot downgrade parachain."] - CannotDowngrade, - #[codec(index = 4)] - #[doc = "Permanent or Temporary slot already assigned."] - SlotAlreadyAssigned, - #[codec(index = 5)] - #[doc = "Permanent or Temporary slot has not been assigned."] - SlotNotAssigned, - #[codec(index = 6)] - #[doc = "An ongoing lease already exists."] - OngoingLeaseExists, - #[codec(index = 7)] - MaxPermanentSlotsExceeded, - #[codec(index = 8)] - MaxTemporarySlotsExceeded, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A para was assigned a permanent parachain slot"] - PermanentSlotAssigned(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 1)] - #[doc = "A para was assigned a temporary parachain slot"] - TemporarySlotAssigned(runtime_types::polkadot_parachain::primitives::Id), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ParachainTemporarySlot<_0, _1> { - pub manager: _0, - pub period_begin: _1, - pub period_count: _1, - pub last_lease: ::core::option::Option<_1>, - pub lease_count: _1, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum SlotLeasePeriodStart { - #[codec(index = 0)] - Current, - #[codec(index = 1)] - Next, - } - } - pub mod auctions { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Create a new auction."] - #[doc = ""] - #[doc = "This can only happen when there isn't already an auction in progress and may only be"] - #[doc = "called by the root origin. Accepts the `duration` of this auction and the"] - #[doc = "`lease_period_index` of the initial lease period of the four that are to be auctioned."] - new_auction { - #[codec(compact)] - duration: ::core::primitive::u32, - #[codec(compact)] - lease_period_index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Make a new bid from an account (including a parachain account) for deploying a new"] - #[doc = "parachain."] - #[doc = ""] - #[doc = "Multiple simultaneous bids from the same bidder are allowed only as long as all active"] - #[doc = "bids overlap each other (i.e. are mutually exclusive). Bids cannot be redacted."] - #[doc = ""] - #[doc = "- `sub` is the sub-bidder ID, allowing for multiple competing bids to be made by (and"] - #[doc = "funded by) the same account."] - #[doc = "- `auction_index` is the index of the auction to bid on. Should just be the present"] - #[doc = "value of `AuctionCounter`."] - #[doc = "- `first_slot` is the first lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `last_slot` is the last lease period index of the range to bid on. This is the"] - #[doc = "absolute lease period index value, not an auction-specific offset."] - #[doc = "- `amount` is the amount to bid to be held as deposit for the parachain should the"] - #[doc = "bid win. This amount is held throughout the range."] - bid { - #[codec(compact)] - para: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - auction_index: ::core::primitive::u32, - #[codec(compact)] - first_slot: ::core::primitive::u32, - #[codec(compact)] - last_slot: ::core::primitive::u32, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Cancel an in-progress auction."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - cancel_auction, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "This auction is already in progress."] - AuctionInProgress, - #[codec(index = 1)] - #[doc = "The lease period is in the past."] - LeasePeriodInPast, - #[codec(index = 2)] - #[doc = "Para is not registered"] - ParaNotRegistered, - #[codec(index = 3)] - #[doc = "Not a current auction."] - NotCurrentAuction, - #[codec(index = 4)] - #[doc = "Not an auction."] - NotAuction, - #[codec(index = 5)] - #[doc = "Auction has already ended."] - AuctionEnded, - #[codec(index = 6)] - #[doc = "The para is already leased out for part of this range."] - AlreadyLeasedOut, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "An auction started. Provides its index and the block number where it will begin to"] - #[doc = "close and the first lease period of the quadruplet that is auctioned."] - #[doc = "`[auction_index, lease_period, ending]`"] - AuctionStarted( - ::core::primitive::u32, - ::core::primitive::u32, - ::core::primitive::u32, - ), - #[codec(index = 1)] - #[doc = "An auction ended. All funds become unreserved. `[auction_index]`"] - AuctionClosed(::core::primitive::u32), - #[codec(index = 2)] - #[doc = "Funds were reserved for a winning bid. First balance is the extra amount reserved."] - #[doc = "Second is the total. `[bidder, extra_reserved, total_amount]`"] - Reserved( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u128, - ), - #[codec(index = 3)] - #[doc = "Funds were unreserved since bidder is no longer active. `[bidder, amount]`"] - Unreserved( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 4)] - #[doc = "Someone attempted to lease the same slot twice for a parachain. The amount is held in reserve"] - #[doc = "but no parachain slot has been leased."] - #[doc = "`[parachain_id, leaser, amount]`"] - ReserveConfiscated( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 5)] - #[doc = "A new bid has been accepted as the current winner."] - #[doc = "`[who, para_id, amount, first_slot, last_slot]`"] - BidAccepted( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - ::core::primitive::u32, - ::core::primitive::u32, - ), - #[codec(index = 6)] - #[doc = "The winning offset was chosen for an auction. This will map into the `Winning` storage map."] - #[doc = "`[auction_index, block_number]`"] - WinningOffset(::core::primitive::u32, ::core::primitive::u32), - } - } - } - pub mod crowdloan { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Create a new crowdloaning campaign for a parachain slot with the given lease period range."] - #[doc = ""] - #[doc = "This applies a lock to your parachain configuration, ensuring that it cannot be changed"] - #[doc = "by the parachain manager."] - create { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - cap: ::core::primitive::u128, - #[codec(compact)] - first_period: ::core::primitive::u32, - #[codec(compact)] - last_period: ::core::primitive::u32, - #[codec(compact)] - end: ::core::primitive::u32, - verifier: - ::core::option::Option, - }, - #[codec(index = 1)] - #[doc = "Contribute to a crowd sale. This will transfer some balance over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - contribute { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - value: ::core::primitive::u128, - signature: - ::core::option::Option, - }, - #[codec(index = 2)] - #[doc = "Withdraw full balance of a specific contributor."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - #[doc = ""] - #[doc = "The fund must be either in, or ready for, retirement. For a fund to be *in* retirement, then the retirement"] - #[doc = "flag must be set. For a fund to be ready for retirement, then:"] - #[doc = "- it must not already be in retirement;"] - #[doc = "- the amount of raised funds must be bigger than the _free_ balance of the account;"] - #[doc = "- and either:"] - #[doc = " - the block number must be at least `end`; or"] - #[doc = " - the current lease period must be greater than the fund's `last_period`."] - #[doc = ""] - #[doc = "In this case, the fund's retirement flag is set and its `end` is reset to the current block"] - #[doc = "number."] - #[doc = ""] - #[doc = "- `who`: The account whose contribution should be withdrawn."] - #[doc = "- `index`: The parachain to whose crowdloan the contribution was made."] - withdraw { - who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 3)] - #[doc = "Automatically refund contributors of an ended crowdloan."] - #[doc = "Due to weight restrictions, this function may need to be called multiple"] - #[doc = "times to fully refund all users. We will refund `RemoveKeysLimit` users at a time."] - #[doc = ""] - #[doc = "Origin must be signed, but can come from anyone."] - refund { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 4)] - #[doc = "Remove a fund after the retirement period has ended and all funds have been returned."] - dissolve { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 5)] - #[doc = "Edit the configuration for an in-progress crowdloan."] - #[doc = ""] - #[doc = "Can only be called by Root origin."] - edit { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - cap: ::core::primitive::u128, - #[codec(compact)] - first_period: ::core::primitive::u32, - #[codec(compact)] - last_period: ::core::primitive::u32, - #[codec(compact)] - end: ::core::primitive::u32, - verifier: - ::core::option::Option, - }, - #[codec(index = 6)] - #[doc = "Add an optional memo to an existing crowdloan contribution."] - #[doc = ""] - #[doc = "Origin must be Signed, and the user must have contributed to the crowdloan."] - add_memo { - index: runtime_types::polkadot_parachain::primitives::Id, - memo: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 7)] - #[doc = "Poke the fund into `NewRaise`"] - #[doc = ""] - #[doc = "Origin must be Signed, and the fund has non-zero raise."] - poke { - index: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 8)] - #[doc = "Contribute your entire balance to a crowd sale. This will transfer the entire balance of a user over to fund a parachain"] - #[doc = "slot. It will be withdrawable when the crowdloan has ended and the funds are unused."] - contribute_all { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - signature: - ::core::option::Option, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The current lease period is more than the first lease period."] - FirstPeriodInPast, - #[codec(index = 1)] - #[doc = "The first lease period needs to at least be less than 3 `max_value`."] - FirstPeriodTooFarInFuture, - #[codec(index = 2)] - #[doc = "Last lease period must be greater than first lease period."] - LastPeriodBeforeFirstPeriod, - #[codec(index = 3)] - #[doc = "The last lease period cannot be more than 3 periods after the first period."] - LastPeriodTooFarInFuture, - #[codec(index = 4)] - #[doc = "The campaign ends before the current block number. The end must be in the future."] - CannotEndInPast, - #[codec(index = 5)] - #[doc = "The end date for this crowdloan is not sensible."] - EndTooFarInFuture, - #[codec(index = 6)] - #[doc = "There was an overflow."] - Overflow, - #[codec(index = 7)] - #[doc = "The contribution was below the minimum, `MinContribution`."] - ContributionTooSmall, - #[codec(index = 8)] - #[doc = "Invalid fund index."] - InvalidParaId, - #[codec(index = 9)] - #[doc = "Contributions exceed maximum amount."] - CapExceeded, - #[codec(index = 10)] - #[doc = "The contribution period has already ended."] - ContributionPeriodOver, - #[codec(index = 11)] - #[doc = "The origin of this call is invalid."] - InvalidOrigin, - #[codec(index = 12)] - #[doc = "This crowdloan does not correspond to a parachain."] - NotParachain, - #[codec(index = 13)] - #[doc = "This parachain lease is still active and retirement cannot yet begin."] - LeaseActive, - #[codec(index = 14)] - #[doc = "This parachain's bid or lease is still active and withdraw cannot yet begin."] - BidOrLeaseActive, - #[codec(index = 15)] - #[doc = "The crowdloan has not yet ended."] - FundNotEnded, - #[codec(index = 16)] - #[doc = "There are no contributions stored in this crowdloan."] - NoContributions, - #[codec(index = 17)] - #[doc = "The crowdloan is not ready to dissolve. Potentially still has a slot or in retirement period."] - NotReadyToDissolve, - #[codec(index = 18)] - #[doc = "Invalid signature."] - InvalidSignature, - #[codec(index = 19)] - #[doc = "The provided memo is too large."] - MemoTooLarge, - #[codec(index = 20)] - #[doc = "The fund is already in `NewRaise`"] - AlreadyInNewRaise, - #[codec(index = 21)] - #[doc = "No contributions allowed during the VRF delay"] - VrfDelayInProgress, - #[codec(index = 22)] - #[doc = "A lease period has not started yet, due to an offset in the starting block."] - NoLeasePeriod, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Create a new crowdloaning campaign. `[fund_index]`"] - Created(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 1)] - #[doc = "Contributed to a crowd sale. `[who, fund_index, amount]`"] - Contributed( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - ), - #[codec(index = 2)] - #[doc = "Withdrew full balance of a contributor. `[who, fund_index, amount]`"] - Withdrew( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u128, - ), - #[codec(index = 3)] - #[doc = "The loans in a fund have been partially dissolved, i.e. there are some left"] - #[doc = "over child keys that still need to be killed. `[fund_index]`"] - PartiallyRefunded(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 4)] - #[doc = "All loans in a fund have been refunded. `[fund_index]`"] - AllRefunded(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 5)] - #[doc = "Fund is dissolved. `[fund_index]`"] - Dissolved(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 6)] - #[doc = "The result of trying to submit a new bid to the Slots pallet."] - HandleBidResult( - runtime_types::polkadot_parachain::primitives::Id, - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ), - #[codec(index = 7)] - #[doc = "The configuration to a crowdloan has been edited. `[fund_index]`"] - Edited(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 8)] - #[doc = "A memo has been updated. `[who, fund_index, memo]`"] - MemoUpdated( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ::std::vec::Vec<::core::primitive::u8>, - ), - #[codec(index = 9)] - #[doc = "A parachain has been moved to `NewRaise`"] - AddedToNewRaise(runtime_types::polkadot_parachain::primitives::Id), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct FundInfo<_0, _1, _2, _3> { - pub depositor: _0, - pub verifier: ::core::option::Option, - pub deposit: _1, - pub raised: _1, - pub end: _2, - pub cap: _1, - pub last_contribution: - runtime_types::polkadot_runtime_common::crowdloan::LastContribution<_2>, - pub first_period: _2, - pub last_period: _2, - pub fund_index: _2, - #[codec(skip)] - pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum LastContribution<_0> { - #[codec(index = 0)] - Never, - #[codec(index = 1)] - PreEnding(_0), - #[codec(index = 2)] - Ending(_0), - } - } - pub mod paras_registrar { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Register head data and validation code for a reserved Para Id."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin."] - #[doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] - #[doc = "- `genesis_head`: The genesis head data of the parachain/thread."] - #[doc = "- `validation_code`: The initial validation code of the parachain/thread."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] - #[doc = "reserved previously for this para ID is accounted for."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Registered` event is emitted in case of success."] - register { - id: runtime_types::polkadot_parachain::primitives::Id, - genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - }, - #[codec(index = 1)] - #[doc = "Force the registration of a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function must be called by a Root origin."] - #[doc = ""] - #[doc = "The deposit taken can be specified for this registration. Any `ParaId`"] - #[doc = "can be registered, including sub-1000 IDs which are System Parachains."] - force_register { - who: ::subxt::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - }, - #[codec(index = 2)] - #[doc = "Deregister a Para Id, freeing all data and returning any deposit."] - #[doc = ""] - #[doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] - deregister { - id: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 3)] - #[doc = "Swap a parachain with another parachain or parathread."] - #[doc = ""] - #[doc = "The origin must be Root, the `para` owner, or the `para` itself."] - #[doc = ""] - #[doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] - #[doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] - #[doc = ""] - #[doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] - #[doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] - #[doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] - #[doc = "and the auction deposit are switched."] - swap { - id: runtime_types::polkadot_parachain::primitives::Id, - other: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 4)] - #[doc = "Remove a manager lock from a para. This will allow the manager of a"] - #[doc = "previously locked para to deregister or swap a para without using governance."] - #[doc = ""] - #[doc = "Can only be called by the Root origin."] - force_remove_lock { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 5)] - #[doc = "Reserve a Para Id on the relay chain."] - #[doc = ""] - #[doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] - #[doc = "The origin account is able to register head data and validation code using `register` to create"] - #[doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] - #[doc = ""] - #[doc = "## Arguments"] - #[doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] - #[doc = ""] - #[doc = "## Deposits/Fees"] - #[doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] - #[doc = ""] - #[doc = "## Events"] - #[doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] - reserve, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The ID is not registered."] - NotRegistered, - #[codec(index = 1)] - #[doc = "The ID is already registered."] - AlreadyRegistered, - #[codec(index = 2)] - #[doc = "The caller is not the owner of this Id."] - NotOwner, - #[codec(index = 3)] - #[doc = "Invalid para code size."] - CodeTooLarge, - #[codec(index = 4)] - #[doc = "Invalid para head data size."] - HeadDataTooLarge, - #[codec(index = 5)] - #[doc = "Para is not a Parachain."] - NotParachain, - #[codec(index = 6)] - #[doc = "Para is not a Parathread."] - NotParathread, - #[codec(index = 7)] - #[doc = "Cannot deregister para"] - CannotDeregister, - #[codec(index = 8)] - #[doc = "Cannot schedule downgrade of parachain to parathread"] - CannotDowngrade, - #[codec(index = 9)] - #[doc = "Cannot schedule upgrade of parathread to parachain"] - CannotUpgrade, - #[codec(index = 10)] - #[doc = "Para is locked from manipulation by the manager. Must use parachain or relay chain governance."] - ParaLocked, - #[codec(index = 11)] - #[doc = "The ID given for registration has not been reserved."] - NotReserved, - #[codec(index = 12)] - #[doc = "Registering parachain with empty code is not allowed."] - EmptyCode, - #[codec(index = 13)] - #[doc = "Cannot perform a parachain slot / lifecycle swap. Check that the state of both paras are"] - #[doc = "correct for the swap to work."] - CannotSwap, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - Registered( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ), - #[codec(index = 1)] - Deregistered(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 2)] - Reserved( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ParaInfo<_0, _1> { - pub manager: _0, - pub deposit: _1, - pub locked: ::core::primitive::bool, - } - } - pub mod paras_sudo_wrapper { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Schedule a para to be initialized at the start of the next session."] - sudo_schedule_para_initialize { - id: runtime_types::polkadot_parachain::primitives::Id, - genesis: - runtime_types::polkadot_runtime_parachains::paras::ParaGenesisArgs, - }, - #[codec(index = 1)] - #[doc = "Schedule a para to be cleaned up at the start of the next session."] - sudo_schedule_para_cleanup { - id: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 2)] - #[doc = "Upgrade a parathread to a parachain"] - sudo_schedule_parathread_upgrade { - id: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 3)] - #[doc = "Downgrade a parachain to a parathread"] - sudo_schedule_parachain_downgrade { - id: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 4)] - #[doc = "Send a downward XCM to the given para."] - #[doc = ""] - #[doc = "The given parachain should exist and the payload should not exceed the preconfigured size"] - #[doc = "`config.max_downward_message_size`."] - sudo_queue_downward_xcm { - id: runtime_types::polkadot_parachain::primitives::Id, - xcm: ::std::boxed::Box, - }, - #[codec(index = 5)] - #[doc = "Forcefully establish a channel from the sender to the recipient."] - #[doc = ""] - #[doc = "This is equivalent to sending an `Hrmp::hrmp_init_open_channel` extrinsic followed by"] - #[doc = "`Hrmp::hrmp_accept_open_channel`."] - sudo_establish_hrmp_channel { - sender: runtime_types::polkadot_parachain::primitives::Id, - recipient: runtime_types::polkadot_parachain::primitives::Id, - max_capacity: ::core::primitive::u32, - max_message_size: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The specified parachain or parathread is not registered."] - ParaDoesntExist, - #[codec(index = 1)] - #[doc = "The specified parachain or parathread is already registered."] - ParaAlreadyExists, - #[codec(index = 2)] - #[doc = "A DMP message couldn't be sent because it exceeds the maximum size allowed for a downward"] - #[doc = "message."] - ExceedsMaxMessageSize, - #[codec(index = 3)] - #[doc = "Could not schedule para cleanup."] - CouldntCleanup, - #[codec(index = 4)] - #[doc = "Not a parathread."] - NotParathread, - #[codec(index = 5)] - #[doc = "Not a parachain."] - NotParachain, - #[codec(index = 6)] - #[doc = "Cannot upgrade parathread."] - CannotUpgrade, - #[codec(index = 7)] - #[doc = "Cannot downgrade parachain."] - CannotDowngrade, - } - } - } - pub mod slots { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Just a connect into the `lease_out` call, in case Root wants to force some lease to happen"] - #[doc = "independently of any other on-chain mechanism to use it."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - force_lease { - para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, - amount: ::core::primitive::u128, - period_begin: ::core::primitive::u32, - period_count: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Clear all leases for a Para Id, refunding any deposits back to the original owners."] - #[doc = ""] - #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] - clear_all_leases { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 2)] - #[doc = "Try to onboard a parachain that has a lease for the current lease period."] - #[doc = ""] - #[doc = "This function can be useful if there was some state issue with a para that should"] - #[doc = "have onboarded, but was unable to. As long as they have a lease period, we can"] - #[doc = "let them onboard from here."] - #[doc = ""] - #[doc = "Origin must be signed, but can be called by anyone."] - trigger_onboard { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The parachain ID is not onboarding."] - ParaNotOnboarding, - #[codec(index = 1)] - #[doc = "There was an error with the lease."] - LeaseError, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A new `[lease_period]` is beginning."] - NewLeasePeriod(::core::primitive::u32), - #[codec(index = 1)] - #[doc = "A para has won the right to a continuous set of lease periods as a parachain."] - #[doc = "First balance is any extra amount reserved on top of the para's existing deposit."] - #[doc = "Second balance is the total amount reserved."] - #[doc = "`[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`"] - Leased( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - ::core::primitive::u128, - ::core::primitive::u128, - ), - } - } - } - } - pub mod polkadot_runtime_parachains { - use super::runtime_types; - pub mod configuration { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Set the validation upgrade cooldown."] - set_validation_upgrade_cooldown { new: ::core::primitive::u32 }, - #[codec(index = 1)] - #[doc = "Set the validation upgrade delay."] - set_validation_upgrade_delay { new: ::core::primitive::u32 }, - #[codec(index = 2)] - #[doc = "Set the acceptance period for an included candidate."] - set_code_retention_period { new: ::core::primitive::u32 }, - #[codec(index = 3)] - #[doc = "Set the max validation code size for incoming upgrades."] - set_max_code_size { new: ::core::primitive::u32 }, - #[codec(index = 4)] - #[doc = "Set the max POV block size for incoming upgrades."] - set_max_pov_size { new: ::core::primitive::u32 }, - #[codec(index = 5)] - #[doc = "Set the max head data size for paras."] - set_max_head_data_size { new: ::core::primitive::u32 }, - #[codec(index = 6)] - #[doc = "Set the number of parathread execution cores."] - set_parathread_cores { new: ::core::primitive::u32 }, - #[codec(index = 7)] - #[doc = "Set the number of retries for a particular parathread."] - set_parathread_retries { new: ::core::primitive::u32 }, - #[codec(index = 8)] - #[doc = "Set the parachain validator-group rotation frequency"] - set_group_rotation_frequency { new: ::core::primitive::u32 }, - #[codec(index = 9)] - #[doc = "Set the availability period for parachains."] - set_chain_availability_period { new: ::core::primitive::u32 }, - #[codec(index = 10)] - #[doc = "Set the availability period for parathreads."] - set_thread_availability_period { new: ::core::primitive::u32 }, - #[codec(index = 11)] - #[doc = "Set the scheduling lookahead, in expected number of blocks at peak throughput."] - set_scheduling_lookahead { new: ::core::primitive::u32 }, - #[codec(index = 12)] - #[doc = "Set the maximum number of validators to assign to any core."] - set_max_validators_per_core { - new: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 13)] - #[doc = "Set the maximum number of validators to use in parachain consensus."] - set_max_validators { - new: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 14)] - #[doc = "Set the dispute period, in number of sessions to keep for disputes."] - set_dispute_period { new: ::core::primitive::u32 }, - #[codec(index = 15)] - #[doc = "Set the dispute post conclusion acceptance period."] - set_dispute_post_conclusion_acceptance_period { - new: ::core::primitive::u32, - }, - #[codec(index = 16)] - #[doc = "Set the maximum number of dispute spam slots."] - set_dispute_max_spam_slots { new: ::core::primitive::u32 }, - #[codec(index = 17)] - #[doc = "Set the dispute conclusion by time out period."] - set_dispute_conclusion_by_time_out_period { new: ::core::primitive::u32 }, - #[codec(index = 18)] - #[doc = "Set the no show slots, in number of number of consensus slots."] - #[doc = "Must be at least 1."] - set_no_show_slots { new: ::core::primitive::u32 }, - #[codec(index = 19)] - #[doc = "Set the total number of delay tranches."] - set_n_delay_tranches { new: ::core::primitive::u32 }, - #[codec(index = 20)] - #[doc = "Set the zeroth delay tranche width."] - set_zeroth_delay_tranche_width { new: ::core::primitive::u32 }, - #[codec(index = 21)] - #[doc = "Set the number of validators needed to approve a block."] - set_needed_approvals { new: ::core::primitive::u32 }, - #[codec(index = 22)] - #[doc = "Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion."] - set_relay_vrf_modulo_samples { new: ::core::primitive::u32 }, - #[codec(index = 23)] - #[doc = "Sets the maximum items that can present in a upward dispatch queue at once."] - set_max_upward_queue_count { new: ::core::primitive::u32 }, - #[codec(index = 24)] - #[doc = "Sets the maximum total size of items that can present in a upward dispatch queue at once."] - set_max_upward_queue_size { new: ::core::primitive::u32 }, - #[codec(index = 25)] - #[doc = "Set the critical downward message size."] - set_max_downward_message_size { new: ::core::primitive::u32 }, - #[codec(index = 26)] - #[doc = "Sets the soft limit for the phase of dispatching dispatchable upward messages."] - set_ump_service_total_weight { new: ::core::primitive::u64 }, - #[codec(index = 27)] - #[doc = "Sets the maximum size of an upward message that can be sent by a candidate."] - set_max_upward_message_size { new: ::core::primitive::u32 }, - #[codec(index = 28)] - #[doc = "Sets the maximum number of messages that a candidate can contain."] - set_max_upward_message_num_per_candidate { new: ::core::primitive::u32 }, - #[codec(index = 29)] - #[doc = "Sets the number of sessions after which an HRMP open channel request expires."] - set_hrmp_open_request_ttl { new: ::core::primitive::u32 }, - #[codec(index = 30)] - #[doc = "Sets the amount of funds that the sender should provide for opening an HRMP channel."] - set_hrmp_sender_deposit { new: ::core::primitive::u128 }, - #[codec(index = 31)] - #[doc = "Sets the amount of funds that the recipient should provide for accepting opening an HRMP"] - #[doc = "channel."] - set_hrmp_recipient_deposit { new: ::core::primitive::u128 }, - #[codec(index = 32)] - #[doc = "Sets the maximum number of messages allowed in an HRMP channel at once."] - set_hrmp_channel_max_capacity { new: ::core::primitive::u32 }, - #[codec(index = 33)] - #[doc = "Sets the maximum total size of messages in bytes allowed in an HRMP channel at once."] - set_hrmp_channel_max_total_size { new: ::core::primitive::u32 }, - #[codec(index = 34)] - #[doc = "Sets the maximum number of inbound HRMP channels a parachain is allowed to accept."] - set_hrmp_max_parachain_inbound_channels { new: ::core::primitive::u32 }, - #[codec(index = 35)] - #[doc = "Sets the maximum number of inbound HRMP channels a parathread is allowed to accept."] - set_hrmp_max_parathread_inbound_channels { new: ::core::primitive::u32 }, - #[codec(index = 36)] - #[doc = "Sets the maximum size of a message that could ever be put into an HRMP channel."] - set_hrmp_channel_max_message_size { new: ::core::primitive::u32 }, - #[codec(index = 37)] - #[doc = "Sets the maximum number of outbound HRMP channels a parachain is allowed to open."] - set_hrmp_max_parachain_outbound_channels { new: ::core::primitive::u32 }, - #[codec(index = 38)] - #[doc = "Sets the maximum number of outbound HRMP channels a parathread is allowed to open."] - set_hrmp_max_parathread_outbound_channels { new: ::core::primitive::u32 }, - #[codec(index = 39)] - #[doc = "Sets the maximum number of outbound HRMP messages can be sent by a candidate."] - set_hrmp_max_message_num_per_candidate { new: ::core::primitive::u32 }, - #[codec(index = 40)] - #[doc = "Sets the maximum amount of weight any individual upward message may consume."] - set_ump_max_individual_weight { new: ::core::primitive::u64 }, - #[codec(index = 41)] - #[doc = "Enable or disable PVF pre-checking. Consult the field documentation prior executing."] - set_pvf_checking_enabled { new: ::core::primitive::bool }, - #[codec(index = 42)] - #[doc = "Set the number of session changes after which a PVF pre-checking voting is rejected."] - set_pvf_voting_ttl { new: ::core::primitive::u32 }, - #[codec(index = 43)] - #[doc = "Sets the minimum delay between announcing the upgrade block for a parachain until the"] - #[doc = "upgrade taking place."] - #[doc = ""] - #[doc = "See the field documentation for information and constraints for the new value."] - set_minimum_validation_upgrade_delay { new: ::core::primitive::u32 }, - #[codec(index = 44)] - #[doc = "Setting this to true will disable consistency checks for the configuration setters."] - #[doc = "Use with caution."] - set_bypass_consistency_check { new: ::core::primitive::bool }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The new value for a configuration parameter is invalid."] - InvalidNewValue, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HostConfiguration<_0> { - pub max_code_size: _0, - pub max_head_data_size: _0, - pub max_upward_queue_count: _0, - pub max_upward_queue_size: _0, - pub max_upward_message_size: _0, - pub max_upward_message_num_per_candidate: _0, - pub hrmp_max_message_num_per_candidate: _0, - pub validation_upgrade_cooldown: _0, - pub validation_upgrade_delay: _0, - pub max_pov_size: _0, - pub max_downward_message_size: _0, - pub ump_service_total_weight: ::core::primitive::u64, - pub hrmp_max_parachain_outbound_channels: _0, - pub hrmp_max_parathread_outbound_channels: _0, - pub hrmp_sender_deposit: ::core::primitive::u128, - pub hrmp_recipient_deposit: ::core::primitive::u128, - pub hrmp_channel_max_capacity: _0, - pub hrmp_channel_max_total_size: _0, - pub hrmp_max_parachain_inbound_channels: _0, - pub hrmp_max_parathread_inbound_channels: _0, - pub hrmp_channel_max_message_size: _0, - pub code_retention_period: _0, - pub parathread_cores: _0, - pub parathread_retries: _0, - pub group_rotation_frequency: _0, - pub chain_availability_period: _0, - pub thread_availability_period: _0, - pub scheduling_lookahead: _0, - pub max_validators_per_core: ::core::option::Option<_0>, - pub max_validators: ::core::option::Option<_0>, - pub dispute_period: _0, - pub dispute_post_conclusion_acceptance_period: _0, - pub dispute_max_spam_slots: _0, - pub dispute_conclusion_by_time_out_period: _0, - pub no_show_slots: _0, - pub n_delay_tranches: _0, - pub zeroth_delay_tranche_width: _0, - pub needed_approvals: _0, - pub relay_vrf_modulo_samples: _0, - pub ump_max_individual_weight: ::core::primitive::u64, - pub pvf_checking_enabled: ::core::primitive::bool, - pub pvf_voting_ttl: _0, - pub minimum_validation_upgrade_delay: _0, - } - } - pub mod disputes { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - force_unfreeze, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Duplicate dispute statement sets provided."] - DuplicateDisputeStatementSets, - #[codec(index = 1)] - #[doc = "Ancient dispute statement provided."] - AncientDisputeStatement, - #[codec(index = 2)] - #[doc = "Validator index on statement is out of bounds for session."] - ValidatorIndexOutOfBounds, - #[codec(index = 3)] - #[doc = "Invalid signature on statement."] - InvalidSignature, - #[codec(index = 4)] - #[doc = "Validator vote submitted more than once to dispute."] - DuplicateStatement, - #[codec(index = 5)] - #[doc = "Too many spam slots used by some specific validator."] - PotentialSpam, - #[codec(index = 6)] - #[doc = "A dispute where there are only votes on one side."] - SingleSidedDispute, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A dispute has been initiated. \\[candidate hash, dispute location\\]"] - DisputeInitiated( - runtime_types::polkadot_core_primitives::CandidateHash, - runtime_types::polkadot_runtime_parachains::disputes::DisputeLocation, - ), - #[codec(index = 1)] - #[doc = "A dispute has concluded for or against a candidate."] - #[doc = "`\\[para id, candidate hash, dispute result\\]`"] - DisputeConcluded( - runtime_types::polkadot_core_primitives::CandidateHash, - runtime_types::polkadot_runtime_parachains::disputes::DisputeResult, - ), - #[codec(index = 2)] - #[doc = "A dispute has timed out due to insufficient participation."] - #[doc = "`\\[para id, candidate hash\\]`"] - DisputeTimedOut(runtime_types::polkadot_core_primitives::CandidateHash), - #[codec(index = 3)] - #[doc = "A dispute has concluded with supermajority against a candidate."] - #[doc = "Block authors should no longer build on top of this head and should"] - #[doc = "instead revert the block at the given height. This should be the"] - #[doc = "number of the child of the last known valid block in the chain."] - Revert(::core::primitive::u32), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum DisputeLocation { - #[codec(index = 0)] - Local, - #[codec(index = 1)] - Remote, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum DisputeResult { - #[codec(index = 0)] - Valid, - #[codec(index = 1)] - Invalid, - } - } - pub mod dmp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call {} - } - } - pub mod hrmp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] - #[doc = "parameters."] - #[doc = ""] - #[doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] - #[doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] - #[doc = ""] - #[doc = "These numbers are a subject to the relay-chain configuration limits."] - #[doc = ""] - #[doc = "The channel can be opened only after the recipient confirms it and only on a session"] - #[doc = "change."] - hrmp_init_open_channel { - recipient: runtime_types::polkadot_parachain::primitives::Id, - proposed_max_capacity: ::core::primitive::u32, - proposed_max_message_size: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "Accept a pending open channel request from the given sender."] - #[doc = ""] - #[doc = "The channel will be opened only on the next session boundary."] - hrmp_accept_open_channel { - sender: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 2)] - #[doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] - #[doc = "recipient in the channel being closed."] - #[doc = ""] - #[doc = "The closure can only happen on a session change."] - hrmp_close_channel { - channel_id: - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - }, - #[codec(index = 3)] - #[doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] - #[doc = "a para may have. Normally this happens once per session, but this allows"] - #[doc = "you to trigger the cleanup immediately for a specific parachain."] - #[doc = ""] - #[doc = "Origin must be Root."] - #[doc = ""] - #[doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] - force_clean_hrmp { - para: runtime_types::polkadot_parachain::primitives::Id, - inbound: ::core::primitive::u32, - outbound: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "Force process HRMP open channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP open channel requests, you can use this"] - #[doc = "function process all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of opening channels must be provided as witness data of weighing."] - force_process_hrmp_open { channels: ::core::primitive::u32 }, - #[codec(index = 5)] - #[doc = "Force process HRMP close channel requests."] - #[doc = ""] - #[doc = "If there are pending HRMP close channel requests, you can use this"] - #[doc = "function process all of those requests immediately."] - #[doc = ""] - #[doc = "Total number of closing channels must be provided as witness data of weighing."] - force_process_hrmp_close { channels: ::core::primitive::u32 }, - #[codec(index = 6)] - #[doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] - #[doc = "or the recipient for that request. The origin must be either of those."] - #[doc = ""] - #[doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] - #[doc = "already accepted."] - #[doc = ""] - #[doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] - #[doc = "witness data."] - hrmp_cancel_open_request { - channel_id: - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - open_requests: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The sender tried to open a channel to themselves."] - OpenHrmpChannelToSelf, - #[codec(index = 1)] - #[doc = "The recipient is not a valid para."] - OpenHrmpChannelInvalidRecipient, - #[codec(index = 2)] - #[doc = "The requested capacity is zero."] - OpenHrmpChannelZeroCapacity, - #[codec(index = 3)] - #[doc = "The requested capacity exceeds the global limit."] - OpenHrmpChannelCapacityExceedsLimit, - #[codec(index = 4)] - #[doc = "The requested maximum message size is 0."] - OpenHrmpChannelZeroMessageSize, - #[codec(index = 5)] - #[doc = "The open request requested the message size that exceeds the global limit."] - OpenHrmpChannelMessageSizeExceedsLimit, - #[codec(index = 6)] - #[doc = "The channel already exists"] - OpenHrmpChannelAlreadyExists, - #[codec(index = 7)] - #[doc = "There is already a request to open the same channel."] - OpenHrmpChannelAlreadyRequested, - #[codec(index = 8)] - #[doc = "The sender already has the maximum number of allowed outbound channels."] - OpenHrmpChannelLimitExceeded, - #[codec(index = 9)] - #[doc = "The channel from the sender to the origin doesn't exist."] - AcceptHrmpChannelDoesntExist, - #[codec(index = 10)] - #[doc = "The channel is already confirmed."] - AcceptHrmpChannelAlreadyConfirmed, - #[codec(index = 11)] - #[doc = "The recipient already has the maximum number of allowed inbound channels."] - AcceptHrmpChannelLimitExceeded, - #[codec(index = 12)] - #[doc = "The origin tries to close a channel where it is neither the sender nor the recipient."] - CloseHrmpChannelUnauthorized, - #[codec(index = 13)] - #[doc = "The channel to be closed doesn't exist."] - CloseHrmpChannelDoesntExist, - #[codec(index = 14)] - #[doc = "The channel close request is already requested."] - CloseHrmpChannelAlreadyUnderway, - #[codec(index = 15)] - #[doc = "Canceling is requested by neither the sender nor recipient of the open channel request."] - CancelHrmpOpenChannelUnauthorized, - #[codec(index = 16)] - #[doc = "The open request doesn't exist."] - OpenHrmpChannelDoesntExist, - #[codec(index = 17)] - #[doc = "Cannot cancel an HRMP open channel request because it is already confirmed."] - OpenHrmpChannelAlreadyConfirmed, - #[codec(index = 18)] - #[doc = "The provided witness data is wrong."] - WrongWitness, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Open HRMP channel requested."] - #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] - OpenChannelRequested( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - ::core::primitive::u32, - ), - #[codec(index = 1)] - #[doc = "An HRMP channel request sent by the receiver was canceled by either party."] - #[doc = "`[by_parachain, channel_id]`"] - OpenChannelCanceled( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ), - #[codec(index = 2)] - #[doc = "Open HRMP channel accepted. `[sender, recipient]`"] - OpenChannelAccepted( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::Id, - ), - #[codec(index = 3)] - #[doc = "HRMP channel closed. `[by_parachain, channel_id]`"] - ChannelClosed( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HrmpChannel { - pub max_capacity: ::core::primitive::u32, - pub max_total_size: ::core::primitive::u32, - pub max_message_size: ::core::primitive::u32, - pub msg_count: ::core::primitive::u32, - pub total_size: ::core::primitive::u32, - pub mqc_head: ::core::option::Option<::subxt::sp_core::H256>, - pub sender_deposit: ::core::primitive::u128, - pub recipient_deposit: ::core::primitive::u128, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct HrmpOpenChannelRequest { - pub confirmed: ::core::primitive::bool, - pub _age: ::core::primitive::u32, - pub sender_deposit: ::core::primitive::u128, - pub max_message_size: ::core::primitive::u32, - pub max_capacity: ::core::primitive::u32, - pub max_total_size: ::core::primitive::u32, - } - } - pub mod inclusion { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call {} - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Validator indices are out of order or contains duplicates."] - UnsortedOrDuplicateValidatorIndices, - #[codec(index = 1)] - #[doc = "Dispute statement sets are out of order or contain duplicates."] - UnsortedOrDuplicateDisputeStatementSet, - #[codec(index = 2)] - #[doc = "Backed candidates are out of order (core index) or contain duplicates."] - UnsortedOrDuplicateBackedCandidates, - #[codec(index = 3)] - #[doc = "A different relay parent was provided compared to the on-chain stored one."] - UnexpectedRelayParent, - #[codec(index = 4)] - #[doc = "Availability bitfield has unexpected size."] - WrongBitfieldSize, - #[codec(index = 5)] - #[doc = "Bitfield consists of zeros only."] - BitfieldAllZeros, - #[codec(index = 6)] - #[doc = "Multiple bitfields submitted by same validator or validators out of order by index."] - BitfieldDuplicateOrUnordered, - #[codec(index = 7)] - #[doc = "Validator index out of bounds."] - ValidatorIndexOutOfBounds, - #[codec(index = 8)] - #[doc = "Invalid signature"] - InvalidBitfieldSignature, - #[codec(index = 9)] - #[doc = "Candidate submitted but para not scheduled."] - UnscheduledCandidate, - #[codec(index = 10)] - #[doc = "Candidate scheduled despite pending candidate already existing for the para."] - CandidateScheduledBeforeParaFree, - #[codec(index = 11)] - #[doc = "Candidate included with the wrong collator."] - WrongCollator, - #[codec(index = 12)] - #[doc = "Scheduled cores out of order."] - ScheduledOutOfOrder, - #[codec(index = 13)] - #[doc = "Head data exceeds the configured maximum."] - HeadDataTooLarge, - #[codec(index = 14)] - #[doc = "Code upgrade prematurely."] - PrematureCodeUpgrade, - #[codec(index = 15)] - #[doc = "Output code is too large"] - NewCodeTooLarge, - #[codec(index = 16)] - #[doc = "Candidate not in parent context."] - CandidateNotInParentContext, - #[codec(index = 17)] - #[doc = "Invalid group index in core assignment."] - InvalidGroupIndex, - #[codec(index = 18)] - #[doc = "Insufficient (non-majority) backing."] - InsufficientBacking, - #[codec(index = 19)] - #[doc = "Invalid (bad signature, unknown validator, etc.) backing."] - InvalidBacking, - #[codec(index = 20)] - #[doc = "Collator did not sign PoV."] - NotCollatorSigned, - #[codec(index = 21)] - #[doc = "The validation data hash does not match expected."] - ValidationDataHashMismatch, - #[codec(index = 22)] - #[doc = "The downward message queue is not processed correctly."] - IncorrectDownwardMessageHandling, - #[codec(index = 23)] - #[doc = "At least one upward message sent does not pass the acceptance criteria."] - InvalidUpwardMessages, - #[codec(index = 24)] - #[doc = "The candidate didn't follow the rules of HRMP watermark advancement."] - HrmpWatermarkMishandling, - #[codec(index = 25)] - #[doc = "The HRMP messages sent by the candidate is not valid."] - InvalidOutboundHrmp, - #[codec(index = 26)] - #[doc = "The validation code hash of the candidate is not valid."] - InvalidValidationCodeHash, - #[codec(index = 27)] - #[doc = "The `para_head` hash in the candidate descriptor doesn't match the hash of the actual para head in the"] - #[doc = "commitments."] - ParaHeadMismatch, - #[codec(index = 28)] - #[doc = "A bitfield that references a freed core,"] - #[doc = "either intentionally or as part of a concluded"] - #[doc = "invalid dispute."] - BitfieldReferencesFreedCore, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "A candidate was backed. `[candidate, head_data]`"] - CandidateBacked( - runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v2::CoreIndex, - runtime_types::polkadot_primitives::v2::GroupIndex, - ), - #[codec(index = 1)] - #[doc = "A candidate was included. `[candidate, head_data]`"] - CandidateIncluded( - runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v2::CoreIndex, - runtime_types::polkadot_primitives::v2::GroupIndex, - ), - #[codec(index = 2)] - #[doc = "A candidate timed out. `[candidate, head_data]`"] - CandidateTimedOut( - runtime_types::polkadot_primitives::v2::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v2::CoreIndex, - ), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AvailabilityBitfieldRecord<_0> { - pub bitfield: runtime_types::polkadot_primitives::v2::AvailabilityBitfield, - pub submitted_at: _0, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CandidatePendingAvailability<_0, _1> { - pub core: runtime_types::polkadot_primitives::v2::CoreIndex, - pub hash: runtime_types::polkadot_core_primitives::CandidateHash, - pub descriptor: runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, - pub availability_votes: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub backers: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub relay_parent_number: _1, - pub backed_in_number: _1, - pub backing_group: runtime_types::polkadot_primitives::v2::GroupIndex, - } - } - pub mod initializer { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Issue a signal to the consensus engine to forcibly act as though all parachain"] - #[doc = "blocks in all relay chain blocks up to and including the given number in the current"] - #[doc = "chain are valid and should be finalized."] - force_approve { up_to: ::core::primitive::u32 }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BufferedSessionChange { - pub validators: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - pub queued: ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::validator_app::Public, - >, - pub session_index: ::core::primitive::u32, - } - } - pub mod origin { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Origin { - #[codec(index = 0)] - Parachain(runtime_types::polkadot_parachain::primitives::Id), - } - } - } - pub mod paras { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Set the storage for the parachain validation code immediately."] - force_set_current_code { - para: runtime_types::polkadot_parachain::primitives::Id, - new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - }, - #[codec(index = 1)] - #[doc = "Set the storage for the current parachain head data immediately."] - force_set_current_head { - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - }, - #[codec(index = 2)] - #[doc = "Schedule an upgrade as if it was scheduled in the given relay parent block."] - force_schedule_code_upgrade { - para: runtime_types::polkadot_parachain::primitives::Id, - new_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - relay_parent_number: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Note a new block head for para within the context of the current block."] - force_note_new_head { - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - }, - #[codec(index = 4)] - #[doc = "Put a parachain directly into the next session's action queue."] - #[doc = "We can't queue it any sooner than this without going into the"] - #[doc = "initializer..."] - force_queue_action { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - #[codec(index = 5)] - #[doc = "Adds the validation code to the storage."] - #[doc = ""] - #[doc = "The code will not be added if it is already present. Additionally, if PVF pre-checking"] - #[doc = "is running for that code, it will be instantly accepted."] - #[doc = ""] - #[doc = "Otherwise, the code will be added into the storage. Note that the code will be added"] - #[doc = "into storage with reference count 0. This is to account the fact that there are no users"] - #[doc = "for this code yet. The caller will have to make sure that this code eventually gets"] - #[doc = "used by some parachain or removed from the storage to avoid storage leaks. For the latter"] - #[doc = "prefer to use the `poke_unused_validation_code` dispatchable to raw storage manipulation."] - #[doc = ""] - #[doc = "This function is mainly meant to be used for upgrading parachains that do not follow"] - #[doc = "the go-ahead signal while the PVF pre-checking feature is enabled."] - add_trusted_validation_code { - validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - }, - #[codec(index = 6)] - #[doc = "Remove the validation code from the storage iff the reference count is 0."] - #[doc = ""] - #[doc = "This is better than removing the storage directly, because it will not remove the code"] - #[doc = "that was suddenly got used by some parachain while this dispatchable was pending"] - #[doc = "dispatching."] - poke_unused_validation_code { - validation_code_hash: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - }, - #[codec(index = 7)] - #[doc = "Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and"] - #[doc = "enacts the results if that was the last vote before achieving the supermajority."] - include_pvf_check_statement { - stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, - signature: - runtime_types::polkadot_primitives::v2::validator_app::Signature, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Para is not registered in our system."] - NotRegistered, - #[codec(index = 1)] - #[doc = "Para cannot be onboarded because it is already tracked by our system."] - CannotOnboard, - #[codec(index = 2)] - #[doc = "Para cannot be offboarded at this time."] - CannotOffboard, - #[codec(index = 3)] - #[doc = "Para cannot be upgraded to a parachain."] - CannotUpgrade, - #[codec(index = 4)] - #[doc = "Para cannot be downgraded to a parathread."] - CannotDowngrade, - #[codec(index = 5)] - #[doc = "The statement for PVF pre-checking is stale."] - PvfCheckStatementStale, - #[codec(index = 6)] - #[doc = "The statement for PVF pre-checking is for a future session."] - PvfCheckStatementFuture, - #[codec(index = 7)] - #[doc = "Claimed validator index is out of bounds."] - PvfCheckValidatorIndexOutOfBounds, - #[codec(index = 8)] - #[doc = "The signature for the PVF pre-checking is invalid."] - PvfCheckInvalidSignature, - #[codec(index = 9)] - #[doc = "The given validator already has cast a vote."] - PvfCheckDoubleVote, - #[codec(index = 10)] - #[doc = "The given PVF does not exist at the moment of process a vote."] - PvfCheckSubjectInvalid, - #[codec(index = 11)] - #[doc = "The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism"] - #[doc = "is disabled."] - PvfCheckDisabled, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Current code has been updated for a Para. `para_id`"] - CurrentCodeUpdated(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 1)] - #[doc = "Current head has been updated for a Para. `para_id`"] - CurrentHeadUpdated(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 2)] - #[doc = "A code upgrade has been scheduled for a Para. `para_id`"] - CodeUpgradeScheduled(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 3)] - #[doc = "A new head has been noted for a Para. `para_id`"] - NewHeadNoted(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 4)] - #[doc = "A para has been queued to execute pending actions. `para_id`"] - ActionQueued( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - ), - #[codec(index = 5)] - #[doc = "The given para either initiated or subscribed to a PVF check for the given validation"] - #[doc = "code. `code_hash` `para_id`"] - PvfCheckStarted( - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - runtime_types::polkadot_parachain::primitives::Id, - ), - #[codec(index = 6)] - #[doc = "The given validation code was accepted by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - PvfCheckAccepted( - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - runtime_types::polkadot_parachain::primitives::Id, - ), - #[codec(index = 7)] - #[doc = "The given validation code was rejected by the PVF pre-checking vote."] - #[doc = "`code_hash` `para_id`"] - PvfCheckRejected( - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - runtime_types::polkadot_parachain::primitives::Id, - ), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ParaGenesisArgs { - pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - pub validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - pub parachain: ::core::primitive::bool, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum ParaLifecycle { - #[codec(index = 0)] - Onboarding, - #[codec(index = 1)] - Parathread, - #[codec(index = 2)] - Parachain, - #[codec(index = 3)] - UpgradingParathread, - #[codec(index = 4)] - DowngradingParachain, - #[codec(index = 5)] - OffboardingParathread, - #[codec(index = 6)] - OffboardingParachain, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ParaPastCodeMeta<_0> { - pub upgrade_times: ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::paras::ReplacementTimes<_0>, - >, - pub last_pruned: ::core::option::Option<_0>, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PvfCheckActiveVoteState<_0> { - pub votes_accept: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub votes_reject: ::subxt::bitvec::vec::BitVec< - ::core::primitive::u8, - ::subxt::bitvec::order::Lsb0, - >, - pub age: _0, - pub created_at: _0, - pub causes: ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::paras::PvfCheckCause<_0>, - >, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum PvfCheckCause<_0> { - #[codec(index = 0)] - Onboarding(runtime_types::polkadot_parachain::primitives::Id), - #[codec(index = 1)] - Upgrade { - id: runtime_types::polkadot_parachain::primitives::Id, - relay_parent_number: _0, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ReplacementTimes<_0> { - pub expected_at: _0, - pub activated_at: _0, - } - } - pub mod paras_inherent { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Enter the paras inherent. This will process bitfields and backed candidates."] - enter { - data: runtime_types::polkadot_primitives::v2::InherentData< - runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "Inclusion inherent called more than once per block."] - TooManyInclusionInherents, - #[codec(index = 1)] - #[doc = "The hash of the submitted parent header doesn't correspond to the saved block hash of"] - #[doc = "the parent."] - InvalidParentHeader, - #[codec(index = 2)] - #[doc = "Disputed candidate that was concluded invalid."] - CandidateConcludedInvalid, - #[codec(index = 3)] - #[doc = "The data given to the inherent will result in an overweight block."] - InherentOverweight, - #[codec(index = 4)] - #[doc = "The ordering of dispute statements was invalid."] - DisputeStatementsUnsortedOrDuplicates, - #[codec(index = 5)] - #[doc = "A dispute statement was invalid."] - DisputeInvalid, - } - } - } - pub mod scheduler { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum AssignmentKind { - #[codec(index = 0)] - Parachain, - #[codec(index = 1)] - Parathread( - runtime_types::polkadot_primitives::v2::collator_app::Public, - ::core::primitive::u32, - ), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct CoreAssignment { - pub core: runtime_types::polkadot_primitives::v2::CoreIndex, - pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub kind: runtime_types::polkadot_runtime_parachains::scheduler::AssignmentKind, - pub group_idx: runtime_types::polkadot_primitives::v2::GroupIndex, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ParathreadClaimQueue { - pub queue: ::std::vec::Vec< - runtime_types::polkadot_runtime_parachains::scheduler::QueuedParathread, - >, - pub next_core_offset: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct QueuedParathread { - pub claim: runtime_types::polkadot_primitives::v2::ParathreadEntry, - pub core_offset: ::core::primitive::u32, - } - } - pub mod shared { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call {} - } - } - pub mod ump { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Service a single overweight upward message."] - #[doc = ""] - #[doc = "- `origin`: Must pass `ExecuteOverweightOrigin`."] - #[doc = "- `index`: The index of the overweight message to service."] - #[doc = "- `weight_limit`: The amount of weight that message execution may take."] - #[doc = ""] - #[doc = "Errors:"] - #[doc = "- `UnknownMessageIndex`: Message of `index` is unknown."] - #[doc = "- `WeightOverLimit`: Message execution may use greater than `weight_limit`."] - #[doc = ""] - #[doc = "Events:"] - #[doc = "- `OverweightServiced`: On success."] - service_overweight { - index: ::core::primitive::u64, - weight_limit: ::core::primitive::u64, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - #[doc = "The message index given is unknown."] - UnknownMessageIndex, - #[codec(index = 1)] - #[doc = "The amount of weight given is possibly not enough for executing the message."] - WeightOverLimit, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "Upward message is invalid XCM."] - #[doc = "\\[ id \\]"] - InvalidFormat([::core::primitive::u8; 32usize]), - #[codec(index = 1)] - #[doc = "Upward message is unsupported version of XCM."] - #[doc = "\\[ id \\]"] - UnsupportedVersion([::core::primitive::u8; 32usize]), - #[codec(index = 2)] - #[doc = "Upward message executed with the given outcome."] - #[doc = "\\[ id, outcome \\]"] - ExecutedUpward( - [::core::primitive::u8; 32usize], - runtime_types::xcm::v2::traits::Outcome, - ), - #[codec(index = 3)] - #[doc = "The weight limit for handling upward messages was reached."] - #[doc = "\\[ id, remaining, required \\]"] - WeightExhausted( - [::core::primitive::u8; 32usize], - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 4)] - #[doc = "Some upward messages have been received and will be processed."] - #[doc = "\\[ para, count, size \\]"] - UpwardMessagesReceived( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, - ::core::primitive::u32, - ), - #[codec(index = 5)] - #[doc = "The weight budget was exceeded for an individual upward message."] - #[doc = ""] - #[doc = "This message can be later dispatched manually using `service_overweight` dispatchable"] - #[doc = "using the assigned `overweight_index`."] - #[doc = ""] - #[doc = "\\[ para, id, overweight_index, required \\]"] - OverweightEnqueued( - runtime_types::polkadot_parachain::primitives::Id, - [::core::primitive::u8; 32usize], - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 6)] - #[doc = "Upward message from the overweight queue was executed with the given actual weight"] - #[doc = "used."] - #[doc = ""] - #[doc = "\\[ overweight_index, used \\]"] - OverweightServiced(::core::primitive::u64, ::core::primitive::u64), - } - } - } - } - pub mod primitive_types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct H256(pub [::core::primitive::u8; 32usize]); - } - pub mod rococo_runtime { - use super::runtime_types; - pub mod validator_manager { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - #[doc = "Add new validators to the set."] - #[doc = ""] - #[doc = "The new validators will be active from current session + 2."] - register_validators { - validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - #[codec(index = 1)] - #[doc = "Remove validators from the set."] - #[doc = ""] - #[doc = "The removed validators will be deactivated from current session + 2."] - deregister_validators { - validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - #[doc = "New validators were added to the set."] - ValidatorsRegistered( - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ), - #[codec(index = 1)] - #[doc = "Validators were removed from the set."] - ValidatorsDeregistered( - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ), - } - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Call { - #[codec(index = 0)] - System(runtime_types::frame_system::pallet::Call), - #[codec(index = 1)] - Babe(runtime_types::pallet_babe::pallet::Call), - #[codec(index = 2)] - Timestamp(runtime_types::pallet_timestamp::pallet::Call), - #[codec(index = 3)] - Indices(runtime_types::pallet_indices::pallet::Call), - #[codec(index = 4)] - Balances(runtime_types::pallet_balances::pallet::Call), - #[codec(index = 6)] - Authorship(runtime_types::pallet_authorship::pallet::Call), - #[codec(index = 9)] - Session(runtime_types::pallet_session::pallet::Call), - #[codec(index = 10)] - Grandpa(runtime_types::pallet_grandpa::pallet::Call), - #[codec(index = 11)] - ImOnline(runtime_types::pallet_im_online::pallet::Call), - #[codec(index = 14)] - Configuration( - runtime_types::polkadot_runtime_parachains::configuration::pallet::Call, - ), - #[codec(index = 15)] - ParasShared(runtime_types::polkadot_runtime_parachains::shared::pallet::Call), - #[codec(index = 16)] - ParaInclusion(runtime_types::polkadot_runtime_parachains::inclusion::pallet::Call), - #[codec(index = 17)] - ParaInherent( - runtime_types::polkadot_runtime_parachains::paras_inherent::pallet::Call, - ), - #[codec(index = 19)] - Paras(runtime_types::polkadot_runtime_parachains::paras::pallet::Call), - #[codec(index = 20)] - Initializer(runtime_types::polkadot_runtime_parachains::initializer::pallet::Call), - #[codec(index = 21)] - Dmp(runtime_types::polkadot_runtime_parachains::dmp::pallet::Call), - #[codec(index = 22)] - Ump(runtime_types::polkadot_runtime_parachains::ump::pallet::Call), - #[codec(index = 23)] - Hrmp(runtime_types::polkadot_runtime_parachains::hrmp::pallet::Call), - #[codec(index = 25)] - ParasDisputes(runtime_types::polkadot_runtime_parachains::disputes::pallet::Call), - #[codec(index = 26)] - Registrar(runtime_types::polkadot_runtime_common::paras_registrar::pallet::Call), - #[codec(index = 27)] - Auctions(runtime_types::polkadot_runtime_common::auctions::pallet::Call), - #[codec(index = 28)] - Crowdloan(runtime_types::polkadot_runtime_common::crowdloan::pallet::Call), - #[codec(index = 29)] - Slots(runtime_types::polkadot_runtime_common::slots::pallet::Call), - #[codec(index = 30)] - ParasSudoWrapper( - runtime_types::polkadot_runtime_common::paras_sudo_wrapper::pallet::Call, - ), - #[codec(index = 31)] - AssignedSlots(runtime_types::polkadot_runtime_common::assigned_slots::pallet::Call), - #[codec(index = 32)] - Sudo(runtime_types::pallet_sudo::pallet::Call), - #[codec(index = 34)] - Beefy(runtime_types::pallet_beefy::pallet::Call), - #[codec(index = 36)] - ValidatorManager(runtime_types::rococo_runtime::validator_manager::pallet::Call), - #[codec(index = 40)] - BridgeRococoGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Call), - #[codec(index = 41)] - BridgeWococoGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Call), - #[codec(index = 43)] - BridgeRococoMessages(runtime_types::pallet_bridge_messages::pallet::Call), - #[codec(index = 44)] - BridgeWococoMessages(runtime_types::pallet_bridge_messages::pallet::Call), - #[codec(index = 80)] - Collective(runtime_types::pallet_collective::pallet::Call), - #[codec(index = 81)] - Membership(runtime_types::pallet_membership::pallet::Call), - #[codec(index = 90)] - Utility(runtime_types::pallet_utility::pallet::Call), - #[codec(index = 91)] - Proxy(runtime_types::pallet_proxy::pallet::Call), - #[codec(index = 92)] - Multisig(runtime_types::pallet_multisig::pallet::Call), - #[codec(index = 99)] - XcmPallet(runtime_types::pallet_xcm::pallet::Call), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Event { - #[codec(index = 0)] - System(runtime_types::frame_system::pallet::Event), - #[codec(index = 3)] - Indices(runtime_types::pallet_indices::pallet::Event), - #[codec(index = 4)] - Balances(runtime_types::pallet_balances::pallet::Event), - #[codec(index = 7)] - Offences(runtime_types::pallet_offences::pallet::Event), - #[codec(index = 9)] - Session(runtime_types::pallet_session::pallet::Event), - #[codec(index = 10)] - Grandpa(runtime_types::pallet_grandpa::pallet::Event), - #[codec(index = 11)] - ImOnline(runtime_types::pallet_im_online::pallet::Event), - #[codec(index = 16)] - ParaInclusion(runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event), - #[codec(index = 19)] - Paras(runtime_types::polkadot_runtime_parachains::paras::pallet::Event), - #[codec(index = 22)] - Ump(runtime_types::polkadot_runtime_parachains::ump::pallet::Event), - #[codec(index = 23)] - Hrmp(runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event), - #[codec(index = 25)] - ParasDisputes(runtime_types::polkadot_runtime_parachains::disputes::pallet::Event), - #[codec(index = 26)] - Registrar(runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event), - #[codec(index = 27)] - Auctions(runtime_types::polkadot_runtime_common::auctions::pallet::Event), - #[codec(index = 28)] - Crowdloan(runtime_types::polkadot_runtime_common::crowdloan::pallet::Event), - #[codec(index = 29)] - Slots(runtime_types::polkadot_runtime_common::slots::pallet::Event), - #[codec(index = 31)] - AssignedSlots( - runtime_types::polkadot_runtime_common::assigned_slots::pallet::Event, - ), - #[codec(index = 32)] - Sudo(runtime_types::pallet_sudo::pallet::Event), - #[codec(index = 36)] - ValidatorManager(runtime_types::rococo_runtime::validator_manager::pallet::Event), - #[codec(index = 43)] - BridgeRococoMessages(runtime_types::pallet_bridge_messages::pallet::Event), - #[codec(index = 44)] - BridgeWococoMessages(runtime_types::pallet_bridge_messages::pallet::Event), - #[codec(index = 45)] - BridgeRococoMessagesDispatch(runtime_types::pallet_bridge_dispatch::pallet::Event), - #[codec(index = 46)] - BridgeWococoMessagesDispatch(runtime_types::pallet_bridge_dispatch::pallet::Event), - #[codec(index = 80)] - Collective(runtime_types::pallet_collective::pallet::Event), - #[codec(index = 81)] - Membership(runtime_types::pallet_membership::pallet::Event), - #[codec(index = 90)] - Utility(runtime_types::pallet_utility::pallet::Event), - #[codec(index = 91)] - Proxy(runtime_types::pallet_proxy::pallet::Event), - #[codec(index = 92)] - Multisig(runtime_types::pallet_multisig::pallet::Event), - #[codec(index = 99)] - XcmPallet(runtime_types::pallet_xcm::pallet::Event), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum OriginCaller { - #[codec(index = 0)] - system( - runtime_types::frame_support::dispatch::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - #[codec(index = 13)] - ParachainsOrigin( - runtime_types::polkadot_runtime_parachains::origin::pallet::Origin, - ), - #[codec(index = 80)] - Collective( - runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - #[codec(index = 99)] - XcmPallet(runtime_types::pallet_xcm::pallet::Origin), - #[codec(index = 4)] - Void(runtime_types::sp_core::Void), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum ProxyType { - #[codec(index = 0)] - Any, - #[codec(index = 1)] - CancelProxy, - #[codec(index = 2)] - Auction, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Runtime; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SessionKeys { - pub grandpa: runtime_types::sp_finality_grandpa::app::Public, - pub babe: runtime_types::sp_consensus_babe::app::Public, - pub im_online: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - pub para_validator: runtime_types::polkadot_primitives::v2::validator_app::Public, - pub para_assignment: runtime_types::polkadot_primitives::v2::assignment_app::Public, - pub authority_discovery: runtime_types::sp_authority_discovery::app::Public, - pub beefy: runtime_types::beefy_primitives::crypto::Public, - } - } - pub mod sp_arithmetic { - use super::runtime_types; - pub mod fixed_point { - use super::runtime_types; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct FixedU128(pub ::core::primitive::u128); - } - pub mod per_things { - use super::runtime_types; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct Perbill(pub ::core::primitive::u32); - } - } - pub mod sp_authority_discovery { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - } - pub mod sp_consensus_babe { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - pub mod digests { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum NextConfigDescriptor { - #[codec(index = 1)] - V1 { - c: (::core::primitive::u64, ::core::primitive::u64), - allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum PreDigest { - #[codec(index = 1)] - Primary(runtime_types::sp_consensus_babe::digests::PrimaryPreDigest), - #[codec(index = 2)] - SecondaryPlain( - runtime_types::sp_consensus_babe::digests::SecondaryPlainPreDigest, - ), - #[codec(index = 3)] - SecondaryVRF(runtime_types::sp_consensus_babe::digests::SecondaryVRFPreDigest), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct PrimaryPreDigest { - pub authority_index: ::core::primitive::u32, - pub slot: runtime_types::sp_consensus_slots::Slot, - pub vrf_output: [::core::primitive::u8; 32usize], - pub vrf_proof: [::core::primitive::u8; 64usize], - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SecondaryPlainPreDigest { - pub authority_index: ::core::primitive::u32, - pub slot: runtime_types::sp_consensus_slots::Slot, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct SecondaryVRFPreDigest { - pub authority_index: ::core::primitive::u32, - pub slot: runtime_types::sp_consensus_slots::Slot, - pub vrf_output: [::core::primitive::u8; 32usize], - pub vrf_proof: [::core::primitive::u8; 64usize], - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum AllowedSlots { - #[codec(index = 0)] - PrimarySlots, - #[codec(index = 1)] - PrimaryAndSecondaryPlainSlots, - #[codec(index = 2)] - PrimaryAndSecondaryVRFSlots, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BabeEpochConfiguration { - pub c: (::core::primitive::u64, ::core::primitive::u64), - pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, - } - } - pub mod sp_consensus_slots { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct EquivocationProof<_0, _1> { - pub offender: _1, - pub slot: runtime_types::sp_consensus_slots::Slot, - pub first_header: _0, - pub second_header: _0, - } - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Decode, - :: subxt :: codec :: Encode, - Debug, - )] - pub struct Slot(pub ::core::primitive::u64); - } - pub mod sp_core { - use super::runtime_types; - pub mod crypto { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct AccountId32(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); - } - pub mod ecdsa { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub [::core::primitive::u8; 33usize]); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Signature(pub [::core::primitive::u8; 65usize]); - } - pub mod ed25519 { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Signature(pub [::core::primitive::u8; 64usize]); - } - pub mod offchain { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct OpaqueNetworkState { - pub peer_id: runtime_types::sp_core::OpaquePeerId, - pub external_addresses: - ::std::vec::Vec, - } - } - pub mod sr25519 { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Signature(pub [::core::primitive::u8; 64usize]); - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Void {} - } - pub mod sp_finality_grandpa { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Public(pub runtime_types::sp_core::ed25519::Public); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Equivocation<_0, _1> { - #[codec(index = 0)] - Prevote( - runtime_types::finality_grandpa::Equivocation< - runtime_types::sp_finality_grandpa::app::Public, - runtime_types::finality_grandpa::Prevote<_0, _1>, - runtime_types::sp_finality_grandpa::app::Signature, - >, - ), - #[codec(index = 1)] - Precommit( - runtime_types::finality_grandpa::Equivocation< - runtime_types::sp_finality_grandpa::app::Public, - runtime_types::finality_grandpa::Precommit<_0, _1>, - runtime_types::sp_finality_grandpa::app::Signature, - >, - ), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct EquivocationProof<_0, _1> { - pub set_id: ::core::primitive::u64, - pub equivocation: runtime_types::sp_finality_grandpa::Equivocation<_0, _1>, - } - } - pub mod sp_runtime { - use super::runtime_types; - pub mod generic { - use super::runtime_types; - pub mod digest { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Digest { - pub logs: - ::std::vec::Vec, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum DigestItem { - #[codec(index = 6)] - PreRuntime( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - #[codec(index = 4)] - Consensus( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - #[codec(index = 5)] - Seal( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - #[codec(index = 0)] - Other(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 8)] - RuntimeEnvironmentUpdated, - } - } - pub mod era { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Era { - #[codec(index = 0)] - Immortal, - #[codec(index = 1)] - Mortal1(::core::primitive::u8), - #[codec(index = 2)] - Mortal2(::core::primitive::u8), - #[codec(index = 3)] - Mortal3(::core::primitive::u8), - #[codec(index = 4)] - Mortal4(::core::primitive::u8), - #[codec(index = 5)] - Mortal5(::core::primitive::u8), - #[codec(index = 6)] - Mortal6(::core::primitive::u8), - #[codec(index = 7)] - Mortal7(::core::primitive::u8), - #[codec(index = 8)] - Mortal8(::core::primitive::u8), - #[codec(index = 9)] - Mortal9(::core::primitive::u8), - #[codec(index = 10)] - Mortal10(::core::primitive::u8), - #[codec(index = 11)] - Mortal11(::core::primitive::u8), - #[codec(index = 12)] - Mortal12(::core::primitive::u8), - #[codec(index = 13)] - Mortal13(::core::primitive::u8), - #[codec(index = 14)] - Mortal14(::core::primitive::u8), - #[codec(index = 15)] - Mortal15(::core::primitive::u8), - #[codec(index = 16)] - Mortal16(::core::primitive::u8), - #[codec(index = 17)] - Mortal17(::core::primitive::u8), - #[codec(index = 18)] - Mortal18(::core::primitive::u8), - #[codec(index = 19)] - Mortal19(::core::primitive::u8), - #[codec(index = 20)] - Mortal20(::core::primitive::u8), - #[codec(index = 21)] - Mortal21(::core::primitive::u8), - #[codec(index = 22)] - Mortal22(::core::primitive::u8), - #[codec(index = 23)] - Mortal23(::core::primitive::u8), - #[codec(index = 24)] - Mortal24(::core::primitive::u8), - #[codec(index = 25)] - Mortal25(::core::primitive::u8), - #[codec(index = 26)] - Mortal26(::core::primitive::u8), - #[codec(index = 27)] - Mortal27(::core::primitive::u8), - #[codec(index = 28)] - Mortal28(::core::primitive::u8), - #[codec(index = 29)] - Mortal29(::core::primitive::u8), - #[codec(index = 30)] - Mortal30(::core::primitive::u8), - #[codec(index = 31)] - Mortal31(::core::primitive::u8), - #[codec(index = 32)] - Mortal32(::core::primitive::u8), - #[codec(index = 33)] - Mortal33(::core::primitive::u8), - #[codec(index = 34)] - Mortal34(::core::primitive::u8), - #[codec(index = 35)] - Mortal35(::core::primitive::u8), - #[codec(index = 36)] - Mortal36(::core::primitive::u8), - #[codec(index = 37)] - Mortal37(::core::primitive::u8), - #[codec(index = 38)] - Mortal38(::core::primitive::u8), - #[codec(index = 39)] - Mortal39(::core::primitive::u8), - #[codec(index = 40)] - Mortal40(::core::primitive::u8), - #[codec(index = 41)] - Mortal41(::core::primitive::u8), - #[codec(index = 42)] - Mortal42(::core::primitive::u8), - #[codec(index = 43)] - Mortal43(::core::primitive::u8), - #[codec(index = 44)] - Mortal44(::core::primitive::u8), - #[codec(index = 45)] - Mortal45(::core::primitive::u8), - #[codec(index = 46)] - Mortal46(::core::primitive::u8), - #[codec(index = 47)] - Mortal47(::core::primitive::u8), - #[codec(index = 48)] - Mortal48(::core::primitive::u8), - #[codec(index = 49)] - Mortal49(::core::primitive::u8), - #[codec(index = 50)] - Mortal50(::core::primitive::u8), - #[codec(index = 51)] - Mortal51(::core::primitive::u8), - #[codec(index = 52)] - Mortal52(::core::primitive::u8), - #[codec(index = 53)] - Mortal53(::core::primitive::u8), - #[codec(index = 54)] - Mortal54(::core::primitive::u8), - #[codec(index = 55)] - Mortal55(::core::primitive::u8), - #[codec(index = 56)] - Mortal56(::core::primitive::u8), - #[codec(index = 57)] - Mortal57(::core::primitive::u8), - #[codec(index = 58)] - Mortal58(::core::primitive::u8), - #[codec(index = 59)] - Mortal59(::core::primitive::u8), - #[codec(index = 60)] - Mortal60(::core::primitive::u8), - #[codec(index = 61)] - Mortal61(::core::primitive::u8), - #[codec(index = 62)] - Mortal62(::core::primitive::u8), - #[codec(index = 63)] - Mortal63(::core::primitive::u8), - #[codec(index = 64)] - Mortal64(::core::primitive::u8), - #[codec(index = 65)] - Mortal65(::core::primitive::u8), - #[codec(index = 66)] - Mortal66(::core::primitive::u8), - #[codec(index = 67)] - Mortal67(::core::primitive::u8), - #[codec(index = 68)] - Mortal68(::core::primitive::u8), - #[codec(index = 69)] - Mortal69(::core::primitive::u8), - #[codec(index = 70)] - Mortal70(::core::primitive::u8), - #[codec(index = 71)] - Mortal71(::core::primitive::u8), - #[codec(index = 72)] - Mortal72(::core::primitive::u8), - #[codec(index = 73)] - Mortal73(::core::primitive::u8), - #[codec(index = 74)] - Mortal74(::core::primitive::u8), - #[codec(index = 75)] - Mortal75(::core::primitive::u8), - #[codec(index = 76)] - Mortal76(::core::primitive::u8), - #[codec(index = 77)] - Mortal77(::core::primitive::u8), - #[codec(index = 78)] - Mortal78(::core::primitive::u8), - #[codec(index = 79)] - Mortal79(::core::primitive::u8), - #[codec(index = 80)] - Mortal80(::core::primitive::u8), - #[codec(index = 81)] - Mortal81(::core::primitive::u8), - #[codec(index = 82)] - Mortal82(::core::primitive::u8), - #[codec(index = 83)] - Mortal83(::core::primitive::u8), - #[codec(index = 84)] - Mortal84(::core::primitive::u8), - #[codec(index = 85)] - Mortal85(::core::primitive::u8), - #[codec(index = 86)] - Mortal86(::core::primitive::u8), - #[codec(index = 87)] - Mortal87(::core::primitive::u8), - #[codec(index = 88)] - Mortal88(::core::primitive::u8), - #[codec(index = 89)] - Mortal89(::core::primitive::u8), - #[codec(index = 90)] - Mortal90(::core::primitive::u8), - #[codec(index = 91)] - Mortal91(::core::primitive::u8), - #[codec(index = 92)] - Mortal92(::core::primitive::u8), - #[codec(index = 93)] - Mortal93(::core::primitive::u8), - #[codec(index = 94)] - Mortal94(::core::primitive::u8), - #[codec(index = 95)] - Mortal95(::core::primitive::u8), - #[codec(index = 96)] - Mortal96(::core::primitive::u8), - #[codec(index = 97)] - Mortal97(::core::primitive::u8), - #[codec(index = 98)] - Mortal98(::core::primitive::u8), - #[codec(index = 99)] - Mortal99(::core::primitive::u8), - #[codec(index = 100)] - Mortal100(::core::primitive::u8), - #[codec(index = 101)] - Mortal101(::core::primitive::u8), - #[codec(index = 102)] - Mortal102(::core::primitive::u8), - #[codec(index = 103)] - Mortal103(::core::primitive::u8), - #[codec(index = 104)] - Mortal104(::core::primitive::u8), - #[codec(index = 105)] - Mortal105(::core::primitive::u8), - #[codec(index = 106)] - Mortal106(::core::primitive::u8), - #[codec(index = 107)] - Mortal107(::core::primitive::u8), - #[codec(index = 108)] - Mortal108(::core::primitive::u8), - #[codec(index = 109)] - Mortal109(::core::primitive::u8), - #[codec(index = 110)] - Mortal110(::core::primitive::u8), - #[codec(index = 111)] - Mortal111(::core::primitive::u8), - #[codec(index = 112)] - Mortal112(::core::primitive::u8), - #[codec(index = 113)] - Mortal113(::core::primitive::u8), - #[codec(index = 114)] - Mortal114(::core::primitive::u8), - #[codec(index = 115)] - Mortal115(::core::primitive::u8), - #[codec(index = 116)] - Mortal116(::core::primitive::u8), - #[codec(index = 117)] - Mortal117(::core::primitive::u8), - #[codec(index = 118)] - Mortal118(::core::primitive::u8), - #[codec(index = 119)] - Mortal119(::core::primitive::u8), - #[codec(index = 120)] - Mortal120(::core::primitive::u8), - #[codec(index = 121)] - Mortal121(::core::primitive::u8), - #[codec(index = 122)] - Mortal122(::core::primitive::u8), - #[codec(index = 123)] - Mortal123(::core::primitive::u8), - #[codec(index = 124)] - Mortal124(::core::primitive::u8), - #[codec(index = 125)] - Mortal125(::core::primitive::u8), - #[codec(index = 126)] - Mortal126(::core::primitive::u8), - #[codec(index = 127)] - Mortal127(::core::primitive::u8), - #[codec(index = 128)] - Mortal128(::core::primitive::u8), - #[codec(index = 129)] - Mortal129(::core::primitive::u8), - #[codec(index = 130)] - Mortal130(::core::primitive::u8), - #[codec(index = 131)] - Mortal131(::core::primitive::u8), - #[codec(index = 132)] - Mortal132(::core::primitive::u8), - #[codec(index = 133)] - Mortal133(::core::primitive::u8), - #[codec(index = 134)] - Mortal134(::core::primitive::u8), - #[codec(index = 135)] - Mortal135(::core::primitive::u8), - #[codec(index = 136)] - Mortal136(::core::primitive::u8), - #[codec(index = 137)] - Mortal137(::core::primitive::u8), - #[codec(index = 138)] - Mortal138(::core::primitive::u8), - #[codec(index = 139)] - Mortal139(::core::primitive::u8), - #[codec(index = 140)] - Mortal140(::core::primitive::u8), - #[codec(index = 141)] - Mortal141(::core::primitive::u8), - #[codec(index = 142)] - Mortal142(::core::primitive::u8), - #[codec(index = 143)] - Mortal143(::core::primitive::u8), - #[codec(index = 144)] - Mortal144(::core::primitive::u8), - #[codec(index = 145)] - Mortal145(::core::primitive::u8), - #[codec(index = 146)] - Mortal146(::core::primitive::u8), - #[codec(index = 147)] - Mortal147(::core::primitive::u8), - #[codec(index = 148)] - Mortal148(::core::primitive::u8), - #[codec(index = 149)] - Mortal149(::core::primitive::u8), - #[codec(index = 150)] - Mortal150(::core::primitive::u8), - #[codec(index = 151)] - Mortal151(::core::primitive::u8), - #[codec(index = 152)] - Mortal152(::core::primitive::u8), - #[codec(index = 153)] - Mortal153(::core::primitive::u8), - #[codec(index = 154)] - Mortal154(::core::primitive::u8), - #[codec(index = 155)] - Mortal155(::core::primitive::u8), - #[codec(index = 156)] - Mortal156(::core::primitive::u8), - #[codec(index = 157)] - Mortal157(::core::primitive::u8), - #[codec(index = 158)] - Mortal158(::core::primitive::u8), - #[codec(index = 159)] - Mortal159(::core::primitive::u8), - #[codec(index = 160)] - Mortal160(::core::primitive::u8), - #[codec(index = 161)] - Mortal161(::core::primitive::u8), - #[codec(index = 162)] - Mortal162(::core::primitive::u8), - #[codec(index = 163)] - Mortal163(::core::primitive::u8), - #[codec(index = 164)] - Mortal164(::core::primitive::u8), - #[codec(index = 165)] - Mortal165(::core::primitive::u8), - #[codec(index = 166)] - Mortal166(::core::primitive::u8), - #[codec(index = 167)] - Mortal167(::core::primitive::u8), - #[codec(index = 168)] - Mortal168(::core::primitive::u8), - #[codec(index = 169)] - Mortal169(::core::primitive::u8), - #[codec(index = 170)] - Mortal170(::core::primitive::u8), - #[codec(index = 171)] - Mortal171(::core::primitive::u8), - #[codec(index = 172)] - Mortal172(::core::primitive::u8), - #[codec(index = 173)] - Mortal173(::core::primitive::u8), - #[codec(index = 174)] - Mortal174(::core::primitive::u8), - #[codec(index = 175)] - Mortal175(::core::primitive::u8), - #[codec(index = 176)] - Mortal176(::core::primitive::u8), - #[codec(index = 177)] - Mortal177(::core::primitive::u8), - #[codec(index = 178)] - Mortal178(::core::primitive::u8), - #[codec(index = 179)] - Mortal179(::core::primitive::u8), - #[codec(index = 180)] - Mortal180(::core::primitive::u8), - #[codec(index = 181)] - Mortal181(::core::primitive::u8), - #[codec(index = 182)] - Mortal182(::core::primitive::u8), - #[codec(index = 183)] - Mortal183(::core::primitive::u8), - #[codec(index = 184)] - Mortal184(::core::primitive::u8), - #[codec(index = 185)] - Mortal185(::core::primitive::u8), - #[codec(index = 186)] - Mortal186(::core::primitive::u8), - #[codec(index = 187)] - Mortal187(::core::primitive::u8), - #[codec(index = 188)] - Mortal188(::core::primitive::u8), - #[codec(index = 189)] - Mortal189(::core::primitive::u8), - #[codec(index = 190)] - Mortal190(::core::primitive::u8), - #[codec(index = 191)] - Mortal191(::core::primitive::u8), - #[codec(index = 192)] - Mortal192(::core::primitive::u8), - #[codec(index = 193)] - Mortal193(::core::primitive::u8), - #[codec(index = 194)] - Mortal194(::core::primitive::u8), - #[codec(index = 195)] - Mortal195(::core::primitive::u8), - #[codec(index = 196)] - Mortal196(::core::primitive::u8), - #[codec(index = 197)] - Mortal197(::core::primitive::u8), - #[codec(index = 198)] - Mortal198(::core::primitive::u8), - #[codec(index = 199)] - Mortal199(::core::primitive::u8), - #[codec(index = 200)] - Mortal200(::core::primitive::u8), - #[codec(index = 201)] - Mortal201(::core::primitive::u8), - #[codec(index = 202)] - Mortal202(::core::primitive::u8), - #[codec(index = 203)] - Mortal203(::core::primitive::u8), - #[codec(index = 204)] - Mortal204(::core::primitive::u8), - #[codec(index = 205)] - Mortal205(::core::primitive::u8), - #[codec(index = 206)] - Mortal206(::core::primitive::u8), - #[codec(index = 207)] - Mortal207(::core::primitive::u8), - #[codec(index = 208)] - Mortal208(::core::primitive::u8), - #[codec(index = 209)] - Mortal209(::core::primitive::u8), - #[codec(index = 210)] - Mortal210(::core::primitive::u8), - #[codec(index = 211)] - Mortal211(::core::primitive::u8), - #[codec(index = 212)] - Mortal212(::core::primitive::u8), - #[codec(index = 213)] - Mortal213(::core::primitive::u8), - #[codec(index = 214)] - Mortal214(::core::primitive::u8), - #[codec(index = 215)] - Mortal215(::core::primitive::u8), - #[codec(index = 216)] - Mortal216(::core::primitive::u8), - #[codec(index = 217)] - Mortal217(::core::primitive::u8), - #[codec(index = 218)] - Mortal218(::core::primitive::u8), - #[codec(index = 219)] - Mortal219(::core::primitive::u8), - #[codec(index = 220)] - Mortal220(::core::primitive::u8), - #[codec(index = 221)] - Mortal221(::core::primitive::u8), - #[codec(index = 222)] - Mortal222(::core::primitive::u8), - #[codec(index = 223)] - Mortal223(::core::primitive::u8), - #[codec(index = 224)] - Mortal224(::core::primitive::u8), - #[codec(index = 225)] - Mortal225(::core::primitive::u8), - #[codec(index = 226)] - Mortal226(::core::primitive::u8), - #[codec(index = 227)] - Mortal227(::core::primitive::u8), - #[codec(index = 228)] - Mortal228(::core::primitive::u8), - #[codec(index = 229)] - Mortal229(::core::primitive::u8), - #[codec(index = 230)] - Mortal230(::core::primitive::u8), - #[codec(index = 231)] - Mortal231(::core::primitive::u8), - #[codec(index = 232)] - Mortal232(::core::primitive::u8), - #[codec(index = 233)] - Mortal233(::core::primitive::u8), - #[codec(index = 234)] - Mortal234(::core::primitive::u8), - #[codec(index = 235)] - Mortal235(::core::primitive::u8), - #[codec(index = 236)] - Mortal236(::core::primitive::u8), - #[codec(index = 237)] - Mortal237(::core::primitive::u8), - #[codec(index = 238)] - Mortal238(::core::primitive::u8), - #[codec(index = 239)] - Mortal239(::core::primitive::u8), - #[codec(index = 240)] - Mortal240(::core::primitive::u8), - #[codec(index = 241)] - Mortal241(::core::primitive::u8), - #[codec(index = 242)] - Mortal242(::core::primitive::u8), - #[codec(index = 243)] - Mortal243(::core::primitive::u8), - #[codec(index = 244)] - Mortal244(::core::primitive::u8), - #[codec(index = 245)] - Mortal245(::core::primitive::u8), - #[codec(index = 246)] - Mortal246(::core::primitive::u8), - #[codec(index = 247)] - Mortal247(::core::primitive::u8), - #[codec(index = 248)] - Mortal248(::core::primitive::u8), - #[codec(index = 249)] - Mortal249(::core::primitive::u8), - #[codec(index = 250)] - Mortal250(::core::primitive::u8), - #[codec(index = 251)] - Mortal251(::core::primitive::u8), - #[codec(index = 252)] - Mortal252(::core::primitive::u8), - #[codec(index = 253)] - Mortal253(::core::primitive::u8), - #[codec(index = 254)] - Mortal254(::core::primitive::u8), - #[codec(index = 255)] - Mortal255(::core::primitive::u8), - } - } - pub mod header { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Header<_0, _1> { - pub parent_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub number: _0, - pub state_root: ::subxt::sp_core::H256, - pub extrinsics_root: ::subxt::sp_core::H256, - pub digest: runtime_types::sp_runtime::generic::digest::Digest, - #[codec(skip)] - pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, - } - } - pub mod unchecked_extrinsic { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct UncheckedExtrinsic<_0, _1, _2, _3>( - pub ::std::vec::Vec<::core::primitive::u8>, - #[codec(skip)] pub ::core::marker::PhantomData<(_0, _2, _1, _3)>, - ); - } - } - pub mod multiaddress { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum MultiAddress<_0, _1> { - #[codec(index = 0)] - Id(_0), - #[codec(index = 1)] - Index(#[codec(compact)] _1), - #[codec(index = 2)] - Raw(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 3)] - Address32([::core::primitive::u8; 32usize]), - #[codec(index = 4)] - Address20([::core::primitive::u8; 20usize]), - } - } - pub mod traits { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct BlakeTwo256; - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum ArithmeticError { - #[codec(index = 0)] - Underflow, - #[codec(index = 1)] - Overflow, - #[codec(index = 2)] - DivisionByZero, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum DispatchError { - #[codec(index = 0)] - Other, - #[codec(index = 1)] - CannotLookup, - #[codec(index = 2)] - BadOrigin, - #[codec(index = 3)] - Module(runtime_types::sp_runtime::ModuleError), - #[codec(index = 4)] - ConsumerRemaining, - #[codec(index = 5)] - NoProviders, - #[codec(index = 6)] - TooManyConsumers, - #[codec(index = 7)] - Token(runtime_types::sp_runtime::TokenError), - #[codec(index = 8)] - Arithmetic(runtime_types::sp_runtime::ArithmeticError), - #[codec(index = 9)] - Transactional(runtime_types::sp_runtime::TransactionalError), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct ModuleError { - pub index: ::core::primitive::u8, - pub error: [::core::primitive::u8; 4usize], - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum MultiSignature { - #[codec(index = 0)] - Ed25519(runtime_types::sp_core::ed25519::Signature), - #[codec(index = 1)] - Sr25519(runtime_types::sp_core::sr25519::Signature), - #[codec(index = 2)] - Ecdsa(runtime_types::sp_core::ecdsa::Signature), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum MultiSigner { - #[codec(index = 0)] - Ed25519(runtime_types::sp_core::ed25519::Public), - #[codec(index = 1)] - Sr25519(runtime_types::sp_core::sr25519::Public), - #[codec(index = 2)] - Ecdsa(runtime_types::sp_core::ecdsa::Public), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum TokenError { - #[codec(index = 0)] - NoFunds, - #[codec(index = 1)] - WouldDie, - #[codec(index = 2)] - BelowMinimum, - #[codec(index = 3)] - CannotCreate, - #[codec(index = 4)] - UnknownAsset, - #[codec(index = 5)] - Frozen, - #[codec(index = 6)] - Unsupported, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum TransactionalError { - #[codec(index = 0)] - LimitReached, - #[codec(index = 1)] - NoLayer, - } - } - pub mod sp_session { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct MembershipProof { - pub session: ::core::primitive::u32, - pub trie_nodes: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - pub validator_count: ::core::primitive::u32, - } - } - pub mod sp_staking { - use super::runtime_types; - pub mod offence { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct OffenceDetails<_0, _1> { - pub offender: _1, - pub reporters: ::std::vec::Vec<_0>, - } - } - } - pub mod sp_version { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct RuntimeVersion { - pub spec_name: ::std::string::String, - pub impl_name: ::std::string::String, - pub authoring_version: ::core::primitive::u32, - pub spec_version: ::core::primitive::u32, - pub impl_version: ::core::primitive::u32, - pub apis: - ::std::vec::Vec<([::core::primitive::u8; 8usize], ::core::primitive::u32)>, - pub transaction_version: ::core::primitive::u32, - pub state_version: ::core::primitive::u8, - } - } - pub mod xcm { - use super::runtime_types; - pub mod double_encoded { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct DoubleEncoded { - pub encoded: ::std::vec::Vec<::core::primitive::u8>, - } - } - pub mod v0 { - use super::runtime_types; - pub mod junction { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum BodyId { - #[codec(index = 0)] - Unit, - #[codec(index = 1)] - Named(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 2)] - Index(#[codec(compact)] ::core::primitive::u32), - #[codec(index = 3)] - Executive, - #[codec(index = 4)] - Technical, - #[codec(index = 5)] - Legislative, - #[codec(index = 6)] - Judicial, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum BodyPart { - #[codec(index = 0)] - Voice, - #[codec(index = 1)] - Members { - #[codec(compact)] - count: ::core::primitive::u32, - }, - #[codec(index = 2)] - Fraction { - #[codec(compact)] - nom: ::core::primitive::u32, - #[codec(compact)] - denom: ::core::primitive::u32, - }, - #[codec(index = 3)] - AtLeastProportion { - #[codec(compact)] - nom: ::core::primitive::u32, - #[codec(compact)] - denom: ::core::primitive::u32, - }, - #[codec(index = 4)] - MoreThanProportion { - #[codec(compact)] - nom: ::core::primitive::u32, - #[codec(compact)] - denom: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Junction { - #[codec(index = 0)] - Parent, - #[codec(index = 1)] - Parachain(#[codec(compact)] ::core::primitive::u32), - #[codec(index = 2)] - AccountId32 { - network: runtime_types::xcm::v0::junction::NetworkId, - id: [::core::primitive::u8; 32usize], - }, - #[codec(index = 3)] - AccountIndex64 { - network: runtime_types::xcm::v0::junction::NetworkId, - #[codec(compact)] - index: ::core::primitive::u64, - }, - #[codec(index = 4)] - AccountKey20 { - network: runtime_types::xcm::v0::junction::NetworkId, - key: [::core::primitive::u8; 20usize], - }, - #[codec(index = 5)] - PalletInstance(::core::primitive::u8), - #[codec(index = 6)] - GeneralIndex(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 7)] - GeneralKey(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 8)] - OnlyChild, - #[codec(index = 9)] - Plurality { - id: runtime_types::xcm::v0::junction::BodyId, - part: runtime_types::xcm::v0::junction::BodyPart, - }, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum NetworkId { - #[codec(index = 0)] - Any, - #[codec(index = 1)] - Named(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 2)] - Polkadot, - #[codec(index = 3)] - Kusama, - } - } - pub mod multi_asset { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum MultiAsset { - #[codec(index = 0)] - None, - #[codec(index = 1)] - All, - #[codec(index = 2)] - AllFungible, - #[codec(index = 3)] - AllNonFungible, - #[codec(index = 4)] - AllAbstractFungible { - id: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 5)] - AllAbstractNonFungible { - class: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 6)] - AllConcreteFungible { - id: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 7)] - AllConcreteNonFungible { - class: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 8)] - AbstractFungible { - id: ::std::vec::Vec<::core::primitive::u8>, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 9)] - AbstractNonFungible { - class: ::std::vec::Vec<::core::primitive::u8>, - instance: runtime_types::xcm::v1::multiasset::AssetInstance, - }, - #[codec(index = 10)] - ConcreteFungible { - id: runtime_types::xcm::v0::multi_location::MultiLocation, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 11)] - ConcreteNonFungible { - class: runtime_types::xcm::v0::multi_location::MultiLocation, - instance: runtime_types::xcm::v1::multiasset::AssetInstance, - }, - } - } - pub mod multi_location { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum MultiLocation { - #[codec(index = 0)] - Null, - #[codec(index = 1)] - X1(runtime_types::xcm::v0::junction::Junction), - #[codec(index = 2)] - X2( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 3)] - X3( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 4)] - X4( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 5)] - X5( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 6)] - X6( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 7)] - X7( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - #[codec(index = 8)] - X8( - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - runtime_types::xcm::v0::junction::Junction, - ), - } - } - pub mod order { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Order { - #[codec(index = 0)] - Null, - #[codec(index = 1)] - DepositAsset { - assets: - ::std::vec::Vec, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 2)] - DepositReserveAsset { - assets: - ::std::vec::Vec, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 3)] - ExchangeAsset { - give: ::std::vec::Vec, - receive: - ::std::vec::Vec, - }, - #[codec(index = 4)] - InitiateReserveWithdraw { - assets: - ::std::vec::Vec, - reserve: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 5)] - InitiateTeleport { - assets: - ::std::vec::Vec, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 6)] - QueryHolding { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - assets: - ::std::vec::Vec, - }, - #[codec(index = 7)] - BuyExecution { - fees: runtime_types::xcm::v0::multi_asset::MultiAsset, - weight: ::core::primitive::u64, - debt: ::core::primitive::u64, - halt_on_error: ::core::primitive::bool, - xcm: ::std::vec::Vec, - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum OriginKind { - #[codec(index = 0)] - Native, - #[codec(index = 1)] - SovereignAccount, - #[codec(index = 2)] - Superuser, - #[codec(index = 3)] - Xcm, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Response { - #[codec(index = 0)] - Assets(::std::vec::Vec), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Xcm { - #[codec(index = 0)] - WithdrawAsset { - assets: ::std::vec::Vec, - effects: ::std::vec::Vec, - }, - #[codec(index = 1)] - ReserveAssetDeposit { - assets: ::std::vec::Vec, - effects: ::std::vec::Vec, - }, - #[codec(index = 2)] - TeleportAsset { - assets: ::std::vec::Vec, - effects: ::std::vec::Vec, - }, - #[codec(index = 3)] - QueryResponse { - #[codec(compact)] - query_id: ::core::primitive::u64, - response: runtime_types::xcm::v0::Response, - }, - #[codec(index = 4)] - TransferAsset { - assets: ::std::vec::Vec, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 5)] - TransferReserveAsset { - assets: ::std::vec::Vec, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 6)] - Transact { - origin_type: runtime_types::xcm::v0::OriginKind, - require_weight_at_most: ::core::primitive::u64, - call: runtime_types::xcm::double_encoded::DoubleEncoded, - }, - #[codec(index = 7)] - HrmpNewChannelOpenRequest { - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - max_message_size: ::core::primitive::u32, - #[codec(compact)] - max_capacity: ::core::primitive::u32, - }, - #[codec(index = 8)] - HrmpChannelAccepted { - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 9)] - HrmpChannelClosing { - #[codec(compact)] - initiator: ::core::primitive::u32, - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 10)] - RelayedFrom { - who: runtime_types::xcm::v0::multi_location::MultiLocation, - message: ::std::boxed::Box, - }, - } - } - pub mod v1 { - use super::runtime_types; - pub mod junction { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Junction { - #[codec(index = 0)] - Parachain(#[codec(compact)] ::core::primitive::u32), - #[codec(index = 1)] - AccountId32 { - network: runtime_types::xcm::v0::junction::NetworkId, - id: [::core::primitive::u8; 32usize], - }, - #[codec(index = 2)] - AccountIndex64 { - network: runtime_types::xcm::v0::junction::NetworkId, - #[codec(compact)] - index: ::core::primitive::u64, - }, - #[codec(index = 3)] - AccountKey20 { - network: runtime_types::xcm::v0::junction::NetworkId, - key: [::core::primitive::u8; 20usize], - }, - #[codec(index = 4)] - PalletInstance(::core::primitive::u8), - #[codec(index = 5)] - GeneralIndex(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 6)] - GeneralKey(::std::vec::Vec<::core::primitive::u8>), - #[codec(index = 7)] - OnlyChild, - #[codec(index = 8)] - Plurality { - id: runtime_types::xcm::v0::junction::BodyId, - part: runtime_types::xcm::v0::junction::BodyPart, - }, - } - } - pub mod multiasset { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum AssetId { - #[codec(index = 0)] - Concrete(runtime_types::xcm::v1::multilocation::MultiLocation), - #[codec(index = 1)] - Abstract(::std::vec::Vec<::core::primitive::u8>), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum AssetInstance { - #[codec(index = 0)] - Undefined, - #[codec(index = 1)] - Index(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 2)] - Array4([::core::primitive::u8; 4usize]), - #[codec(index = 3)] - Array8([::core::primitive::u8; 8usize]), - #[codec(index = 4)] - Array16([::core::primitive::u8; 16usize]), - #[codec(index = 5)] - Array32([::core::primitive::u8; 32usize]), - #[codec(index = 6)] - Blob(::std::vec::Vec<::core::primitive::u8>), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Fungibility { - #[codec(index = 0)] - Fungible(#[codec(compact)] ::core::primitive::u128), - #[codec(index = 1)] - NonFungible(runtime_types::xcm::v1::multiasset::AssetInstance), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct MultiAsset { - pub id: runtime_types::xcm::v1::multiasset::AssetId, - pub fun: runtime_types::xcm::v1::multiasset::Fungibility, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum MultiAssetFilter { - #[codec(index = 0)] - Definite(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 1)] - Wild(runtime_types::xcm::v1::multiasset::WildMultiAsset), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct MultiAssets( - pub ::std::vec::Vec, - ); - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum WildFungibility { - #[codec(index = 0)] - Fungible, - #[codec(index = 1)] - NonFungible, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum WildMultiAsset { - #[codec(index = 0)] - All, - #[codec(index = 1)] - AllOf { - id: runtime_types::xcm::v1::multiasset::AssetId, - fun: runtime_types::xcm::v1::multiasset::WildFungibility, - }, - } - } - pub mod multilocation { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Junctions { - #[codec(index = 0)] - Here, - #[codec(index = 1)] - X1(runtime_types::xcm::v1::junction::Junction), - #[codec(index = 2)] - X2( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 3)] - X3( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 4)] - X4( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 5)] - X5( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 6)] - X6( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 7)] - X7( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - #[codec(index = 8)] - X8( - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - runtime_types::xcm::v1::junction::Junction, - ), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct MultiLocation { - pub parents: ::core::primitive::u8, - pub interior: runtime_types::xcm::v1::multilocation::Junctions, - } - } - pub mod order { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Order { - #[codec(index = 0)] - Noop, - #[codec(index = 1)] - DepositAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - max_assets: ::core::primitive::u32, - beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 2)] - DepositReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - max_assets: ::core::primitive::u32, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 3)] - ExchangeAsset { - give: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - receive: runtime_types::xcm::v1::multiasset::MultiAssets, - }, - #[codec(index = 4)] - InitiateReserveWithdraw { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - reserve: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 5)] - InitiateTeleport { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 6)] - QueryHolding { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - }, - #[codec(index = 7)] - BuyExecution { - fees: runtime_types::xcm::v1::multiasset::MultiAsset, - weight: ::core::primitive::u64, - debt: ::core::primitive::u64, - halt_on_error: ::core::primitive::bool, - instructions: ::std::vec::Vec, - }, - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Response { - #[codec(index = 0)] - Assets(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 1)] - Version(::core::primitive::u32), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Xcm { - #[codec(index = 0)] - WithdrawAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - effects: ::std::vec::Vec, - }, - #[codec(index = 1)] - ReserveAssetDeposited { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - effects: ::std::vec::Vec, - }, - #[codec(index = 2)] - ReceiveTeleportedAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - effects: ::std::vec::Vec, - }, - #[codec(index = 3)] - QueryResponse { - #[codec(compact)] - query_id: ::core::primitive::u64, - response: runtime_types::xcm::v1::Response, - }, - #[codec(index = 4)] - TransferAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 5)] - TransferReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - effects: ::std::vec::Vec, - }, - #[codec(index = 6)] - Transact { - origin_type: runtime_types::xcm::v0::OriginKind, - require_weight_at_most: ::core::primitive::u64, - call: runtime_types::xcm::double_encoded::DoubleEncoded, - }, - #[codec(index = 7)] - HrmpNewChannelOpenRequest { - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - max_message_size: ::core::primitive::u32, - #[codec(compact)] - max_capacity: ::core::primitive::u32, - }, - #[codec(index = 8)] - HrmpChannelAccepted { - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 9)] - HrmpChannelClosing { - #[codec(compact)] - initiator: ::core::primitive::u32, - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 10)] - RelayedFrom { - who: runtime_types::xcm::v1::multilocation::Junctions, - message: ::std::boxed::Box, - }, - #[codec(index = 11)] - SubscribeVersion { - #[codec(compact)] - query_id: ::core::primitive::u64, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 12)] - UnsubscribeVersion, - } - } - pub mod v2 { - use super::runtime_types; - pub mod traits { - use super::runtime_types; - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Error { - #[codec(index = 0)] - Overflow, - #[codec(index = 1)] - Unimplemented, - #[codec(index = 2)] - UntrustedReserveLocation, - #[codec(index = 3)] - UntrustedTeleportLocation, - #[codec(index = 4)] - MultiLocationFull, - #[codec(index = 5)] - MultiLocationNotInvertible, - #[codec(index = 6)] - BadOrigin, - #[codec(index = 7)] - InvalidLocation, - #[codec(index = 8)] - AssetNotFound, - #[codec(index = 9)] - FailedToTransactAsset, - #[codec(index = 10)] - NotWithdrawable, - #[codec(index = 11)] - LocationCannotHold, - #[codec(index = 12)] - ExceedsMaxMessageSize, - #[codec(index = 13)] - DestinationUnsupported, - #[codec(index = 14)] - Transport, - #[codec(index = 15)] - Unroutable, - #[codec(index = 16)] - UnknownClaim, - #[codec(index = 17)] - FailedToDecode, - #[codec(index = 18)] - MaxWeightInvalid, - #[codec(index = 19)] - NotHoldingFees, - #[codec(index = 20)] - TooExpensive, - #[codec(index = 21)] - Trap(::core::primitive::u64), - #[codec(index = 22)] - UnhandledXcmVersion, - #[codec(index = 23)] - WeightLimitReached(::core::primitive::u64), - #[codec(index = 24)] - Barrier, - #[codec(index = 25)] - WeightNotComputable, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Outcome { - #[codec(index = 0)] - Complete(::core::primitive::u64), - #[codec(index = 1)] - Incomplete( - ::core::primitive::u64, - runtime_types::xcm::v2::traits::Error, - ), - #[codec(index = 2)] - Error(runtime_types::xcm::v2::traits::Error), - } - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Instruction { - #[codec(index = 0)] - WithdrawAsset(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 1)] - ReserveAssetDeposited(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 2)] - ReceiveTeleportedAsset(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 3)] - QueryResponse { - #[codec(compact)] - query_id: ::core::primitive::u64, - response: runtime_types::xcm::v2::Response, - #[codec(compact)] - max_weight: ::core::primitive::u64, - }, - #[codec(index = 4)] - TransferAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 5)] - TransferReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 6)] - Transact { - origin_type: runtime_types::xcm::v0::OriginKind, - #[codec(compact)] - require_weight_at_most: ::core::primitive::u64, - call: runtime_types::xcm::double_encoded::DoubleEncoded, - }, - #[codec(index = 7)] - HrmpNewChannelOpenRequest { - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - max_message_size: ::core::primitive::u32, - #[codec(compact)] - max_capacity: ::core::primitive::u32, - }, - #[codec(index = 8)] - HrmpChannelAccepted { - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 9)] - HrmpChannelClosing { - #[codec(compact)] - initiator: ::core::primitive::u32, - #[codec(compact)] - sender: ::core::primitive::u32, - #[codec(compact)] - recipient: ::core::primitive::u32, - }, - #[codec(index = 10)] - ClearOrigin, - #[codec(index = 11)] - DescendOrigin(runtime_types::xcm::v1::multilocation::Junctions), - #[codec(index = 12)] - ReportError { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 13)] - DepositAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - #[codec(compact)] - max_assets: ::core::primitive::u32, - beneficiary: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 14)] - DepositReserveAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - #[codec(compact)] - max_assets: ::core::primitive::u32, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 15)] - ExchangeAsset { - give: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - receive: runtime_types::xcm::v1::multiasset::MultiAssets, - }, - #[codec(index = 16)] - InitiateReserveWithdraw { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - reserve: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 17)] - InitiateTeleport { - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm: runtime_types::xcm::v2::Xcm, - }, - #[codec(index = 18)] - QueryHolding { - #[codec(compact)] - query_id: ::core::primitive::u64, - dest: runtime_types::xcm::v1::multilocation::MultiLocation, - assets: runtime_types::xcm::v1::multiasset::MultiAssetFilter, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 19)] - BuyExecution { - fees: runtime_types::xcm::v1::multiasset::MultiAsset, - weight_limit: runtime_types::xcm::v2::WeightLimit, - }, - #[codec(index = 20)] - RefundSurplus, - #[codec(index = 21)] - SetErrorHandler(runtime_types::xcm::v2::Xcm), - #[codec(index = 22)] - SetAppendix(runtime_types::xcm::v2::Xcm), - #[codec(index = 23)] - ClearError, - #[codec(index = 24)] - ClaimAsset { - assets: runtime_types::xcm::v1::multiasset::MultiAssets, - ticket: runtime_types::xcm::v1::multilocation::MultiLocation, - }, - #[codec(index = 25)] - Trap(#[codec(compact)] ::core::primitive::u64), - #[codec(index = 26)] - SubscribeVersion { - #[codec(compact)] - query_id: ::core::primitive::u64, - #[codec(compact)] - max_response_weight: ::core::primitive::u64, - }, - #[codec(index = 27)] - UnsubscribeVersion, - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum Response { - #[codec(index = 0)] - Null, - #[codec(index = 1)] - Assets(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 2)] - ExecutionResult( - ::core::option::Option<( - ::core::primitive::u32, - runtime_types::xcm::v2::traits::Error, - )>, - ), - #[codec(index = 3)] - Version(::core::primitive::u32), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum WeightLimit { - #[codec(index = 0)] - Unlimited, - #[codec(index = 1)] - Limited(#[codec(compact)] ::core::primitive::u64), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub struct Xcm(pub ::std::vec::Vec); - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum VersionedMultiAssets { - #[codec(index = 0)] - V0(::std::vec::Vec), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::multiasset::MultiAssets), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum VersionedMultiLocation { - #[codec(index = 0)] - V0(runtime_types::xcm::v0::multi_location::MultiLocation), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::multilocation::MultiLocation), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum VersionedResponse { - #[codec(index = 0)] - V0(runtime_types::xcm::v0::Response), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::Response), - #[codec(index = 2)] - V2(runtime_types::xcm::v2::Response), - } - #[derive(:: subxt :: codec :: Decode, :: subxt :: codec :: Encode, Debug)] - pub enum VersionedXcm { - #[codec(index = 0)] - V0(runtime_types::xcm::v0::Xcm), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::Xcm), - #[codec(index = 2)] - V2(runtime_types::xcm::v2::Xcm), - } - } - } - #[doc = r" The default error type returned when there is a runtime issue."] - pub type DispatchError = runtime_types::sp_runtime::DispatchError; - impl ::subxt::HasModuleError for runtime_types::sp_runtime::DispatchError { - fn module_error_data(&self) -> Option<::subxt::ModuleErrorData> { - if let Self::Module(module_error) = self { - Some(::subxt::ModuleErrorData { - pallet_index: module_error.index, - error: module_error.error, - }) - } else { - None - } - } - } - pub struct RuntimeApi { - pub client: ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl Clone for RuntimeApi { - fn clone(&self) -> Self { - Self { - client: self.client.clone(), - marker: ::core::marker::PhantomData, - } - } - } - impl ::core::convert::From<::subxt::Client> for RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - fn from(client: ::subxt::Client) -> Self { - Self { - client, - marker: ::core::marker::PhantomData, - } - } - } - impl<'a, T, X> RuntimeApi - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn validate_metadata(&'a self) -> Result<(), ::subxt::MetadataError> { - let runtime_metadata_hash = { - let locked_metadata = self.client.metadata(); - locked_metadata.metadata_hash(&PALLETS) - }; - if runtime_metadata_hash - != [ - 24u8, 146u8, 85u8, 141u8, 163u8, 155u8, 68u8, 138u8, 171u8, 146u8, 102u8, - 129u8, 45u8, 193u8, 102u8, 125u8, 205u8, 37u8, 74u8, 189u8, 44u8, 166u8, 32u8, - 196u8, 123u8, 234u8, 51u8, 53u8, 72u8, 147u8, 148u8, 125u8, - ] - { - Err(::subxt::MetadataError::IncompatibleMetadata) - } else { - Ok(()) - } - } - pub fn constants(&'a self) -> ConstantsApi<'a, T> { - ConstantsApi { - client: &self.client, - } - } - pub fn storage(&'a self) -> StorageApi<'a, T> { - StorageApi { - client: &self.client, - } - } - pub fn tx(&'a self) -> TransactionApi<'a, T, X> { - TransactionApi { - client: &self.client, - marker: ::core::marker::PhantomData, - } - } - pub fn events(&'a self) -> EventsApi<'a, T> { - EventsApi { - client: &self.client, - } - } - } - pub struct EventsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> EventsApi<'a, T> { - pub async fn at( - &'a self, - block_hash: T::Hash, - ) -> Result<::subxt::events::Events<'a, T, Event>, ::subxt::BasicError> { - ::subxt::events::at::(self.client, block_hash).await - } - pub async fn subscribe( - &self, - ) -> Result< - ::subxt::events::EventSubscription<'a, ::subxt::events::EventSub, T, Event>, - ::subxt::BasicError, - > { - ::subxt::events::subscribe::(self.client).await - } - pub async fn subscribe_finalized( - &self, - ) -> Result< - ::subxt::events::EventSubscription< - 'a, - ::subxt::events::FinalizedEventSub<'a, T::Header>, - T, - Event, - >, - ::subxt::BasicError, - > { - ::subxt::events::subscribe_finalized::(self.client).await - } - } - pub struct ConstantsApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> ConstantsApi<'a, T> { - pub fn system(&self) -> system::constants::ConstantsApi<'a, T> { - system::constants::ConstantsApi::new(self.client) - } - pub fn babe(&self) -> babe::constants::ConstantsApi<'a, T> { - babe::constants::ConstantsApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::constants::ConstantsApi<'a, T> { - timestamp::constants::ConstantsApi::new(self.client) - } - pub fn indices(&self) -> indices::constants::ConstantsApi<'a, T> { - indices::constants::ConstantsApi::new(self.client) - } - pub fn balances(&self) -> balances::constants::ConstantsApi<'a, T> { - balances::constants::ConstantsApi::new(self.client) - } - pub fn transaction_payment(&self) -> transaction_payment::constants::ConstantsApi<'a, T> { - transaction_payment::constants::ConstantsApi::new(self.client) - } - pub fn authorship(&self) -> authorship::constants::ConstantsApi<'a, T> { - authorship::constants::ConstantsApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::constants::ConstantsApi<'a, T> { - grandpa::constants::ConstantsApi::new(self.client) - } - pub fn im_online(&self) -> im_online::constants::ConstantsApi<'a, T> { - im_online::constants::ConstantsApi::new(self.client) - } - pub fn paras(&self) -> paras::constants::ConstantsApi<'a, T> { - paras::constants::ConstantsApi::new(self.client) - } - pub fn registrar(&self) -> registrar::constants::ConstantsApi<'a, T> { - registrar::constants::ConstantsApi::new(self.client) - } - pub fn auctions(&self) -> auctions::constants::ConstantsApi<'a, T> { - auctions::constants::ConstantsApi::new(self.client) - } - pub fn crowdloan(&self) -> crowdloan::constants::ConstantsApi<'a, T> { - crowdloan::constants::ConstantsApi::new(self.client) - } - pub fn slots(&self) -> slots::constants::ConstantsApi<'a, T> { - slots::constants::ConstantsApi::new(self.client) - } - pub fn assigned_slots(&self) -> assigned_slots::constants::ConstantsApi<'a, T> { - assigned_slots::constants::ConstantsApi::new(self.client) - } - pub fn bridge_rococo_grandpa( - &self, - ) -> bridge_rococo_grandpa::constants::ConstantsApi<'a, T> { - bridge_rococo_grandpa::constants::ConstantsApi::new(self.client) - } - pub fn bridge_wococo_grandpa( - &self, - ) -> bridge_wococo_grandpa::constants::ConstantsApi<'a, T> { - bridge_wococo_grandpa::constants::ConstantsApi::new(self.client) - } - pub fn bridge_rococo_messages( - &self, - ) -> bridge_rococo_messages::constants::ConstantsApi<'a, T> { - bridge_rococo_messages::constants::ConstantsApi::new(self.client) - } - pub fn bridge_wococo_messages( - &self, - ) -> bridge_wococo_messages::constants::ConstantsApi<'a, T> { - bridge_wococo_messages::constants::ConstantsApi::new(self.client) - } - pub fn utility(&self) -> utility::constants::ConstantsApi<'a, T> { - utility::constants::ConstantsApi::new(self.client) - } - pub fn proxy(&self) -> proxy::constants::ConstantsApi<'a, T> { - proxy::constants::ConstantsApi::new(self.client) - } - pub fn multisig(&self) -> multisig::constants::ConstantsApi<'a, T> { - multisig::constants::ConstantsApi::new(self.client) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T> StorageApi<'a, T> - where - T: ::subxt::Config, - { - pub fn system(&self) -> system::storage::StorageApi<'a, T> { - system::storage::StorageApi::new(self.client) - } - pub fn babe(&self) -> babe::storage::StorageApi<'a, T> { - babe::storage::StorageApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::storage::StorageApi<'a, T> { - timestamp::storage::StorageApi::new(self.client) - } - pub fn indices(&self) -> indices::storage::StorageApi<'a, T> { - indices::storage::StorageApi::new(self.client) - } - pub fn balances(&self) -> balances::storage::StorageApi<'a, T> { - balances::storage::StorageApi::new(self.client) - } - pub fn transaction_payment(&self) -> transaction_payment::storage::StorageApi<'a, T> { - transaction_payment::storage::StorageApi::new(self.client) - } - pub fn authorship(&self) -> authorship::storage::StorageApi<'a, T> { - authorship::storage::StorageApi::new(self.client) - } - pub fn offences(&self) -> offences::storage::StorageApi<'a, T> { - offences::storage::StorageApi::new(self.client) - } - pub fn historical(&self) -> historical::storage::StorageApi<'a, T> { - historical::storage::StorageApi::new(self.client) - } - pub fn session(&self) -> session::storage::StorageApi<'a, T> { - session::storage::StorageApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { - grandpa::storage::StorageApi::new(self.client) - } - pub fn im_online(&self) -> im_online::storage::StorageApi<'a, T> { - im_online::storage::StorageApi::new(self.client) - } - pub fn authority_discovery(&self) -> authority_discovery::storage::StorageApi<'a, T> { - authority_discovery::storage::StorageApi::new(self.client) - } - pub fn configuration(&self) -> configuration::storage::StorageApi<'a, T> { - configuration::storage::StorageApi::new(self.client) - } - pub fn paras_shared(&self) -> paras_shared::storage::StorageApi<'a, T> { - paras_shared::storage::StorageApi::new(self.client) - } - pub fn para_inclusion(&self) -> para_inclusion::storage::StorageApi<'a, T> { - para_inclusion::storage::StorageApi::new(self.client) - } - pub fn para_inherent(&self) -> para_inherent::storage::StorageApi<'a, T> { - para_inherent::storage::StorageApi::new(self.client) - } - pub fn para_scheduler(&self) -> para_scheduler::storage::StorageApi<'a, T> { - para_scheduler::storage::StorageApi::new(self.client) - } - pub fn paras(&self) -> paras::storage::StorageApi<'a, T> { - paras::storage::StorageApi::new(self.client) - } - pub fn initializer(&self) -> initializer::storage::StorageApi<'a, T> { - initializer::storage::StorageApi::new(self.client) - } - pub fn dmp(&self) -> dmp::storage::StorageApi<'a, T> { - dmp::storage::StorageApi::new(self.client) - } - pub fn ump(&self) -> ump::storage::StorageApi<'a, T> { - ump::storage::StorageApi::new(self.client) - } - pub fn hrmp(&self) -> hrmp::storage::StorageApi<'a, T> { - hrmp::storage::StorageApi::new(self.client) - } - pub fn para_session_info(&self) -> para_session_info::storage::StorageApi<'a, T> { - para_session_info::storage::StorageApi::new(self.client) - } - pub fn paras_disputes(&self) -> paras_disputes::storage::StorageApi<'a, T> { - paras_disputes::storage::StorageApi::new(self.client) - } - pub fn registrar(&self) -> registrar::storage::StorageApi<'a, T> { - registrar::storage::StorageApi::new(self.client) - } - pub fn auctions(&self) -> auctions::storage::StorageApi<'a, T> { - auctions::storage::StorageApi::new(self.client) - } - pub fn crowdloan(&self) -> crowdloan::storage::StorageApi<'a, T> { - crowdloan::storage::StorageApi::new(self.client) - } - pub fn slots(&self) -> slots::storage::StorageApi<'a, T> { - slots::storage::StorageApi::new(self.client) - } - pub fn assigned_slots(&self) -> assigned_slots::storage::StorageApi<'a, T> { - assigned_slots::storage::StorageApi::new(self.client) - } - pub fn sudo(&self) -> sudo::storage::StorageApi<'a, T> { - sudo::storage::StorageApi::new(self.client) - } - pub fn mmr(&self) -> mmr::storage::StorageApi<'a, T> { - mmr::storage::StorageApi::new(self.client) - } - pub fn beefy(&self) -> beefy::storage::StorageApi<'a, T> { - beefy::storage::StorageApi::new(self.client) - } - pub fn mmr_leaf(&self) -> mmr_leaf::storage::StorageApi<'a, T> { - mmr_leaf::storage::StorageApi::new(self.client) - } - pub fn validator_manager(&self) -> validator_manager::storage::StorageApi<'a, T> { - validator_manager::storage::StorageApi::new(self.client) - } - pub fn bridge_rococo_grandpa(&self) -> bridge_rococo_grandpa::storage::StorageApi<'a, T> { - bridge_rococo_grandpa::storage::StorageApi::new(self.client) - } - pub fn bridge_wococo_grandpa(&self) -> bridge_wococo_grandpa::storage::StorageApi<'a, T> { - bridge_wococo_grandpa::storage::StorageApi::new(self.client) - } - pub fn bridge_rococo_messages(&self) -> bridge_rococo_messages::storage::StorageApi<'a, T> { - bridge_rococo_messages::storage::StorageApi::new(self.client) - } - pub fn bridge_wococo_messages(&self) -> bridge_wococo_messages::storage::StorageApi<'a, T> { - bridge_wococo_messages::storage::StorageApi::new(self.client) - } - pub fn collective(&self) -> collective::storage::StorageApi<'a, T> { - collective::storage::StorageApi::new(self.client) - } - pub fn membership(&self) -> membership::storage::StorageApi<'a, T> { - membership::storage::StorageApi::new(self.client) - } - pub fn proxy(&self) -> proxy::storage::StorageApi<'a, T> { - proxy::storage::StorageApi::new(self.client) - } - pub fn multisig(&self) -> multisig::storage::StorageApi<'a, T> { - multisig::storage::StorageApi::new(self.client) - } - pub fn xcm_pallet(&self) -> xcm_pallet::storage::StorageApi<'a, T> { - xcm_pallet::storage::StorageApi::new(self.client) - } - } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, - } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::extrinsic::ExtrinsicParams, - { - pub fn system(&self) -> system::calls::TransactionApi<'a, T, X> { - system::calls::TransactionApi::new(self.client) - } - pub fn babe(&self) -> babe::calls::TransactionApi<'a, T, X> { - babe::calls::TransactionApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T, X> { - timestamp::calls::TransactionApi::new(self.client) - } - pub fn indices(&self) -> indices::calls::TransactionApi<'a, T, X> { - indices::calls::TransactionApi::new(self.client) - } - pub fn balances(&self) -> balances::calls::TransactionApi<'a, T, X> { - balances::calls::TransactionApi::new(self.client) - } - pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T, X> { - authorship::calls::TransactionApi::new(self.client) - } - pub fn session(&self) -> session::calls::TransactionApi<'a, T, X> { - session::calls::TransactionApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T, X> { - grandpa::calls::TransactionApi::new(self.client) - } - pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T, X> { - im_online::calls::TransactionApi::new(self.client) - } - pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T, X> { - configuration::calls::TransactionApi::new(self.client) - } - pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T, X> { - paras_shared::calls::TransactionApi::new(self.client) - } - pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi<'a, T, X> { - para_inclusion::calls::TransactionApi::new(self.client) - } - pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T, X> { - para_inherent::calls::TransactionApi::new(self.client) - } - pub fn paras(&self) -> paras::calls::TransactionApi<'a, T, X> { - paras::calls::TransactionApi::new(self.client) - } - pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T, X> { - initializer::calls::TransactionApi::new(self.client) - } - pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T, X> { - dmp::calls::TransactionApi::new(self.client) - } - pub fn ump(&self) -> ump::calls::TransactionApi<'a, T, X> { - ump::calls::TransactionApi::new(self.client) - } - pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T, X> { - hrmp::calls::TransactionApi::new(self.client) - } - pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi<'a, T, X> { - paras_disputes::calls::TransactionApi::new(self.client) - } - pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T, X> { - registrar::calls::TransactionApi::new(self.client) - } - pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T, X> { - auctions::calls::TransactionApi::new(self.client) - } - pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T, X> { - crowdloan::calls::TransactionApi::new(self.client) - } - pub fn slots(&self) -> slots::calls::TransactionApi<'a, T, X> { - slots::calls::TransactionApi::new(self.client) - } - pub fn paras_sudo_wrapper(&self) -> paras_sudo_wrapper::calls::TransactionApi<'a, T, X> { - paras_sudo_wrapper::calls::TransactionApi::new(self.client) - } - pub fn assigned_slots(&self) -> assigned_slots::calls::TransactionApi<'a, T, X> { - assigned_slots::calls::TransactionApi::new(self.client) - } - pub fn sudo(&self) -> sudo::calls::TransactionApi<'a, T, X> { - sudo::calls::TransactionApi::new(self.client) - } - pub fn beefy(&self) -> beefy::calls::TransactionApi<'a, T, X> { - beefy::calls::TransactionApi::new(self.client) - } - pub fn validator_manager(&self) -> validator_manager::calls::TransactionApi<'a, T, X> { - validator_manager::calls::TransactionApi::new(self.client) - } - pub fn bridge_rococo_grandpa( - &self, - ) -> bridge_rococo_grandpa::calls::TransactionApi<'a, T, X> { - bridge_rococo_grandpa::calls::TransactionApi::new(self.client) - } - pub fn bridge_wococo_grandpa( - &self, - ) -> bridge_wococo_grandpa::calls::TransactionApi<'a, T, X> { - bridge_wococo_grandpa::calls::TransactionApi::new(self.client) - } - pub fn bridge_rococo_messages( - &self, - ) -> bridge_rococo_messages::calls::TransactionApi<'a, T, X> { - bridge_rococo_messages::calls::TransactionApi::new(self.client) - } - pub fn bridge_wococo_messages( - &self, - ) -> bridge_wococo_messages::calls::TransactionApi<'a, T, X> { - bridge_wococo_messages::calls::TransactionApi::new(self.client) - } - pub fn collective(&self) -> collective::calls::TransactionApi<'a, T, X> { - collective::calls::TransactionApi::new(self.client) - } - pub fn membership(&self) -> membership::calls::TransactionApi<'a, T, X> { - membership::calls::TransactionApi::new(self.client) - } - pub fn utility(&self) -> utility::calls::TransactionApi<'a, T, X> { - utility::calls::TransactionApi::new(self.client) - } - pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T, X> { - proxy::calls::TransactionApi::new(self.client) - } - pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T, X> { - multisig::calls::TransactionApi::new(self.client) - } - pub fn xcm_pallet(&self) -> xcm_pallet::calls::TransactionApi<'a, T, X> { - xcm_pallet::calls::TransactionApi::new(self.client) - } - } -} diff --git a/src/test_utils.rs b/src/test_utils.rs deleted file mode 100644 index d85a8e4d690..00000000000 --- a/src/test_utils.rs +++ /dev/null @@ -1,368 +0,0 @@ -use crate::primitives::{ParachainHeader, PartialMmrLeaf, SignedCommitment}; -use crate::traits::{ClientState, HostFunctions}; -use crate::{runtime, MerkleHasher, MmrUpdateProof, SignatureWithAuthorityIndex}; -use beefy_primitives::mmr::{BeefyNextAuthoritySet, MmrLeaf}; -use codec::{Decode, Encode}; -use hex_literal::hex; -use pallet_mmr_primitives::BatchProof; -use sp_core::H256; -use sp_io::crypto; -use sp_runtime::generic::Header; -use sp_runtime::traits::{BlakeTwo256, Convert}; -use sp_trie::{generate_trie_proof, TrieDBMut, TrieMut}; -use std::collections::BTreeMap; -use subxt::rpc::rpc_params; -use subxt::rpc::ClientT; -use subxt::sp_core::keccak_256; - -pub const PARA_ID: u32 = 2000; - -#[derive(Clone)] -pub struct Crypto; - -impl HostFunctions for Crypto { - fn keccak_256(input: &[u8]) -> [u8; 32] { - keccak_256(input) - } - - fn secp256k1_ecdsa_recover_compressed( - signature: &[u8; 65], - value: &[u8; 32], - ) -> Option> { - crypto::secp256k1_ecdsa_recover_compressed(signature, value) - .ok() - .map(|val| val.to_vec()) - } -} - -pub async fn get_initial_client_state( - api: Option< - &runtime::api::RuntimeApi< - subxt::DefaultConfig, - subxt::PolkadotExtrinsicParams, - >, - >, -) -> ClientState { - if api.is_none() { - return ClientState { - latest_beefy_height: 0, - mmr_root_hash: Default::default(), - current_authorities: BeefyNextAuthoritySet { - id: 0, - len: 5, - root: H256::from(hex!( - "baa93c7834125ee3120bac6e3342bd3f28611110ad21ab6075367abdffefeb09" - )), - }, - next_authorities: BeefyNextAuthoritySet { - id: 1, - len: 5, - root: H256::from(hex!( - "baa93c7834125ee3120bac6e3342bd3f28611110ad21ab6075367abdffefeb09" - )), - }, - beefy_activation_block: 0, - }; - } - // Get initial validator set - // In development mode validators are the same for all sessions only validator set_id changes - let api = api.unwrap(); - let validator_set_id = api.storage().beefy().validator_set_id(None).await.unwrap(); - let next_val_set = api - .storage() - .mmr_leaf() - .beefy_next_authorities(None) - .await - .unwrap(); - ClientState { - latest_beefy_height: 0, - mmr_root_hash: Default::default(), - current_authorities: BeefyNextAuthoritySet { - id: validator_set_id, - len: next_val_set.len, - root: next_val_set.root, - }, - next_authorities: BeefyNextAuthoritySet { - id: validator_set_id + 1, - len: next_val_set.len, - root: next_val_set.root, - }, - beefy_activation_block: 0, - } -} - -pub async fn get_mmr_update( - client: &subxt::Client, - signed_commitment: beefy_primitives::SignedCommitment, -) -> MmrUpdateProof { - let api = - client.clone().to_runtime_api::, - >>(); - let subxt_block_number: subxt::BlockNumber = signed_commitment.commitment.block_number.into(); - let block_hash = client - .rpc() - .block_hash(Some(subxt_block_number)) - .await - .unwrap(); - - let current_authorities = api.storage().beefy().authorities(block_hash).await.unwrap(); - - // Current LeafIndex - let block_number = signed_commitment.commitment.block_number; - let leaf_index = (block_number - 1) as u64; - let leaf_proof: pallet_mmr_rpc::LeafProof = client - .rpc() - .client - .request("mmr_generateProof", rpc_params!(leaf_index, block_hash)) - .await - .unwrap(); - - let opaque_leaf: Vec = codec::Decode::decode(&mut &*leaf_proof.leaf.0).unwrap(); - let latest_leaf: MmrLeaf = - codec::Decode::decode(&mut &*opaque_leaf).unwrap(); - let mmr_proof: pallet_mmr_primitives::Proof = - codec::Decode::decode(&mut &*leaf_proof.proof.0).unwrap(); - - let authority_address_hashes = current_authorities - .into_iter() - .map(|x| { - let id: beefy_primitives::crypto::AuthorityId = - codec::Decode::decode(&mut &*x.encode()).unwrap(); - keccak_256(&beefy_mmr::BeefyEcdsaToEthereum::convert(id)) - }) - .collect::>(); - - let signatures = signed_commitment - .signatures - .into_iter() - .enumerate() - .map(|(index, x)| { - if let Some(sig) = x { - let mut temp = [0u8; 65]; - if sig.len() == 65 { - temp.copy_from_slice(&*sig.encode()); - Some(SignatureWithAuthorityIndex { - index: index as u32, - signature: temp, - }) - } else { - None - } - } else { - None - } - }) - .filter_map(|x| x) - .collect::>(); - - let signature_indices = signatures - .iter() - .map(|x| x.index as usize) - .collect::>(); - - let tree = - rs_merkle::MerkleTree::>::from_leaves(&authority_address_hashes); - - let authority_proof = tree.proof(&signature_indices); - - MmrUpdateProof { - signed_commitment: SignedCommitment { - commitment: signed_commitment.commitment.clone(), - signatures, - }, - latest_mmr_leaf: latest_leaf.clone(), - mmr_proof, - authority_proof: authority_proof.proof_hashes().to_vec(), - } -} - -pub async fn get_parachain_headers( - client: &subxt::Client, - para_client: &subxt::Client, - commitment_block_number: u32, - latest_beefy_height: u32, -) -> (Vec, BatchProof) { - let subxt_block_number: subxt::BlockNumber = commitment_block_number.into(); - let block_hash = client - .rpc() - .block_hash(Some(subxt_block_number)) - .await - .unwrap(); - - let api = - client.clone().to_runtime_api::, - >>(); - - let para_ids = api.storage().paras().parachains(block_hash).await.unwrap(); - let storage_prefix = frame_support::storage::storage_prefix(b"Paras", b"Heads"); - let mut para_header_keys = Vec::new(); - - for para_id in para_ids { - let encoded_para_id = para_id.encode(); - - let mut full_key = storage_prefix.clone().to_vec(); - full_key.extend_from_slice(sp_core::hashing::twox_64(&encoded_para_id).as_slice()); - full_key.extend_from_slice(&encoded_para_id); - para_header_keys.push(subxt::sp_core::storage::StorageKey(full_key)); - } - - let previous_finalized_block_number: subxt::BlockNumber = (latest_beefy_height + 1).into(); - let previous_finalized_hash = client - .rpc() - .block_hash(Some(previous_finalized_block_number)) - .await - .unwrap() - .unwrap(); - - let change_set = client - .storage() - .query_storage(para_header_keys, previous_finalized_hash, block_hash) - .await - .unwrap(); - let mut finalized_blocks = BTreeMap::new(); - let mut leaf_indices = vec![]; - for changes in change_set { - let header = client - .rpc() - .header(Some(changes.block)) - .await - .unwrap() - .unwrap(); - - let mut heads = BTreeMap::new(); - - for (key, value) in changes.changes { - if let Some(storage_data) = value { - let key = key.0.to_vec(); - let para_id = u32::decode(&mut &key[40..]).unwrap(); - let head_data: runtime::api::runtime_types::polkadot_parachain::primitives::HeadData = Decode::decode(&mut &*storage_data.0).unwrap(); - heads.insert(para_id, head_data.0); - } - } - - if !heads.contains_key(&PARA_ID) { - continue; - } - finalized_blocks.insert(header.number as u64, heads); - leaf_indices.push(header.number - 1); - } - - let batch_proof: pallet_mmr_rpc::LeafBatchProof = client - .rpc() - .client - .request( - "mmr_generateBatchProof", - rpc_params!(leaf_indices.clone(), block_hash), - ) - .await - .unwrap(); - - let leaves: Vec> = Decode::decode(&mut &*batch_proof.leaves.to_vec()).unwrap(); - - let mut parachain_headers = vec![]; - for leaf_bytes in leaves { - let leaf: MmrLeaf = Decode::decode(&mut &*leaf_bytes).unwrap(); - let leaf_block_number = (leaf.parent_number_and_hash.0 + 1) as u64; - let para_headers = finalized_blocks.get(&leaf_block_number).unwrap(); - - let mut index = None; - let mut parachain_leaves = vec![]; - // Values are already sorted by key which is the para_id - for (idx, (key, header)) in para_headers.iter().enumerate() { - let pair = (*key, header.clone()); - let leaf_hash = keccak_256(pair.encode().as_slice()); - parachain_leaves.push(leaf_hash); - if key == &PARA_ID { - index = Some(idx); - } - } - - let tree = rs_merkle::MerkleTree::>::from_leaves(¶chain_leaves); - - let proof = if let Some(index) = index { - tree.proof(&[index]) - .proof_hashes() - .into_iter() - .map(|item| item.clone()) - .collect::>() - } else { - vec![] - }; - - let para_head = para_headers.get(&PARA_ID).unwrap().clone(); - let decoded_para_head = Header::::decode(&mut &*para_head).unwrap(); - - let block_number = decoded_para_head.number; - let subxt_block_number: subxt::BlockNumber = block_number.into(); - let block_hash = para_client - .rpc() - .block_hash(Some(subxt_block_number)) - .await - .unwrap(); - - let block = para_client.rpc().block(block_hash).await.unwrap().unwrap(); - let extrinsics = block - .block - .extrinsics - .into_iter() - .map(|e| e.encode()) - .collect::>(); - - let (timestamp_extrinsic, extrinsic_proof) = { - if extrinsics.is_empty() { - (vec![], vec![]) - } else { - let timestamp_ext = extrinsics[0].clone(); - - let mut db = sp_trie::MemoryDB::::default(); - - let root = { - let mut root = Default::default(); - let mut trie = - >>::new(&mut db, &mut root); - - for (i, ext) in extrinsics.into_iter().enumerate() { - let key = codec::Compact(i as u32).encode(); - trie.insert(&key, &ext).unwrap(); - } - *trie.root() - }; - - let key = codec::Compact::(0u32).encode(); - let extrinsic_proof = - generate_trie_proof::, _, _, _>( - &db, - root, - vec![&key], - ) - .unwrap(); - (timestamp_ext, extrinsic_proof) - } - }; - - let header = ParachainHeader { - parachain_header: para_head, - partial_mmr_leaf: PartialMmrLeaf { - version: leaf.version, - parent_number_and_hash: leaf.parent_number_and_hash, - beefy_next_authority_set: leaf.beefy_next_authority_set.clone(), - }, - para_id: PARA_ID, - parachain_heads_proof: proof, - heads_leaf_index: index.unwrap() as u32, - heads_total_count: parachain_leaves.len() as u32, - extrinsic_proof, - timestamp_extrinsic, - }; - - parachain_headers.push(header); - } - - let batch_proof: pallet_mmr_primitives::BatchProof = - Decode::decode(&mut batch_proof.proof.0.as_slice()).unwrap(); - (parachain_headers, batch_proof) -} diff --git a/src/tests.rs b/src/tests.rs index a6749895bd8..fb0990a3c4e 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1,9 +1,8 @@ use crate::primitives::SignedCommitment; -use crate::test_utils::Crypto; -use crate::test_utils::{get_initial_client_state, get_mmr_update, get_parachain_headers}; use crate::BeefyClientError; use crate::{ - runtime, BeefyLightClient, MmrUpdateProof, ParachainsUpdateProof, SignatureWithAuthorityIndex, + queries::utils::{ClientWrapper, Crypto}, + BeefyLightClient, MmrUpdateProof, ParachainsUpdateProof, SignatureWithAuthorityIndex, }; use beefy_primitives::known_payload_ids::MMR_ROOT_ID; use beefy_primitives::mmr::{BeefyNextAuthoritySet, MmrLeaf}; @@ -22,15 +21,15 @@ async fn test_verify_mmr_with_proof() { .build::() .await .unwrap(); - - let api = - client.clone().to_runtime_api::, - >>(); + let para_url = std::env::var("NODE_ENDPOINT").unwrap_or("ws://127.0.0.1:9988".to_string()); + let para_client = subxt::ClientBuilder::new() + .set_url(para_url) + .build::() + .await + .unwrap(); let mut count = 0; - let mut client_state = get_initial_client_state(Some(&api)).await; + let mut client_state = ClientWrapper::get_initial_client_state(Some(&client)).await; let mut subscription: Subscription = client .rpc() .client @@ -42,6 +41,13 @@ async fn test_verify_mmr_with_proof() { .await .unwrap(); + let parachain_client = ClientWrapper { + relay_client: client, + para_client, + beefy_activation_block: 0, + para_id: 2000, + }; + while let Some(Ok(commitment)) = subscription.next().await { if count == 100 { break; @@ -71,7 +77,10 @@ async fn test_verify_mmr_with_proof() { signed_commitment.commitment ); - let mmr_update = get_mmr_update(&client, signed_commitment.clone()).await; + let mmr_update = parachain_client + .fetch_mmr_update_proof_for(signed_commitment.clone()) + .await + .unwrap(); client_state = beef_light_client .verify_mmr_root_with_proof(client_state.clone(), mmr_update.clone()) @@ -140,11 +149,24 @@ async fn should_fail_with_incomplete_signature_threshold() { authority_proof: vec![], }; - assert_eq!( - beef_light_client - .verify_mmr_root_with_proof(get_initial_client_state(None).await, mmr_update), - Err(BeefyClientError::IncompleteSignatureThreshold) + let res = beef_light_client.verify_mmr_root_with_proof( + ClientWrapper::::get_initial_client_state(None).await, + mmr_update, ); + + match res { + Err(BeefyClientError::IncompleteSignatureThreshold) => {} + Err(err) => panic!( + "Expected {:?} found {:?}", + BeefyClientError::IncompleteSignatureThreshold, + err + ), + Ok(val) => panic!( + "Expected {:?} found {:?}", + BeefyClientError::IncompleteSignatureThreshold, + val + ), + } } #[tokio::test] @@ -184,11 +206,27 @@ async fn should_fail_with_invalid_validator_set_id() { authority_proof: vec![], }; - assert_eq!( - beef_light_client - .verify_mmr_root_with_proof(get_initial_client_state(None).await, mmr_update), - Err(BeefyClientError::InvalidMmrUpdate) + let res = beef_light_client.verify_mmr_root_with_proof( + ClientWrapper::::get_initial_client_state(None).await, + mmr_update, ); + match res { + Err(BeefyClientError::AuthoritySetMismatch { + current_set_id, + next_set_id, + commitment_set_id, + }) if current_set_id == 0 && next_set_id == 1 && commitment_set_id == 3 => {} + Err(err) => panic!( + "Expected {:?} found {:?}", + BeefyClientError::AuthoritySetMismatch { + current_set_id: 0, + next_set_id: 1, + commitment_set_id: 3 + }, + err + ), + Ok(val) => panic!("Found {:?}", val), + } } #[tokio::test] @@ -206,13 +244,9 @@ async fn verify_parachain_headers() { .build::() .await .unwrap(); - let api = - client.clone().to_runtime_api::, - >>(); + let mut count = 1; - let mut client_state = get_initial_client_state(Some(&api)).await; + let mut client_state = ClientWrapper::get_initial_client_state(Some(&client)).await; let mut subscription: Subscription = client .rpc() .client @@ -224,6 +258,13 @@ async fn verify_parachain_headers() { .await .unwrap(); + let parachain_client = ClientWrapper { + relay_client: client, + para_client, + beefy_activation_block: 0, + para_id: 2000, + }; + while let Some(Ok(commitment)) = subscription.next().await { if count == 100 { break; @@ -255,19 +296,19 @@ async fn verify_parachain_headers() { let block_number = signed_commitment.commitment.block_number; - let (parachain_headers, batch_proof) = get_parachain_headers( - &client, - ¶_client, - block_number, - client_state.latest_beefy_height, - ) - .await; + let (parachain_headers, batch_proof) = parachain_client + .fetch_finalized_parachain_headers_at(block_number, client_state.latest_beefy_height) + .await + .unwrap(); let parachain_update_proof = ParachainsUpdateProof { parachain_headers, mmr_proof: batch_proof, }; - let mmr_update = get_mmr_update(&client, signed_commitment).await; + let mmr_update = parachain_client + .fetch_mmr_update_proof_for(signed_commitment) + .await + .unwrap(); client_state = beef_light_client .verify_mmr_root_with_proof(client_state, mmr_update)