diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c275c8648..a0a04a13c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,75 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.16.0] - 2022-02-01 + +*Note*: This is a significant release which introduces support for V14 metadata and macro based codegen, as well as making many breaking changes to the API. + +### Changed + +- Log debug message for JSON-RPC response ([#415](https://github.com/paritytech/subxt/pull/415)) +- Only convert struct names to camel case for Call variant structs ([#412](https://github.com/paritytech/subxt/pull/412)) +- Parameterize AccountData ([#409](https://github.com/paritytech/subxt/pull/409)) +- Allow decoding Events containing BitVecs ([#408](https://github.com/paritytech/subxt/pull/408)) +- Custom derive for cli ([#407](https://github.com/paritytech/subxt/pull/407)) +- make storage-n-map fields public too ([#404](https://github.com/paritytech/subxt/pull/404)) +- add constants api to codegen ([#402](https://github.com/paritytech/subxt/pull/402)) +- Expose transaction::TransactionProgress as public ([#401](https://github.com/paritytech/subxt/pull/401)) +- add interbtc-clients to real world usage section ([#397](https://github.com/paritytech/subxt/pull/397)) +- Make own version of RuntimeVersion to avoid mismatches ([#395](https://github.com/paritytech/subxt/pull/395)) +- Use the generated DispatchError instead of the hardcoded Substrate one ([#394](https://github.com/paritytech/subxt/pull/394)) +- Remove bounds on Config trait that aren't strictly necessary ([#389](https://github.com/paritytech/subxt/pull/389)) +- add crunch to readme ([#388](https://github.com/paritytech/subxt/pull/388)) +- fix remote example ([#386](https://github.com/paritytech/subxt/pull/386)) +- fetch system chain, name and version ([#385](https://github.com/paritytech/subxt/pull/385)) +- Fix compact event field decoding ([#384](https://github.com/paritytech/subxt/pull/384)) +- fix: use index override when decoding enums in events ([#382](https://github.com/paritytech/subxt/pull/382)) +- Update to jsonrpsee 0.7 and impl Stream on TransactionProgress ([#380](https://github.com/paritytech/subxt/pull/380)) +- Add links to projects using subxt ([#376](https://github.com/paritytech/subxt/pull/376)) +- Use released substrate dependencies ([#375](https://github.com/paritytech/subxt/pull/375)) +- Configurable Config and Extra types ([#373](https://github.com/paritytech/subxt/pull/373)) +- Implement pre_dispatch for SignedExtensions ([#370](https://github.com/paritytech/subxt/pull/370)) +- Export TransactionEvents ([#363](https://github.com/paritytech/subxt/pull/363)) +- Rebuild test-runtime if substrate binary is updated ([#362](https://github.com/paritytech/subxt/pull/362)) +- Expand the subscribe_and_watch example ([#361](https://github.com/paritytech/subxt/pull/361)) +- Add TooManyConsumers variant to track latest sp-runtime addition ([#360](https://github.com/paritytech/subxt/pull/360)) +- Implement new API for sign_and_submit_then_watch ([#354](https://github.com/paritytech/subxt/pull/354)) +- Simpler dependencies ([#353](https://github.com/paritytech/subxt/pull/353)) +- Refactor type generation, remove code duplication ([#352](https://github.com/paritytech/subxt/pull/352)) +- Make system properties an arbitrary JSON object, plus CI fixes ([#349](https://github.com/paritytech/subxt/pull/349)) +- Fix a couple of CI niggles ([#344](https://github.com/paritytech/subxt/pull/344)) +- Add timestamp pallet test ([#340](https://github.com/paritytech/subxt/pull/340)) +- Add nightly CI check against latest substrate. ([#335](https://github.com/paritytech/subxt/pull/335)) +- Ensure metadata is in sync with running node during tests ([#333](https://github.com/paritytech/subxt/pull/333)) +- Update to jsonrpsee 0.5.1 ([#332](https://github.com/paritytech/subxt/pull/332)) +- Update substrate and hardcoded default ChargeAssetTxPayment extension ([#330](https://github.com/paritytech/subxt/pull/330)) +- codegen: fix compact unnamed fields ([#327](https://github.com/paritytech/subxt/pull/327)) +- Check docs and run clippy on PRs ([#326](https://github.com/paritytech/subxt/pull/326)) +- Additional parameters for SignedExtra ([#322](https://github.com/paritytech/subxt/pull/322)) +- fix: also processess initialize and finalize events in event subscription ([#321](https://github.com/paritytech/subxt/pull/321)) +- Release initial versions of subxt-codegen and subxt-cli ([#320](https://github.com/paritytech/subxt/pull/320)) +- Add some basic usage docs to README. ([#319](https://github.com/paritytech/subxt/pull/319)) +- Update jsonrpsee ([#317](https://github.com/paritytech/subxt/pull/317)) +- Add missing cargo metadata fields for new crates ([#311](https://github.com/paritytech/subxt/pull/311)) +- fix: keep processing a block's events after encountering a dispatch error ([#310](https://github.com/paritytech/subxt/pull/310)) +- Codegen: enum variant indices ([#308](https://github.com/paritytech/subxt/pull/308)) +- fix extrinsics retracted ([#307](https://github.com/paritytech/subxt/pull/307)) +- Add utility pallet tests ([#300](https://github.com/paritytech/subxt/pull/300)) +- fix metadata constants ([#299](https://github.com/paritytech/subxt/pull/299)) +- Generate runtime API from metadata ([#294](https://github.com/paritytech/subxt/pull/294)) +- Add NextKeys and QueuedKeys for session module ([#291](https://github.com/paritytech/subxt/pull/291)) +- deps: update jsonrpsee 0.3.0 ([#289](https://github.com/paritytech/subxt/pull/289)) +- deps: update jsonrpsee 0.2.0 ([#285](https://github.com/paritytech/subxt/pull/285)) +- deps: Reorg the order of deps ([#284](https://github.com/paritytech/subxt/pull/284)) +- Expose the rpc client in Client ([#267](https://github.com/paritytech/subxt/pull/267)) +- update jsonrpsee to 0.2.0-alpha.6 ([#266](https://github.com/paritytech/subxt/pull/266)) +- Remove funty pin, upgrade codec ([#265](https://github.com/paritytech/subxt/pull/265)) +- Use async-trait ([#264](https://github.com/paritytech/subxt/pull/264)) +- [jsonrpsee http client]: support tokio1 & tokio02. ([#263](https://github.com/paritytech/subxt/pull/263)) +- impl `From>` and `From>` ([#257](https://github.com/paritytech/subxt/pull/257)) +- update jsonrpsee ([#251](https://github.com/paritytech/subxt/pull/251)) +- return none if subscription returns early ([#250](https://github.com/paritytech/subxt/pull/250)) + ## [0.15.0] - 2021-03-15 ### Added diff --git a/Cargo.toml b/Cargo.toml index aa675e6163..b7cd6ca276 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,52 +1,12 @@ [workspace] -members = [".", "cli", "codegen", "macro", "test-runtime", "client"] -[package] -name = "subxt" -version = "0.15.0" -authors = ["Parity Technologies "] -edition = "2021" - -license = "GPL-3.0" -readme = "README.md" -repository = "https://github.com/paritytech/subxt" -documentation = "https://docs.rs/subxt" -homepage = "https://www.parity.io/" -description = "Submit extrinsics (transactions) to a substrate node via RPC" -keywords = ["parity", "substrate", "blockchain"] -include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] - -[dependencies] -async-trait = "0.1.49" -bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } -chameleon = "0.1.0" -scale-info = { version = "1.0.0", features = ["bit-vec"] } -futures = "0.3.13" -hex = "0.4.3" -jsonrpsee = { version = "0.7.0", features = ["macros", "async-client", "client-ws-transport"] } -log = "0.4.14" -num-traits = { version = "0.2.14", default-features = false } -serde = { version = "1.0.124", features = ["derive"] } -serde_json = "1.0.64" -thiserror = "1.0.24" - -subxt-macro = { version = "0.1.0", path = "macro" } - -sp-core = { git = "https://github.com/paritytech/substrate/", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate/", branch = "master", default-features = false } -sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/", branch = "master" } - -frame-metadata = "14.0.0" - -[dev-dependencies] -sp-arithmetic = { git = "https://github.com/paritytech/substrate/", branch = "master", default-features = false } -assert_matches = "1.5.0" -async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } -env_logger = "0.8.3" -tempdir = "0.3.7" -wabt = "0.10.0" -which = "4.0.2" -test-runtime = { path = "test-runtime" } - -sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "master" } +members = [ + "cli", + "codegen", + "examples", + "macro", + "subxt", + "test-runtime", + # TODO(niklasad1): remove to separate repo + "client" +] diff --git a/FILE_TEMPLATE b/FILE_TEMPLATE index 36c00e99b5..82b38f41f3 100644 --- a/FILE_TEMPLATE +++ b/FILE_TEMPLATE @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/README.md b/README.md index 976d8b848c..a5bafce790 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ A library to **sub**mit e**xt**rinsics to a [substrate](https://github.com/parit ## Usage +Take a look in the [examples](./examples/examples) folder for various `subxt` usage examples. + ### Downloading metadata from a Substrate node Use the [`subxt-cli`](./cli) tool to download the metadata for your target runtime from a node. @@ -26,7 +28,7 @@ a different node then the `metadata` command accepts a `--url` argument. ### Generating the runtime API from the downloaded metadata -Declare a module and decorate it with the `subxt` attribute which points at the downloaded metadata for the +Declare a module and decorate it with the `subxt` attribute which points at the downloaded metadata for the target runtime: ```rust @@ -34,20 +36,20 @@ target runtime: pub mod node_runtime { } ``` -**Important:** `runtime_metadata_path` resolves to a path relative to the directory where your crate's `Cargo.toml` +**Important:** `runtime_metadata_path` resolves to a path relative to the directory where your crate's `Cargo.toml` resides ([`CARGO_MANIFEST_DIR`](https://doc.rust-lang.org/cargo/reference/environment-variables.html)), *not* relative to the source file. ### Initializing the API client -API is still a work in progress. See [examples](./examples) for the current usage. +API is still a work in progress. See [examples](./examples/examples) for the current usage. ### Querying Storage -API is still a work in progress. See [tests](./tests/integration/frame) for the current usage. +API is still a work in progress. See [tests](./subxt/tests/integration/frame) for the current usage. ### Submitting Extrinsics -API is still a work in progress. See [examples](./examples/polkadot_balance_transfer.rs) for the current usage. +API is still a work in progress. See [examples](./examples/examples/polkadot_balance_transfer.rs) for the current usage. ## Integration Testing @@ -67,6 +69,8 @@ Please add your project to this list via a PR. - [cargo-contract](https://github.com/paritytech/cargo-contract/pull/79) CLI for interacting with Wasm smart contracts. - [xcm-cli](https://github.com/ascjones/xcm-cli) CLI for submitting XCM messages. - [phala-pherry](https://github.com/Phala-Network/phala-blockchain/tree/master/standalone/pherry) The relayer between Phala blockchain and the off-chain Secure workers. +- [crunch](https://github.com/turboflakes/crunch) CLI to claim staking rewards in batch every Era or X hours for substrate-based chains. +- [interbtc-clients](https://github.com/interlay/interbtc-clients) Client implementations for the interBTC parachain; notably the Vault / Relayer and Oracle. **Alternatives** diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000000..53ff0cf34d --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,76 @@ +# Release Checklist + +These steps assume that you've checked out the Subxt repository and are in the root directory of it. + +We also assume that ongoing work done is being merged directly to the `master` branch. + +1. Ensure that everything you'd like to see released is on the `master` branch. + +2. Create a release branch off `master`, for example `release-v0.17.0`. Decide how far the version needs to be bumped based + on the changes to date. If unsure what to bump the version to (e.g. is it a major, minor or patch release), check with the + Parity Tools team. + +3. Check that you're happy with the current documentation. + + ``` + cargo doc --open --all-features + ``` + + CI checks for broken internal links at the moment. Optionally you can also confirm that any external links + are still valid like so: + + ``` + cargo install cargo-deadlinks + cargo deadlinks --check-http -- --all-features + ``` + + If there are minor issues with the documentation, they can be fixed in the release branch. + +4. Bump the crate version in `Cargo.toml` to whatever was decided in step 2 for `subxt-codegen`, `subxt-macro`, `subxt` and `subxt-cli`. + +5. Update `CHANGELOG.md` to reflect the difference between this release and the last. If you're unsure of + what to add, check with the Tools team. See the `CHANGELOG.md` file for details of the format it follows. + + Any [closed PRs](https://github.com/paritytech/subxt/pulls?q=is%3Apr+is%3Aclosed) between the last release and + this release branch should be noted. + +6. Commit any of the above changes to the release branch and open a PR in GitHub with a base of `master`. + +7. Once the branch has been reviewed and passes CI, merge it. + +8. Now, we're ready to publish the release to crates.io. + + Checkout `master`, ensuring we're looking at that latest merge (`git pull`). + + The crates in this repository need publishing in a specific order, since they depend on each other. + Additionally, `subxt-macro` has a circular dev dependency on `subxt`, so we use `cargo hack` to remove + dev dependencies (and `--allow-dirty` to ignore the git changes as a result) to publish it. + + So, first install `cargo hack` with `cargo install cargo hack`. Next, you can run something like the following + command to publish each crate in the required order (allowing a little time inbetween each to let `crates.io` catch up) + with what we've published). + + ``` + (cd codegen && cargo publish) && \ + sleep 10 && \ + (cd macro && cargo hack publish --no-dev-deps --allow-dirty) && \ + sleep 10 && \ + (cd subxt && cargo publish) && \ + sleep 10 && \ + (cd cli && cargo publish); + ``` + + If you run into any issues regarding crates not being able to find suitable versions of other `subxt-*` crates, + you may just need to wait a little longer and then run the remaining portion of that command. + +9. If the release was successful, tag the commit that we released in the `master` branch with the + version that we just released, for example: + + ``` + git tag -s v0.17.0 # use the version number you've just published to crates.io, not this one + git push --tags + ``` + + Once this is pushed, go along to [the releases page on GitHub](https://github.com/paritytech/subxt/releases) + and draft a new release which points to the tag you just pushed to `master` above. Copy the changelog comments + for the current release into the release description. \ No newline at end of file diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b18f2397c0..3ad6e99bff 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subxt-cli" -version = "0.2.0" +version = "0.16.0" authors = ["Parity Technologies "] edition = "2021" @@ -16,7 +16,7 @@ path = "src/main.rs" [dependencies] # perform subxt codegen -subxt-codegen = { version = "0.2.0", path = "../codegen" } +subxt-codegen = { version = "0.16.0", path = "../codegen" } # parse command line args structopt = "0.3.25" # make the request to a substrate node to get the metadata @@ -36,4 +36,4 @@ scale = { package = "parity-scale-codec", version = "2.3.0", default-features = # handle urls to communicate with substrate nodes url = { version = "2.2.2", features = ["serde"] } # generate the item mod for codegen -syn = "1.0.80" \ No newline at end of file +syn = "1.0.80" diff --git a/cli/src/main.rs b/cli/src/main.rs index 44a7189eae..465755b573 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -33,6 +33,7 @@ use std::{ path::PathBuf, }; use structopt::StructOpt; +use subxt_codegen::GeneratedTypeDerives; /// Utilities for working with substrate metadata for subxt. #[derive(Debug, StructOpt)] @@ -70,6 +71,9 @@ enum Command { /// the path to the encoded metadata file. #[structopt(short, long, parse(from_os_str))] file: Option, + /// Additional derives + #[structopt(long = "derive")] + derives: Vec, }, } @@ -102,7 +106,7 @@ fn main() -> color_eyre::Result<()> { } } } - Command::Codegen { url, file } => { + Command::Codegen { url, file, derives } => { if let Some(file) = file.as_ref() { if url.is_some() { eyre::bail!("specify one of `--url` or `--file` but not both") @@ -111,7 +115,7 @@ fn main() -> color_eyre::Result<()> { let mut file = fs::File::open(file)?; let mut bytes = Vec::new(); file.read_to_end(&mut bytes)?; - codegen(&mut &bytes[..])?; + codegen(&mut &bytes[..], derives)?; return Ok(()) } @@ -119,7 +123,7 @@ fn main() -> color_eyre::Result<()> { url::Url::parse("http://localhost:9933").expect("default url is valid") }); let (_, bytes) = fetch_metadata(&url)?; - codegen(&mut &bytes[..])?; + codegen(&mut &bytes[..], derives)?; Ok(()) } } @@ -145,13 +149,24 @@ fn fetch_metadata(url: &url::Url) -> color_eyre::Result<(String, Vec)> { Ok((hex_data, bytes)) } -fn codegen(encoded: &mut I) -> color_eyre::Result<()> { +fn codegen( + encoded: &mut I, + raw_derives: Vec, +) -> color_eyre::Result<()> { let metadata = ::decode(encoded)?; let generator = subxt_codegen::RuntimeGenerator::new(metadata); let item_mod = syn::parse_quote!( pub mod api {} ); - let runtime_api = generator.generate_runtime(item_mod, Default::default()); + + let p = raw_derives + .iter() + .map(|raw| syn::parse_str(raw)) + .collect::, _>>()?; + let mut derives = GeneratedTypeDerives::default(); + derives.append(p.into_iter()); + + let runtime_api = generator.generate_runtime(item_mod, derives); println!("{}", runtime_api); Ok(()) } diff --git a/client/Cargo.toml b/client/Cargo.toml index a45b7ba7b0..f65193e37e 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["parity", "substrate", "blockchain"] [dependencies] async-std = { version = "1.8.0", features = ["tokio1"] } futures = "0.3.9" -jsonrpsee = { version = "0.7.0", features = ["async-client"] } +jsonrpsee = { version = "0.8.0", features = ["async-client"] } log = "0.4.13" thiserror = "1.0.23" serde_json = "1" @@ -27,7 +27,7 @@ sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "ma sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "master" } sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "master" } -tokio = { version = "1.10", features = ["rt-multi-thread"] } +tokio = { version = "1.16", features = ["rt-multi-thread"] } [target.'cfg(target_arch="x86_64")'.dependencies] sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false, features = [ @@ -36,9 +36,9 @@ sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "ma [dev-dependencies] async-std = { version = "1.8.0", features = ["attributes"] } -env_logger = "0.8.2" +env_logger = "0.9" tracing-subscriber = { version = "0.3.3", features = ["env-filter"] } node-cli = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } tempdir = "0.3.7" -subxt = { path = ".." } +subxt = { path = "../subxt" } test-runtime = { path = "../test-runtime" } diff --git a/client/src/tests.rs b/client/src/tests.rs index f407be22d9..218c99be5e 100644 --- a/client/src/tests.rs +++ b/client/src/tests.rs @@ -27,13 +27,10 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, PairSigner, + DefaultConfig, + DefaultExtra }; use tempdir::TempDir; -use test_runtime::node_runtime::{ - self, - system, - DefaultConfig, -}; #[async_std::test] pub async fn test_embedded_client() { @@ -74,12 +71,11 @@ pub async fn test_embedded_client() { let ext_client = ClientBuilder::new() .set_client(client) - .build::() + .build() .await .unwrap(); - let api: node_runtime::RuntimeApi = - ext_client.clone().to_runtime_api(); + let api: test_runtime::node_runtime::RuntimeApi> = ext_client.clone().to_runtime_api(); // verify that we can read storage api.storage() @@ -88,7 +84,7 @@ pub async fn test_embedded_client() { .await .unwrap(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::new(AccountKeyring::Alice.pair()); let bob_address = AccountKeyring::Bob.to_account_id().into(); // verify that we can call dispatchable functions @@ -106,5 +102,5 @@ pub async fn test_embedded_client() { panic!("{:?}", events); // verify that we receive events - //assert!(success); + // assert!(success); } diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index b5ac14fc5a..ea41458b7b 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subxt-codegen" -version = "0.2.0" +version = "0.16.0" authors = ["Parity Technologies "] edition = "2021" @@ -25,4 +25,4 @@ scale-info = { version = "1.0.0", features = ["bit-vec"] } [dev-dependencies] bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } -pretty_assertions = "0.6.1" +pretty_assertions = "1.0.0" diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index f0a0cc898c..96fc12fc9c 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,12 +14,18 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use crate::types::TypeGenerator; +use crate::types::{ + CompositeDefFields, + TypeGenerator, +}; use frame_metadata::{ PalletCallMetadata, PalletMetadata, }; -use heck::SnakeCase as _; +use heck::{ + CamelCase as _, + SnakeCase as _, +}; use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::abort_call_site; use quote::{ @@ -34,22 +40,38 @@ pub fn generate_calls( call: &PalletCallMetadata, types_mod_ident: &syn::Ident, ) -> TokenStream2 { - let struct_defs = - super::generate_structs_from_variants(type_gen, call.ty.id(), "Call"); + let struct_defs = super::generate_structs_from_variants( + type_gen, + call.ty.id(), + |name| name.to_camel_case().into(), + "Call", + ); let (call_structs, call_fns): (Vec<_>, Vec<_>) = struct_defs .iter() .map(|struct_def| { - let (call_fn_args, call_args): (Vec<_>, Vec<_>) = struct_def - .named_fields() - .unwrap_or_else(|| { - abort_call_site!( - "Call variant for type {} must have all named fields", - call.ty.id() - ) - }) - .iter() - .map(|(name, ty)| (quote!( #name: #ty ), name)) - .unzip(); + let (call_fn_args, call_args): (Vec<_>, Vec<_>) = + match struct_def.fields { + CompositeDefFields::Named(ref named_fields) => { + named_fields + .iter() + .map(|(name, field)| { + let fn_arg_type = &field.type_path; + let call_arg = if field.is_boxed() { + quote! { #name: ::std::boxed::Box::new(#name) } + } else { + quote! { #name } + }; + (quote!( #name: #fn_arg_type ), call_arg) + }) + .unzip() + } + CompositeDefFields::NoFields => Default::default(), + CompositeDefFields::Unnamed(_) => + abort_call_site!( + "Call variant for type {} must have all named fields", + call.ty.id() + ) + }; let pallet_name = &pallet.name; let call_struct_name = &struct_def.name; @@ -68,7 +90,7 @@ pub fn generate_calls( pub fn #fn_name( &self, #( #call_fn_args, )* - ) -> ::subxt::SubmittableExtrinsic<'a, T, #call_struct_name> { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, #call_struct_name, DispatchError> { let call = #call_struct_name { #( #call_args, )* }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -80,18 +102,24 @@ pub fn generate_calls( quote! { pub mod calls { use super::#types_mod_ident; + + type DispatchError = #types_mod_ident::sp_runtime::DispatchError; + #( #call_structs )* - pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { client, marker: ::core::marker::PhantomData } } #( #call_fns )* diff --git a/codegen/src/api/constants.rs b/codegen/src/api/constants.rs new file mode 100644 index 0000000000..7cbb988450 --- /dev/null +++ b/codegen/src/api/constants.rs @@ -0,0 +1,56 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::types::TypeGenerator; +use frame_metadata::PalletConstantMetadata; +use heck::SnakeCase as _; +use proc_macro2::TokenStream as TokenStream2; +use quote::{ + format_ident, + quote, +}; +use scale_info::form::PortableForm; + +pub fn generate_constants( + type_gen: &TypeGenerator, + constants: &[PalletConstantMetadata], + types_mod_ident: &syn::Ident, +) -> TokenStream2 { + let constant_fns = constants.iter().map(|constant| { + let fn_name = format_ident!("{}", constant.name.to_snake_case()); + let return_ty = type_gen.resolve_type_path(constant.ty.id(), &[]); + + let ref_slice = constant.value.as_slice(); + + quote! { + pub fn #fn_name(&self) -> ::core::result::Result<#return_ty, ::subxt::BasicError> { + Ok(::subxt::codec::Decode::decode(&mut &[#(#ref_slice,)*][..])?) + } + } + }); + + quote! { + pub mod constants { + use super::#types_mod_ident; + + pub struct ConstantsApi; + + impl ConstantsApi { + #(#constant_fns)* + } + } + } +} diff --git a/codegen/src/api/errors.rs b/codegen/src/api/errors.rs new file mode 100644 index 0000000000..e2034c7e2d --- /dev/null +++ b/codegen/src/api/errors.rs @@ -0,0 +1,162 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use frame_metadata::v14::RuntimeMetadataV14; +use proc_macro2::{ + Span as Span2, + TokenStream as TokenStream2, +}; +use quote::quote; + +/// Tokens which allow us to provide static error information in the generated output. +pub struct ErrorDetails { + /// This type definition will be used in the `dispatch_error_impl_fn` and is + /// expected to be generated somewhere in scope for that to be possible. + pub type_def: TokenStream2, + // A function which will live in an impl block for our `DispatchError`, + // to statically return details for known error types: + pub dispatch_error_impl_fn: TokenStream2, +} + +impl ErrorDetails { + fn emit_compile_error(err: &str) -> ErrorDetails { + let err_lit_str = syn::LitStr::new(err, Span2::call_site()); + ErrorDetails { + type_def: quote!(), + dispatch_error_impl_fn: quote!(compile_error!(#err_lit_str)), + } + } +} + +/// The purpose of this is to enumerate all of the possible `(module_index, error_index)` error +/// variants, so that we can convert `u8` error codes inside a generated `DispatchError` into +/// nicer error strings with documentation. To do this, we emit the type we'll return instances of, +/// and a function that returns such an instance for all of the error codes seen in the metadata. +pub fn generate_error_details(metadata: &RuntimeMetadataV14) -> ErrorDetails { + let errors = match pallet_errors(metadata) { + Ok(errors) => errors, + Err(e) => { + let err_string = + format!("Failed to generate error details from metadata: {}", e); + return ErrorDetails::emit_compile_error(&err_string) + } + }; + + let match_body_items = errors.into_iter().map(|err| { + let docs = err.docs; + let pallet_index = err.pallet_index; + let error_index = err.error_index; + let pallet_name = err.pallet; + let error_name = err.error; + + quote! { + (#pallet_index, #error_index) => Some(ErrorDetails { + pallet: #pallet_name, + error: #error_name, + docs: #docs + }) + } + }); + + ErrorDetails { + type_def: quote! { + pub struct ErrorDetails { + pub pallet: &'static str, + pub error: &'static str, + pub docs: &'static str, + } + }, + dispatch_error_impl_fn: quote! { + pub fn details(&self) -> Option { + if let Self::Module { index, error } = self { + match (index, error) { + #( #match_body_items ),*, + _ => None + } + } else { + None + } + } + }, + } +} + +fn pallet_errors( + metadata: &RuntimeMetadataV14, +) -> Result, InvalidMetadataError> { + let get_type_def_variant = |type_id: u32| { + let ty = metadata + .types + .resolve(type_id) + .ok_or(InvalidMetadataError::MissingType(type_id))?; + if let scale_info::TypeDef::Variant(var) = ty.type_def() { + Ok(var) + } else { + Err(InvalidMetadataError::TypeDefNotVariant(type_id)) + } + }; + + let mut pallet_errors = vec![]; + for pallet in &metadata.pallets { + let error = match &pallet.error { + Some(err) => err, + None => continue, + }; + + let type_def_variant = get_type_def_variant(error.ty.id())?; + for var in type_def_variant.variants().iter() { + pallet_errors.push(ErrorMetadata { + pallet_index: pallet.index, + error_index: var.index(), + pallet: pallet.name.clone(), + error: var.name().clone(), + docs: var.docs().join("\n"), + }); + } + } + + Ok(pallet_errors) +} + +/// Information about each error that we find in the metadata; +/// used to generate the static error information. +#[derive(Clone, Debug)] +struct ErrorMetadata { + pub pallet_index: u8, + pub error_index: u8, + pub pallet: String, + pub error: String, + pub docs: String, +} + +#[derive(Debug)] +enum InvalidMetadataError { + MissingType(u32), + TypeDefNotVariant(u32), +} + +impl std::fmt::Display for InvalidMetadataError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + InvalidMetadataError::MissingType(n) => { + write!(f, "Type {} missing from type registry", n) + } + InvalidMetadataError::TypeDefNotVariant(n) => { + write!(f, "Type {} was not a variant/enum type", n) + } + } + } +} diff --git a/codegen/src/api/events.rs b/codegen/src/api/events.rs index 2cfe804273..6c2389b52b 100644 --- a/codegen/src/api/events.rs +++ b/codegen/src/api/events.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -29,8 +29,12 @@ pub fn generate_events( event: &PalletEventMetadata, types_mod_ident: &syn::Ident, ) -> TokenStream2 { - let struct_defs = - super::generate_structs_from_variants(type_gen, event.ty.id(), "Event"); + let struct_defs = super::generate_structs_from_variants( + type_gen, + event.ty.id(), + |name| name.into(), + "Event", + ); let event_structs = struct_defs.iter().map(|struct_def| { let pallet_name = &pallet.name; let event_struct = &struct_def.name; diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index bc46d02745..d11071f156 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,21 +14,45 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +//! Generate code for submitting extrinsics and query storage of a Substrate runtime. +//! +//! ## Note +//! +//! By default the codegen will search for the `System` pallet's `Account` storage item, which is +//! the conventional location where an account's index (aka nonce) is stored. +//! +//! If this `System::Account` storage item is discovered, then it is assumed that: +//! +//! 1. The type of the storage item is a `struct` (aka a composite type) +//! 2. There exists a field called `nonce` which contains the account index. +//! +//! These assumptions are based on the fact that the `frame_system::AccountInfo` type is the default +//! configured type, and that the vast majority of chain configurations will use this. +//! +//! If either of these conditions are not satisfied, the codegen will fail. + mod calls; +mod constants; +mod errors; mod events; mod storage; use super::GeneratedTypeDerives; use crate::{ ir, - struct_def::StructDef, - types::TypeGenerator, + types::{ + CompositeDef, + CompositeDefFields, + TypeGenerator, + }, }; use codec::Decode; use frame_metadata::{ v14::RuntimeMetadataV14, + PalletMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, + StorageEntryType, }; use heck::SnakeCase as _; use proc_macro2::TokenStream as TokenStream2; @@ -37,6 +61,7 @@ use quote::{ format_ident, quote, }; +use scale_info::form::PortableForm; use std::{ collections::HashMap, fs, @@ -152,6 +177,7 @@ impl RuntimeGenerator { ) }) .collect::>(); + let modules = pallets_with_mod_names.iter().map(|(pallet, mod_name)| { let calls = if let Some(ref calls) = pallet.calls { calls::generate_calls(&type_gen, pallet, calls, types_mod_ident) @@ -171,12 +197,23 @@ impl RuntimeGenerator { quote!() }; + let constants_mod = if !pallet.constants.is_empty() { + constants::generate_constants( + &type_gen, + &pallet.constants, + types_mod_ident, + ) + } else { + quote!() + }; + quote! { pub mod #mod_name { use super::#types_mod_ident; #calls #event #storage_mod + #constants_mod } } }); @@ -202,6 +239,12 @@ impl RuntimeGenerator { }; let mod_ident = item_mod_ir.ident; + let pallets_with_constants = + pallets_with_mod_names + .iter() + .filter_map(|(pallet, pallet_mod_name)| { + (!pallet.constants.is_empty()).then(|| pallet_mod_name) + }); let pallets_with_storage = pallets_with_mod_names .iter() @@ -215,6 +258,20 @@ impl RuntimeGenerator { pallet.calls.as_ref().map(|_| pallet_mod_name) }); + let error_details = errors::generate_error_details(&self.metadata); + let error_type = error_details.type_def; + let error_fn = error_details.dispatch_error_impl_fn; + + let default_account_data_ident = format_ident!("DefaultAccountData"); + let default_account_data_impl = generate_default_account_data_impl( + &pallets_with_mod_names, + &default_account_data_ident, + &type_gen, + ); + let type_parameter_default_impl = default_account_data_impl + .as_ref() + .map(|_| quote!( = #default_account_data_ident )); + quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod #mod_ident { @@ -222,76 +279,70 @@ impl RuntimeGenerator { #( #modules )* #types_mod - /// Default configuration of common types for a target Substrate runtime. - #[derive(Clone, Debug, Default, Eq, PartialEq)] - pub struct DefaultConfig; + /// The default error type returned when there is a runtime issue. + pub type DispatchError = self::runtime_types::sp_runtime::DispatchError; - impl ::subxt::Config for DefaultConfig { - type Index = u32; - type BlockNumber = u32; - type Hash = ::subxt::sp_core::H256; - type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; - type AccountId = ::subxt::sp_runtime::AccountId32; - type Address = ::subxt::sp_runtime::MultiAddress; - type Header = ::subxt::sp_runtime::generic::Header< - Self::BlockNumber, ::subxt::sp_runtime::traits::BlakeTwo256 - >; - type Signature = ::subxt::sp_runtime::MultiSignature; - type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; + // Statically generate error information so that we don't need runtime metadata for it. + #error_type + impl DispatchError { + #error_fn } - impl ::subxt::ExtrinsicExtraData for DefaultConfig { - type AccountData = AccountData; - type Extra = ::subxt::DefaultExtra; - } + #default_account_data_impl - pub type AccountData = self::system::storage::Account; - - impl ::subxt::AccountData for AccountData { - fn nonce(result: &::Value) -> ::Index { - result.nonce - } - fn storage_entry(account_id: ::AccountId) -> Self { - Self(account_id) - } - } - - pub struct RuntimeApi> { + pub struct RuntimeApi { pub client: ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl ::core::convert::From<::subxt::Client> for RuntimeApi + impl ::core::convert::From<::subxt::Client> for RuntimeApi where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { fn from(client: ::subxt::Client) -> Self { - Self { client } + Self { client, marker: ::core::marker::PhantomData } } } - impl<'a, T> RuntimeApi + impl<'a, T, X, A> RuntimeApi where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { + pub fn constants(&'a self) -> ConstantsApi { + ConstantsApi + } + pub fn storage(&'a self) -> StorageApi<'a, T> { StorageApi { client: &self.client } } - pub fn tx(&'a self) -> TransactionApi<'a, T> { - TransactionApi { client: &self.client } + pub fn tx(&'a self) -> TransactionApi<'a, T, X, A> { + TransactionApi { client: &self.client, marker: ::core::marker::PhantomData } } } - pub struct StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + pub struct ConstantsApi; + + impl ConstantsApi { + #( + pub fn #pallets_with_constants(&self) -> #pallets_with_constants::constants::ConstantsApi { + #pallets_with_constants::constants::ConstantsApi + } + )* + } + + pub struct StorageApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } impl<'a, T> StorageApi<'a, T> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, { #( pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi<'a, T> { @@ -300,16 +351,19 @@ impl RuntimeGenerator { )* } - pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { #( - pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T> { + pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T, X, A> { #pallets_with_calls::calls::TransactionApi::new(self.client) } )* @@ -319,21 +373,99 @@ impl RuntimeGenerator { } } -pub fn generate_structs_from_variants( +/// Most chains require a valid account nonce as part of the extrinsic, so the default behaviour of +/// the client is to fetch the nonce for the current account. +/// +/// The account index (aka nonce) is commonly stored in the `System` pallet's `Account` storage item. +/// This function attempts to find that storage item, and if it is present will implement the +/// `subxt::AccountData` trait for it. This allows the client to construct the appropriate +/// storage key from the account id, and then retrieve the `nonce` from the resulting storage item. +fn generate_default_account_data_impl( + pallets_with_mod_names: &[(&PalletMetadata, syn::Ident)], + default_impl_name: &syn::Ident, type_gen: &TypeGenerator, +) -> Option { + let storage = pallets_with_mod_names + .iter() + .find(|(pallet, _)| pallet.name == "System") + .and_then(|(pallet, _)| pallet.storage.as_ref())?; + let storage_entry = storage + .entries + .iter() + .find(|entry| entry.name == "Account")?; + + // resolve the concrete types for `AccountId` (to build the key) and `Index` to extract the + // account index (nonce) value from the result. + let (account_id_ty, account_nonce_ty) = + if let StorageEntryType::Map { key, value, .. } = &storage_entry.ty { + let account_id_ty = type_gen.resolve_type_path(key.id(), &[]); + let account_data_ty = type_gen.resolve_type(value.id()); + let nonce_field = if let scale_info::TypeDef::Composite(composite) = + account_data_ty.type_def() + { + composite + .fields() + .iter() + .find(|f| f.name() == Some(&"nonce".to_string()))? + } else { + abort_call_site!("Expected a `nonce` field in the account info struct") + }; + let account_nonce_ty = type_gen.resolve_type_path(nonce_field.ty().id(), &[]); + (account_id_ty, account_nonce_ty) + } else { + abort_call_site!("System::Account should be a `StorageEntryType::Map`") + }; + + // this path to the storage entry depends on storage codegen. + let storage_entry_path = quote!(self::system::storage::Account); + + Some(quote! { + /// The default storage entry from which to fetch an account nonce, required for + /// constructing a transaction. + pub enum #default_impl_name {} + + impl ::subxt::AccountData for #default_impl_name { + type StorageEntry = #storage_entry_path; + type AccountId = #account_id_ty; + type Index = #account_nonce_ty; + + fn nonce(result: &::Value) -> Self::Index { + result.nonce + } + fn storage_entry(account_id: Self::AccountId) -> Self::StorageEntry { + #storage_entry_path(account_id) + } + } + }) +} + +pub fn generate_structs_from_variants<'a, F>( + type_gen: &'a TypeGenerator, type_id: u32, + variant_to_struct_name: F, error_message_type_name: &str, -) -> Vec { +) -> Vec +where + F: Fn(&str) -> std::borrow::Cow, +{ let ty = type_gen.resolve_type(type_id); if let scale_info::TypeDef::Variant(variant) = ty.type_def() { variant .variants() .iter() .map(|var| { - StructDef::new( - var.name(), + let struct_name = variant_to_struct_name(var.name()); + let fields = CompositeDefFields::from_scale_info_fields( + struct_name.as_ref(), var.fields(), - Some(syn::parse_quote!(pub)), + &[], + type_gen, + ); + CompositeDef::struct_def( + var.name(), + Default::default(), + fields, + Some(parse_quote!(pub)), type_gen, ) }) diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index 288909874d..6e2065c8a8 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -50,6 +50,7 @@ pub fn generate_storage( quote! { pub mod storage { use super::#types_mod_ident; + #( #storage_structs )* pub struct StorageApi<'a, T: ::subxt::Config> { @@ -119,7 +120,7 @@ fn generate_storage_entry_fns( fields.iter().map(|(_, field_type)| field_type); let field_names = fields.iter().map(|(field_name, _)| field_name); let entry_struct = quote! { - pub struct #entry_struct_ident( #( #tuple_struct_fields ),* ); + pub struct #entry_struct_ident( #( pub #tuple_struct_fields ),* ); }; let constructor = quote!( #entry_struct_ident( #( #field_names ),* ) ); @@ -195,7 +196,7 @@ fn generate_storage_entry_fns( pub async fn #fn_name_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, #entry_struct_ident>, ::subxt::Error> { + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, #entry_struct_ident>, ::subxt::BasicError> { self.client.storage().iter(hash).await } ) @@ -211,7 +212,7 @@ fn generate_storage_entry_fns( &self, #( #key_args, )* hash: ::core::option::Option, - ) -> ::core::result::Result<#return_ty, ::subxt::Error> { + ) -> ::core::result::Result<#return_ty, ::subxt::BasicError> { let entry = #constructor; self.client.storage().#fetch(&entry, hash).await } diff --git a/codegen/src/ir.rs b/codegen/src/ir.rs index 486d98ceb4..30faa92294 100644 --- a/codegen/src/ir.rs +++ b/codegen/src/ir.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -74,7 +74,6 @@ impl ItemMod { #[allow(clippy::large_enum_variant)] #[derive(Debug, PartialEq, Eq)] -#[allow(clippy::large_enum_variant)] pub enum Item { Rust(syn::Item), Subxt(SubxtItem), diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 7c65ecdf5a..e65dc26195 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -17,9 +17,7 @@ //! Library to generate an API for a Substrate runtime from its metadata. mod api; -mod derives; mod ir; -mod struct_def; mod types; pub use self::{ @@ -27,5 +25,5 @@ pub use self::{ generate_runtime_api, RuntimeGenerator, }, - derives::GeneratedTypeDerives, + types::GeneratedTypeDerives, }; diff --git a/codegen/src/struct_def.rs b/codegen/src/struct_def.rs deleted file mode 100644 index 1db6c02b13..0000000000 --- a/codegen/src/struct_def.rs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use super::GeneratedTypeDerives; -use crate::types::{ - TypeGenerator, - TypePath, -}; -use heck::CamelCase as _; -use proc_macro2::TokenStream as TokenStream2; -use proc_macro_error::abort_call_site; -use quote::{ - format_ident, - quote, -}; -use scale_info::form::PortableForm; - -#[derive(Debug)] -pub struct StructDef { - pub name: syn::Ident, - pub fields: StructDefFields, - pub field_visibility: Option, - pub derives: GeneratedTypeDerives, -} - -#[derive(Debug)] -pub enum StructDefFields { - Named(Vec<(syn::Ident, TypePath)>), - Unnamed(Vec), -} - -impl StructDef { - pub fn new( - ident: &str, - fields: &[scale_info::Field], - field_visibility: Option, - type_gen: &TypeGenerator, - ) -> Self { - let name = format_ident!("{}", ident.to_camel_case()); - let fields = fields - .iter() - .map(|field| { - let name = field.name().map(|f| format_ident!("{}", f)); - let ty = type_gen.resolve_type_path(field.ty().id(), &[]); - (name, ty) - }) - .collect::>(); - - let named = fields.iter().all(|(name, _)| name.is_some()); - let unnamed = fields.iter().all(|(name, _)| name.is_none()); - - let fields = if named { - StructDefFields::Named( - fields - .iter() - .map(|(name, field)| { - let name = name.as_ref().unwrap_or_else(|| { - abort_call_site!("All fields should have a name") - }); - (name.clone(), field.clone()) - }) - .collect(), - ) - } else if unnamed { - StructDefFields::Unnamed( - fields.iter().map(|(_, field)| field.clone()).collect(), - ) - } else { - abort_call_site!( - "Struct '{}': Fields should either be all named or all unnamed.", - name, - ) - }; - - let derives = type_gen.derives().clone(); - - Self { - name, - fields, - field_visibility, - derives, - } - } - - pub fn named_fields(&self) -> Option<&[(syn::Ident, TypePath)]> { - if let StructDefFields::Named(ref fields) = self.fields { - Some(fields) - } else { - None - } - } -} - -impl quote::ToTokens for StructDef { - fn to_tokens(&self, tokens: &mut TokenStream2) { - let visibility = &self.field_visibility; - let derives = &self.derives; - tokens.extend(match self.fields { - StructDefFields::Named(ref named_fields) => { - let fields = named_fields.iter().map(|(name, ty)| { - let compact_attr = - ty.is_compact().then(|| quote!( #[codec(compact)] )); - quote! { #compact_attr #visibility #name: #ty } - }); - let name = &self.name; - quote! { - #derives - pub struct #name { - #( #fields ),* - } - } - } - StructDefFields::Unnamed(ref unnamed_fields) => { - let fields = unnamed_fields.iter().map(|ty| { - let compact_attr = - ty.is_compact().then(|| quote!( #[codec(compact)] )); - quote! { #compact_attr #visibility #ty } - }); - let name = &self.name; - quote! { - #derives - pub struct #name ( - #( #fields ),* - ); - } - } - }) - } -} diff --git a/codegen/src/types/composite_def.rs b/codegen/src/types/composite_def.rs new file mode 100644 index 0000000000..86d1aa31a4 --- /dev/null +++ b/codegen/src/types/composite_def.rs @@ -0,0 +1,345 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use super::{ + Field, + GeneratedTypeDerives, + TypeDefParameters, + TypeGenerator, + TypeParameter, + TypePath, +}; +use proc_macro2::TokenStream; +use proc_macro_error::abort_call_site; +use quote::{ + format_ident, + quote, +}; +use scale_info::{ + TypeDef, + TypeDefPrimitive, +}; + +/// Representation of a type which consists of a set of fields. Used to generate Rust code for +/// either a standalone `struct` definition, or an `enum` variant. +/// +/// Fields can either be named or unnamed in either case. +#[derive(Debug)] +pub struct CompositeDef { + /// The name of the `struct`, or the name of the `enum` variant. + pub name: syn::Ident, + /// Generate either a standalone `struct` or an `enum` variant. + pub kind: CompositeDefKind, + /// The fields of the type, which are either all named or all unnamed. + pub fields: CompositeDefFields, +} + +impl CompositeDef { + /// Construct a definition which will generate code for a standalone `struct`. + pub fn struct_def( + ident: &str, + type_params: TypeDefParameters, + fields_def: CompositeDefFields, + field_visibility: Option, + type_gen: &TypeGenerator, + ) -> Self { + let mut derives = type_gen.derives().clone(); + let fields: Vec<_> = fields_def.field_types().collect(); + + if fields.len() == 1 { + // any single field wrapper struct with a concrete unsigned int type can derive + // CompactAs. + let field = &fields[0]; + if !type_params + .params() + .iter() + .any(|tp| Some(tp.original_name.to_string()) == field.type_name) + { + let ty = type_gen.resolve_type(field.type_id); + if matches!( + ty.type_def(), + TypeDef::Primitive( + TypeDefPrimitive::U8 + | TypeDefPrimitive::U16 + | TypeDefPrimitive::U32 + | TypeDefPrimitive::U64 + | TypeDefPrimitive::U128 + ) + ) { + derives.push_codec_compact_as() + } + } + } + + let name = format_ident!("{}", ident); + + Self { + name, + kind: CompositeDefKind::Struct { + derives, + type_params, + field_visibility, + }, + fields: fields_def, + } + } + + /// Construct a definition which will generate code for an `enum` variant. + pub fn enum_variant_def(ident: &str, fields: CompositeDefFields) -> Self { + let name = format_ident!("{}", ident); + Self { + name, + kind: CompositeDefKind::EnumVariant, + fields, + } + } +} + +impl quote::ToTokens for CompositeDef { + fn to_tokens(&self, tokens: &mut TokenStream) { + let name = &self.name; + + let decl = match &self.kind { + CompositeDefKind::Struct { + derives, + type_params, + field_visibility, + } => { + let phantom_data = type_params.unused_params_phantom_data(); + let fields = self + .fields + .to_struct_field_tokens(phantom_data, field_visibility.as_ref()); + let trailing_semicolon = matches!( + self.fields, + CompositeDefFields::NoFields | CompositeDefFields::Unnamed(_) + ) + .then(|| quote!(;)); + + quote! { + #derives + pub struct #name #type_params #fields #trailing_semicolon + } + } + CompositeDefKind::EnumVariant => { + let fields = self.fields.to_enum_variant_field_tokens(); + + quote! { + #name #fields + } + } + }; + tokens.extend(decl) + } +} + +/// Which kind of composite type are we generating, either a standalone `struct` or an `enum` +/// variant. +#[derive(Debug)] +pub enum CompositeDefKind { + /// Composite type comprising a Rust `struct`. + Struct { + derives: GeneratedTypeDerives, + type_params: TypeDefParameters, + field_visibility: Option, + }, + /// Comprises a variant of a Rust `enum`. + EnumVariant, +} + +/// Encapsulates the composite fields, keeping the invariant that all fields are either named or +/// unnamed. +#[derive(Debug)] +pub enum CompositeDefFields { + NoFields, + Named(Vec<(syn::Ident, CompositeDefFieldType)>), + Unnamed(Vec), +} + +impl CompositeDefFields { + /// Construct a new set of composite fields from the supplied [`::scale_info::Field`]s. + pub fn from_scale_info_fields( + name: &str, + fields: &[Field], + parent_type_params: &[TypeParameter], + type_gen: &TypeGenerator, + ) -> Self { + if fields.is_empty() { + return Self::NoFields + } + + let mut named_fields = Vec::new(); + let mut unnamed_fields = Vec::new(); + + for field in fields { + let type_path = + type_gen.resolve_type_path(field.ty().id(), parent_type_params); + let field_type = CompositeDefFieldType::new( + field.ty().id(), + type_path, + field.type_name().cloned(), + ); + + if let Some(name) = field.name() { + let field_name = format_ident!("{}", name); + named_fields.push((field_name, field_type)) + } else { + unnamed_fields.push(field_type) + } + } + + if !named_fields.is_empty() && !unnamed_fields.is_empty() { + abort_call_site!( + "'{}': Fields should either be all named or all unnamed.", + name, + ) + } + + if !named_fields.is_empty() { + Self::Named(named_fields) + } else { + Self::Unnamed(unnamed_fields) + } + } + + /// Returns the set of composite fields. + pub fn field_types(&self) -> Box + '_> { + match self { + Self::NoFields => Box::new([].iter()), + Self::Named(named_fields) => Box::new(named_fields.iter().map(|(_, f)| f)), + Self::Unnamed(unnamed_fields) => Box::new(unnamed_fields.iter()), + } + } + + /// Generate the code for fields which will compose a `struct`. + pub fn to_struct_field_tokens( + &self, + phantom_data: Option, + visibility: Option<&syn::Visibility>, + ) -> TokenStream { + match self { + Self::NoFields => { + if let Some(phantom_data) = phantom_data { + quote! { ( #phantom_data ) } + } else { + quote! {} + } + } + Self::Named(ref fields) => { + let fields = fields.iter().map(|(name, ty)| { + let compact_attr = ty.compact_attr(); + quote! { #compact_attr #visibility #name: #ty } + }); + let marker = phantom_data.map(|phantom_data| { + quote!( + #[codec(skip)] + #visibility __subxt_unused_type_params: #phantom_data + ) + }); + quote!( + { + #( #fields, )* + #marker + } + ) + } + Self::Unnamed(ref fields) => { + let fields = fields.iter().map(|ty| { + let compact_attr = ty.compact_attr(); + quote! { #compact_attr #visibility #ty } + }); + let marker = phantom_data.map(|phantom_data| { + quote!( + #[codec(skip)] + #visibility #phantom_data + ) + }); + quote! { + ( + #( #fields, )* + #marker + ) + } + } + } + } + + /// Generate the code for fields which will compose an `enum` variant. + pub fn to_enum_variant_field_tokens(&self) -> TokenStream { + match self { + Self::NoFields => quote! {}, + Self::Named(ref fields) => { + let fields = fields.iter().map(|(name, ty)| { + let compact_attr = ty.compact_attr(); + quote! { #compact_attr #name: #ty } + }); + quote!( { #( #fields, )* } ) + } + Self::Unnamed(ref fields) => { + let fields = fields.iter().map(|ty| { + let compact_attr = ty.compact_attr(); + quote! { #compact_attr #ty } + }); + quote! { ( #( #fields, )* ) } + } + } + } +} + +/// Represents a field of a composite type to be generated. +#[derive(Debug)] +pub struct CompositeDefFieldType { + pub type_id: u32, + pub type_path: TypePath, + pub type_name: Option, +} + +impl CompositeDefFieldType { + /// Construct a new [`CompositeDefFieldType`]. + pub fn new(type_id: u32, type_path: TypePath, type_name: Option) -> Self { + CompositeDefFieldType { + type_id, + type_path, + type_name, + } + } + + /// Returns `true` if the field is a [`::std::boxed::Box`]. + pub fn is_boxed(&self) -> bool { + // Use the type name to detect a `Box` field. + // Should be updated once `Box` types are no longer erased: + // https://github.com/paritytech/scale-info/pull/82 + matches!(&self.type_name, Some(ty_name) if ty_name.contains("Box<")) + } + + /// Returns the `#[codec(compact)]` attribute if the type is compact. + fn compact_attr(&self) -> Option { + self.type_path + .is_compact() + .then(|| quote!( #[codec(compact)] )) + } +} + +impl quote::ToTokens for CompositeDefFieldType { + fn to_tokens(&self, tokens: &mut TokenStream) { + let ty_path = &self.type_path; + + if self.is_boxed() { + tokens.extend(quote! { ::std::boxed::Box<#ty_path> }) + } else { + tokens.extend(quote! { #ty_path }) + }; + } +} diff --git a/codegen/src/derives.rs b/codegen/src/types/derives.rs similarity index 70% rename from codegen/src/derives.rs rename to codegen/src/types/derives.rs index a27319b923..db09aade91 100644 --- a/codegen/src/derives.rs +++ b/codegen/src/types/derives.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,7 +14,10 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use syn::punctuated::Punctuated; +use syn::{ + parse_quote, + punctuated::Punctuated, +}; #[derive(Debug, Clone)] pub struct GeneratedTypeDerives { @@ -26,11 +29,20 @@ impl GeneratedTypeDerives { Self { derives } } + /// Add `::subxt::codec::CompactAs` to the derives. + pub fn push_codec_compact_as(&mut self) { + self.derives.push(parse_quote!(::subxt::codec::CompactAs)); + } + pub fn append(&mut self, derives: impl Iterator) { for derive in derives { self.derives.push(derive) } } + + pub fn push(&mut self, derive: syn::Path) { + self.derives.push(derive); + } } impl Default for GeneratedTypeDerives { @@ -38,15 +50,18 @@ impl Default for GeneratedTypeDerives { let mut derives = Punctuated::new(); derives.push(syn::parse_quote!(::subxt::codec::Encode)); derives.push(syn::parse_quote!(::subxt::codec::Decode)); + derives.push(syn::parse_quote!(Debug)); Self::new(derives) } } impl quote::ToTokens for GeneratedTypeDerives { fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { - let derives = &self.derives; - tokens.extend(quote::quote! { - #[derive(#derives)] - }) + if !self.derives.is_empty() { + let derives = &self.derives; + tokens.extend(quote::quote! { + #[derive(#derives)] + }) + } } } diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index 73b8b9d062..b6972bdc7f 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,12 +14,14 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +mod composite_def; +mod derives; #[cfg(test)] mod tests; mod type_def; +mod type_def_params; mod type_path; -use super::GeneratedTypeDerives; use proc_macro2::{ Ident, Span, @@ -41,7 +43,14 @@ use std::collections::{ }; pub use self::{ + composite_def::{ + CompositeDef, + CompositeDefFieldType, + CompositeDefFields, + }, + derives::GeneratedTypeDerives, type_def::TypeDefGen, + type_def_params::TypeDefParameters, type_path::{ TypeParameter, TypePath, @@ -50,6 +59,8 @@ pub use self::{ }, }; +pub type Field = scale_info::Field; + /// Generate a Rust module containing all types defined in the supplied [`PortableRegistry`]. #[derive(Debug)] pub struct TypeGenerator<'a> { @@ -126,7 +137,7 @@ impl<'a> TypeGenerator<'a> { if path.len() == 1 { child_mod .types - .insert(ty.path().clone(), TypeDefGen { ty, type_gen: self }); + .insert(ty.path().clone(), TypeDefGen::from_type(ty, self)); } else { self.insert_type(ty, id, path[1..].to_vec(), root_mod_ident, child_mod) } diff --git a/codegen/src/types/tests.rs b/codegen/src/types/tests.rs index 21364f429e..639ce2a949 100644 --- a/codegen/src/types/tests.rs +++ b/codegen/src/types/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -64,7 +64,7 @@ fn generate_struct_with_primitives() { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { pub a: ::core::primitive::bool, pub b: ::core::primitive::u32, @@ -110,12 +110,12 @@ fn generate_struct_with_a_struct_field() { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Child { pub a: ::core::primitive::i32, } - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Parent { pub a: ::core::primitive::bool, pub b: root::subxt_codegen::types::tests::Child, @@ -155,10 +155,10 @@ fn generate_tuple_struct() { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Child(pub ::core::primitive::i32,); - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Parent(pub ::core::primitive::bool, pub root::subxt_codegen::types::tests::Child,); } } @@ -237,44 +237,34 @@ fn derive_compact_as_for_uint_wrapper_structs() { pub mod tests { use super::root; - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct Su128 { pub a: ::core::primitive::u128, } - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct Su16 { pub a: ::core::primitive::u16, } - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct Su32 { pub a: ::core::primitive::u32, } - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct Su64 { pub a: ::core::primitive::u64, } - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct Su8 { pub a: ::core::primitive::u8, } - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct TSu128(pub ::core::primitive::u128,); - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct TSu16(pub ::core::primitive::u16,); - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct TSu32(pub ::core::primitive::u32,); - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct TSu64(pub ::core::primitive::u64,); - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct TSu8(pub ::core::primitive::u8,); } } @@ -310,7 +300,7 @@ fn generate_enum() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub enum E { # [codec (index = 0)] A, @@ -368,7 +358,7 @@ fn compact_fields() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub enum E { # [codec (index = 0)] A { @@ -379,12 +369,12 @@ fn compact_fields() { B( #[codec(compact)] ::core::primitive::u32,), } - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { #[codec(compact)] pub a: ::core::primitive::u32, } - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct TupleStruct(#[codec(compact)] pub ::core::primitive::u32,); } } @@ -418,7 +408,7 @@ fn generate_array_field() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { pub a: [::core::primitive::u8; 32usize], } @@ -455,7 +445,7 @@ fn option_fields() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { pub a: ::core::option::Option<::core::primitive::bool>, pub b: ::core::option::Option<::core::primitive::u32>, @@ -495,7 +485,7 @@ fn box_fields_struct() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { pub a: ::std::boxed::Box<::core::primitive::bool>, pub b: ::std::boxed::Box<::core::primitive::u32>, @@ -535,7 +525,7 @@ fn box_fields_enum() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub enum E { # [codec (index = 0)] A(::std::boxed::Box<::core::primitive::bool>,), @@ -575,7 +565,7 @@ fn range_fields() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { pub a: ::core::ops::Range<::core::primitive::u32>, pub b: ::core::ops::RangeInclusive<::core::primitive::u32>, @@ -619,12 +609,12 @@ fn generics() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Bar { pub b: root::subxt_codegen::types::tests::Foo<::core::primitive::u32>, pub c: root::subxt_codegen::types::tests::Foo<::core::primitive::u8>, } - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Foo<_0> { pub a: _0, } @@ -667,12 +657,12 @@ fn generics_nested() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Bar<_0> { pub b: root::subxt_codegen::types::tests::Foo<_0, ::core::primitive::u32>, } - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Foo<_0, _1> { pub a: _0, pub b: ::core::option::Option<(_0, _1,)>, @@ -718,7 +708,7 @@ fn generate_bitvec() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { pub lsb: ::subxt::bitvec::vec::BitVec, pub msb: ::subxt::bitvec::vec::BitVec, @@ -771,16 +761,15 @@ fn generics_with_alias_adds_phantom_data_marker() { quote! { pub mod tests { use super::root; - #[derive(::subxt::codec::CompactAs)] - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug, ::subxt::codec::CompactAs)] pub struct NamedFields<_0> { pub b: ::core::primitive::u32, - #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, + #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0> } - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct UnnamedFields<_0, _1> ( pub (::core::primitive::u32, ::core::primitive::u32,), - #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)>, + #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)> ); } } @@ -794,7 +783,7 @@ fn modules() { pub mod a { #[allow(unused)] #[derive(scale_info::TypeInfo)] - pub struct Foo {} + pub struct Foo; pub mod b { #[allow(unused)] @@ -840,20 +829,20 @@ fn modules() { pub mod b { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Bar { pub a: root::subxt_codegen::types::tests::m::a::Foo, } } - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Foo {} + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] + pub struct Foo; } pub mod c { use super::root; - #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct Foo { pub a: root::subxt_codegen::types::tests::m::a::b::Bar, } @@ -864,3 +853,36 @@ fn modules() { .to_string() ) } + +#[test] +fn dont_force_struct_names_camel_case() { + #[allow(unused)] + #[derive(TypeInfo)] + struct AB; + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] + pub struct AB; + } + } + .to_string() + ) +} diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs index 2ebd6351ff..87b9f6c96f 100644 --- a/codegen/src/types/type_def.rs +++ b/codegen/src/types/type_def.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -15,9 +15,12 @@ // along with subxt. If not, see . use super::{ + CompositeDef, + CompositeDefFields, + GeneratedTypeDerives, + TypeDefParameters, TypeGenerator, TypeParameter, - TypePath, }; use proc_macro2::TokenStream; use quote::{ @@ -26,12 +29,9 @@ use quote::{ }; use scale_info::{ form::PortableForm, - Field, Type, TypeDef, - TypeDefPrimitive, }; -use std::collections::HashSet; use syn::parse_quote; /// Generates a Rust `struct` or `enum` definition based on the supplied [`scale-info::Type`]. @@ -40,17 +40,20 @@ use syn::parse_quote; /// generated types in the module. #[derive(Debug)] pub struct TypeDefGen<'a> { - /// The type generation context, allows resolving of type paths for the fields of the - /// generated type. - pub(super) type_gen: &'a TypeGenerator<'a>, - /// Contains the definition of the type to be generated. - pub(super) ty: Type, + /// The type parameters of the type to be generated + type_params: TypeDefParameters, + /// The derives with which to annotate the generated type. + derives: &'a GeneratedTypeDerives, + /// The kind of type to be generated. + ty_kind: TypeDefGenKind, } -impl<'a> quote::ToTokens for TypeDefGen<'a> { - fn to_tokens(&self, tokens: &mut TokenStream) { - let type_params = self - .ty +impl<'a> TypeDefGen<'a> { + /// Construct a type definition for codegen from the given [`scale_info::Type`]. + pub fn from_type(ty: Type, type_gen: &'a TypeGenerator) -> Self { + let derives = type_gen.derives(); + + let type_params = ty .type_params() .iter() .enumerate() @@ -60,6 +63,7 @@ impl<'a> quote::ToTokens for TypeDefGen<'a> { let tp_name = format_ident!("_{}", i); Some(TypeParameter { concrete_type_id: ty.id(), + original_name: tp.name().clone(), name: tp_name, }) } @@ -68,267 +72,100 @@ impl<'a> quote::ToTokens for TypeDefGen<'a> { }) .collect::>(); - let type_name = self.ty.path().ident().map(|ident| { - let type_params = if !type_params.is_empty() { - quote! { < #( #type_params ),* > } - } else { - quote! {} - }; - let ty = format_ident!("{}", ident); - let path = parse_quote! { #ty #type_params}; - syn::Type::Path(path) - }); + let mut type_params = TypeDefParameters::new(type_params); - let derives = self.type_gen.derives(); - - match self.ty.type_def() { + let ty_kind = match ty.type_def() { TypeDef::Composite(composite) => { - let type_name = type_name.expect("structs should have a name"); - let (fields, _) = - self.composite_fields(composite.fields(), &type_params, true); - let derive_as_compact = if composite.fields().len() == 1 { - // any single field wrapper struct with a concrete unsigned int type can derive - // CompactAs. - let field = &composite.fields()[0]; - if !self - .ty - .type_params() - .iter() - .any(|tp| Some(tp.name()) == field.type_name()) - { - let ty = self.type_gen.resolve_type(field.ty().id()); - if matches!( - ty.type_def(), - TypeDef::Primitive( - TypeDefPrimitive::U8 - | TypeDefPrimitive::U16 - | TypeDefPrimitive::U32 - | TypeDefPrimitive::U64 - | TypeDefPrimitive::U128 - ) - ) { - Some(quote!( #[derive(::subxt::codec::CompactAs)] )) - } else { - None - } - } else { - None - } - } else { - None - }; - - let ty_toks = quote! { - #derive_as_compact - #derives - pub struct #type_name #fields - }; - tokens.extend(ty_toks); + let type_name = ty.path().ident().expect("structs should have a name"); + let fields = CompositeDefFields::from_scale_info_fields( + &type_name, + composite.fields(), + type_params.params(), + type_gen, + ); + type_params.update_unused(fields.field_types()); + let composite_def = CompositeDef::struct_def( + &type_name, + type_params.clone(), + fields, + Some(parse_quote!(pub)), + type_gen, + ); + TypeDefGenKind::Struct(composite_def) } TypeDef::Variant(variant) => { - let type_name = type_name.expect("variants should have a name"); - let mut variants = Vec::new(); - let mut used_type_params = HashSet::new(); - let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); + let type_name = ty.path().ident().expect("variants should have a name"); + let variants = variant + .variants() + .iter() + .map(|v| { + let fields = CompositeDefFields::from_scale_info_fields( + v.name(), + v.fields(), + type_params.params(), + type_gen, + ); + type_params.update_unused(fields.field_types()); + let variant_def = + CompositeDef::enum_variant_def(v.name(), fields); + (v.index(), variant_def) + }) + .collect(); - for v in variant.variants() { - let variant_name = format_ident!("{}", v.name()); - let (fields, unused_type_params) = if v.fields().is_empty() { - let unused = type_params_set.iter().cloned().collect::>(); - (quote! {}, unused) - } else { - self.composite_fields(v.fields(), &type_params, false) - }; - let index = proc_macro2::Literal::u8_unsuffixed(v.index()); - variants.push(quote! { - #[codec(index = #index)] - #variant_name #fields - }); - let unused_params_set = unused_type_params.iter().cloned().collect(); - let used_params = type_params_set.difference(&unused_params_set); + TypeDefGenKind::Enum(type_name, variants) + } + _ => TypeDefGenKind::BuiltIn, + }; - for used_param in used_params { - used_type_params.insert(used_param.clone()); - } - } + Self { + type_params, + derives, + ty_kind, + } + } +} - let unused_type_params = type_params_set - .difference(&used_type_params) - .cloned() +impl<'a> quote::ToTokens for TypeDefGen<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + match &self.ty_kind { + TypeDefGenKind::Struct(composite) => composite.to_tokens(tokens), + TypeDefGenKind::Enum(type_name, variants) => { + let mut variants = variants + .iter() + .map(|(index, def)| { + let index = proc_macro2::Literal::u8_unsuffixed(*index); + quote! { + #[codec(index = #index)] + #def + } + }) .collect::>(); - if !unused_type_params.is_empty() { - let phantom = Self::phantom_data(&unused_type_params); + + if let Some(phantom) = self.type_params.unused_params_phantom_data() { variants.push(quote! { __Ignore(#phantom) }) } + let enum_ident = format_ident!("{}", type_name); + let type_params = &self.type_params; + let derives = self.derives; let ty_toks = quote! { #derives - pub enum #type_name { + pub enum #enum_ident #type_params { #( #variants, )* } }; tokens.extend(ty_toks); } - _ => (), // all built-in types should already be in scope + TypeDefGenKind::BuiltIn => (), /* all built-in types should already be in scope */ } } } -impl<'a> TypeDefGen<'a> { - fn composite_fields( - &self, - fields: &'a [Field], - type_params: &'a [TypeParameter], - is_struct: bool, - ) -> (TokenStream, Vec) { - let named = fields.iter().all(|f| f.name().is_some()); - let unnamed = fields.iter().all(|f| f.name().is_none()); - - fn unused_type_params<'a>( - type_params: &'a [TypeParameter], - types: impl Iterator, - ) -> Vec { - let mut used_type_params = HashSet::new(); - for ty in types { - ty.parent_type_params(&mut used_type_params) - } - let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); - let mut unused = type_params_set - .difference(&used_type_params) - .cloned() - .collect::>(); - unused.sort(); - unused - } - - let ty_toks = |ty_name: &str, ty_path: &TypePath| { - if ty_name.contains("Box<") { - quote! { ::std::boxed::Box<#ty_path> } - } else { - quote! { #ty_path } - } - }; - - if named { - let fields = fields - .iter() - .map(|field| { - let name = format_ident!( - "{}", - field.name().expect("named field without a name") - ); - let ty = self - .type_gen - .resolve_type_path(field.ty().id(), type_params); - (name, ty, field.type_name()) - }) - .collect::>(); - - let mut fields_tokens = fields - .iter() - .map(|(name, ty, ty_name)| { - let field_type = match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! ( pub #name: #ty ) - } else { - quote! ( #name: #ty ) - } - } - None => { - quote! ( #name: #ty ) - } - }; - if ty.is_compact() { - quote!( #[codec(compact)] #field_type ) - } else { - quote!( #field_type ) - } - }) - .collect::>(); - - let unused_params = - unused_type_params(type_params, fields.iter().map(|(_, ty, _)| ty)); - - if is_struct && !unused_params.is_empty() { - let phantom = Self::phantom_data(&unused_params); - fields_tokens.push(quote! { - #[codec(skip)] pub __subxt_unused_type_params: #phantom - }) - } - - let fields = quote! { - { - #( #fields_tokens, )* - } - }; - (fields, unused_params) - } else if unnamed { - let type_paths = fields - .iter() - .map(|field| { - let ty = self - .type_gen - .resolve_type_path(field.ty().id(), type_params); - (ty, field.type_name()) - }) - .collect::>(); - let mut fields_tokens = type_paths - .iter() - .map(|(ty, ty_name)| { - let field_type = match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! { pub #ty } - } else { - quote! { #ty } - } - } - None => { - quote! { #ty } - } - }; - if ty.is_compact() { - quote!( #[codec(compact)] #field_type ) - } else { - quote!( #field_type ) - } - }) - .collect::>(); - - let unused_params = - unused_type_params(type_params, type_paths.iter().map(|(ty, _)| ty)); - - if is_struct && !unused_params.is_empty() { - let phantom_data = Self::phantom_data(&unused_params); - fields_tokens.push(quote! { #[codec(skip)] pub #phantom_data }) - } - - let fields = quote! { ( #( #fields_tokens, )* ) }; - let fields_tokens = if is_struct { - // add a semicolon for tuple structs - quote! { #fields; } - } else { - fields - }; - - (fields_tokens, unused_params) - } else { - panic!("Fields must be either all named or all unnamed") - } - } - - fn phantom_data(params: &[TypeParameter]) -> TokenStream { - let params = if params.len() == 1 { - let param = ¶ms[0]; - quote! { #param } - } else { - quote! { ( #( #params ), * ) } - }; - quote! ( ::core::marker::PhantomData<#params> ) - } +#[derive(Debug)] +pub enum TypeDefGenKind { + Struct(CompositeDef), + Enum(String, Vec<(u8, CompositeDef)>), + BuiltIn, } diff --git a/codegen/src/types/type_def_params.rs b/codegen/src/types/type_def_params.rs new file mode 100644 index 0000000000..c5508865b0 --- /dev/null +++ b/codegen/src/types/type_def_params.rs @@ -0,0 +1,87 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use super::TypeParameter; +use crate::types::CompositeDefFieldType; +use quote::quote; +use std::collections::BTreeSet; + +/// Represents the set of generic type parameters for generating a type definition e.g. the `T` in +/// `Foo`. +/// +/// Additionally this allows generating a `PhantomData` type for any type params which are unused +/// in the type definition itself. +#[derive(Clone, Debug, Default)] +pub struct TypeDefParameters { + params: Vec, + unused: BTreeSet, +} + +impl TypeDefParameters { + /// Create a new [`TypeDefParameters`] instance. + pub fn new(params: Vec) -> Self { + let unused = params.iter().cloned().collect(); + Self { params, unused } + } + + /// Update the set of unused type parameters by removing those that are used in the given + /// fields. + pub fn update_unused<'a>( + &mut self, + fields: impl Iterator, + ) { + let mut used_type_params = BTreeSet::new(); + for field in fields { + field.type_path.parent_type_params(&mut used_type_params) + } + for used_type_param in &used_type_params { + self.unused.remove(used_type_param); + } + } + + /// Construct a [`core::marker::PhantomData`] for the type unused type params. + pub fn unused_params_phantom_data(&self) -> Option { + if self.unused.is_empty() { + return None + } + let params = if self.unused.len() == 1 { + let param = self + .unused + .iter() + .next() + .expect("Checked for exactly one unused param"); + quote! { #param } + } else { + let params = self.unused.iter(); + quote! { ( #( #params ), * ) } + }; + Some(syn::parse_quote! { ::core::marker::PhantomData<#params> }) + } + + /// Returns the set of type parameters. + pub fn params(&self) -> &[TypeParameter] { + &self.params + } +} + +impl<'a> quote::ToTokens for TypeDefParameters { + fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { + if !self.params.is_empty() { + let params = &self.params; + tokens.extend(quote! { < #( #params ),* > }) + } + } +} diff --git a/codegen/src/types/type_path.rs b/codegen/src/types/type_path.rs index 186619cbf0..b0c239954c 100644 --- a/codegen/src/types/type_path.rs +++ b/codegen/src/types/type_path.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -28,7 +28,7 @@ use scale_info::{ TypeDef, TypeDefPrimitive, }; -use std::collections::HashSet; +use std::collections::BTreeSet; use syn::parse_quote; #[derive(Clone, Debug)] @@ -67,7 +67,7 @@ impl TypePath { /// a: Vec>, // the parent type param here is `T` /// } /// ``` - pub fn parent_type_params(&self, acc: &mut HashSet) { + pub fn parent_type_params(&self, acc: &mut BTreeSet) { match self { Self::Parameter(type_parameter) => { acc.insert(type_parameter.clone()); @@ -173,7 +173,7 @@ impl TypePathType { } TypeDef::Compact(_) => { let compact_type = &self.params[0]; - syn::Type::Path(parse_quote! ( #compact_type )) + parse_quote! ( #compact_type ) } TypeDef::BitSequence(_) => { let bit_order_type = &self.params[0]; @@ -195,7 +195,7 @@ impl TypePathType { /// a: Vec>, // the parent type param here is `T` /// } /// ``` - fn parent_type_params(&self, acc: &mut HashSet) { + fn parent_type_params(&self, acc: &mut BTreeSet) { for p in &self.params { p.parent_type_params(acc); } @@ -205,6 +205,7 @@ impl TypePathType { #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] pub struct TypeParameter { pub(super) concrete_type_id: u32, + pub(super) original_name: String, pub(super) name: proc_macro2::Ident, } @@ -235,7 +236,7 @@ impl quote::ToTokens for TypePathSubstitute { } impl TypePathSubstitute { - fn parent_type_params(&self, acc: &mut HashSet) { + fn parent_type_params(&self, acc: &mut BTreeSet) { for p in &self.params { p.parent_type_params(acc); } diff --git a/examples/Cargo.toml b/examples/Cargo.toml new file mode 100644 index 0000000000..e30ba4d7f0 --- /dev/null +++ b/examples/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "subxt-examples" +version = "0.16.0" +authors = ["Parity Technologies "] +edition = "2021" +publish = false + +license = "GPL-3.0" +repository = "https://github.com/paritytech/subxt" +documentation = "https://docs.rs/subxt" +homepage = "https://www.parity.io/" +description = "Subxt example usage" + +[dev-dependencies] +subxt = { path = "../subxt" } +async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } +sp-keyring = "4.0.0" +env_logger = "0.9.0" +futures = "0.3.13" +codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } +hex = "0.4.3" diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000000..30ae9c8b65 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,3 @@ +# Subxt Examples + +Take a look in the [examples](./examples) subfolder for various `subxt` usage examples. \ No newline at end of file diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs new file mode 100644 index 0000000000..55fb16880b --- /dev/null +++ b/examples/examples/custom_config.rs @@ -0,0 +1,70 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use sp_keyring::AccountKeyring; +use subxt::{ + ClientBuilder, + Config, + DefaultConfig, + DefaultExtra, + PairSigner, +}; + +#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +pub mod polkadot {} + +/// Custom [`Config`] impl where the default types for the target chain differ from the +/// [`DefaultConfig`] +#[derive(Clone, Debug, Default, Eq, PartialEq)] +pub struct MyConfig; +impl Config for MyConfig { + // This is different from the default `u32`. + // + // *Note* that in this example it does differ from the actual `Index` type in the + // polkadot runtime used, so some operations will fail. Normally when using a custom `Config` + // impl types MUST match exactly those used in the actual runtime. + type Index = u64; + type BlockNumber = ::BlockNumber; + type Hash = ::Hash; + type Hashing = ::Hashing; + type AccountId = ::AccountId; + type Address = ::Address; + type Header = ::Header; + type Signature = ::Signature; + type Extrinsic = ::Extrinsic; +} + +#[async_std::main] +async fn main() -> Result<(), Box> { + let api = ClientBuilder::new() + .build() + .await? + .to_runtime_api::>>(); + + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let dest = AccountKeyring::Bob.to_account_id().into(); + + let hash = api + .tx() + .balances() + .transfer(dest, 10_000) + .sign_and_submit(&signer) + .await?; + + println!("Balance transfer extrinsic submitted: {}", hash); + + Ok(()) +} diff --git a/examples/custom_type_derives.rs b/examples/examples/custom_type_derives.rs similarity index 74% rename from examples/custom_type_derives.rs rename to examples/examples/custom_type_derives.rs index ee3d25788f..a09c3d56e6 100644 --- a/examples/custom_type_derives.rs +++ b/examples/examples/custom_type_derives.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,9 +14,13 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +#![allow(clippy::redundant_clone)] + #[subxt::subxt( runtime_metadata_path = "examples/polkadot_metadata.scale", - generated_type_derives = "Clone, Debug" + // We can add (certain) custom derives to the generated types by providing + // a comma separated list to the below attribute. Most useful for adding `Clone`: + generated_type_derives = "Clone, Hash" )] pub mod polkadot {} @@ -25,6 +29,6 @@ use polkadot::runtime_types::frame_support::PalletId; #[async_std::main] async fn main() -> Result<(), Box> { let pallet_id = PalletId([1u8; 8]); - let _ = ::clone(&pallet_id); + let _ = pallet_id.clone(); Ok(()) } diff --git a/examples/fetch_all_accounts.rs b/examples/examples/fetch_all_accounts.rs similarity index 86% rename from examples/fetch_all_accounts.rs rename to examples/examples/fetch_all_accounts.rs index d01cfb483c..17aecc8a6c 100644 --- a/examples/fetch_all_accounts.rs +++ b/examples/examples/fetch_all_accounts.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -22,7 +22,11 @@ //! polkadot --dev --tmp //! ``` -use subxt::ClientBuilder; +use subxt::{ + ClientBuilder, + DefaultConfig, + DefaultExtra, +}; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] pub mod polkadot {} @@ -34,7 +38,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>(); + .to_runtime_api::>>(); let mut iter = api.storage().system().account_iter(None).await?; diff --git a/examples/fetch_remote.rs b/examples/examples/fetch_remote.rs similarity index 82% rename from examples/fetch_remote.rs rename to examples/examples/fetch_remote.rs index a54004551d..7b41dc1862 100644 --- a/examples/fetch_remote.rs +++ b/examples/examples/fetch_remote.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,7 +14,11 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use subxt::ClientBuilder; +use subxt::{ + ClientBuilder, + DefaultConfig, + DefaultExtra, +}; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] pub mod polkadot {} @@ -24,10 +28,10 @@ async fn main() -> Result<(), Box> { env_logger::init(); let api = ClientBuilder::new() - .set_url("wss://rpc.polkadot.io") + .set_url("wss://rpc.polkadot.io:443") .build() .await? - .to_runtime_api::>(); + .to_runtime_api::>>(); let block_number = 1; diff --git a/examples/polkadot_balance_transfer.rs b/examples/examples/polkadot_balance_transfer.rs similarity index 89% rename from examples/polkadot_balance_transfer.rs rename to examples/examples/polkadot_balance_transfer.rs index ee3535173c..d5effa3a3c 100644 --- a/examples/polkadot_balance_transfer.rs +++ b/examples/examples/polkadot_balance_transfer.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -25,6 +25,8 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, + DefaultConfig, + DefaultExtra, PairSigner, }; @@ -41,7 +43,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>(); + .to_runtime_api::>>(); let hash = api .tx() .balances() diff --git a/examples/polkadot_metadata.scale b/examples/examples/polkadot_metadata.scale similarity index 100% rename from examples/polkadot_metadata.scale rename to examples/examples/polkadot_metadata.scale diff --git a/examples/submit_and_watch.rs b/examples/examples/submit_and_watch.rs similarity index 95% rename from examples/submit_and_watch.rs rename to examples/examples/submit_and_watch.rs index ddb9c97c6c..d8a2b8d4a1 100644 --- a/examples/submit_and_watch.rs +++ b/examples/examples/submit_and_watch.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -26,6 +26,8 @@ use futures::StreamExt; use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, + DefaultConfig, + DefaultExtra, PairSigner, }; @@ -53,7 +55,7 @@ async fn simple_transfer() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>(); + .to_runtime_api::>>(); let balance_transfer = api .tx() @@ -85,7 +87,7 @@ async fn simple_transfer_separate_events() -> Result<(), Box>(); + .to_runtime_api::>>(); let balance_transfer = api .tx() @@ -136,7 +138,7 @@ async fn handle_transfer_events() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>(); + .to_runtime_api::>>(); let mut balance_transfer_progress = api .tx() diff --git a/examples/transfer_subscribe.rs b/examples/examples/transfer_subscribe.rs similarity index 85% rename from examples/transfer_subscribe.rs rename to examples/examples/transfer_subscribe.rs index 9b14fbcb1d..316d27248b 100644 --- a/examples/transfer_subscribe.rs +++ b/examples/examples/transfer_subscribe.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -25,6 +25,8 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, + DefaultConfig, + DefaultExtra, EventSubscription, PairSigner, }; @@ -42,11 +44,11 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>(); + .to_runtime_api::>>(); let sub = api.client.rpc().subscribe_events().await?; let decoder = api.client.events_decoder(); - let mut sub = EventSubscription::::new(sub, decoder); + let mut sub = EventSubscription::::new(sub, decoder); sub.filter_event::(); api.tx() @@ -56,7 +58,7 @@ async fn main() -> Result<(), Box> { .await?; let raw = sub.next().await.unwrap().unwrap(); - let event = ::decode( + let event = ::decode( &mut &raw.data[..], ); if let Ok(e) = event { diff --git a/macro/Cargo.toml b/macro/Cargo.toml index 4457b5d2e8..43b2534841 100644 --- a/macro/Cargo.toml +++ b/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subxt-macro" -version = "0.1.0" +version = "0.16.0" authors = ["Parity Technologies "] edition = "2021" autotests = false @@ -27,11 +27,10 @@ quote = "1.0.8" syn = "1.0.58" scale-info = "1.0.0" -subxt-codegen = { version = "0.2.0", path = "../codegen" } +subxt-codegen = { path = "../codegen", version = "0.16.0" } [dev-dependencies] -pretty_assertions = "0.6.1" -subxt = { path = ".." } +pretty_assertions = "1.0.0" +subxt = { path = "../subxt", version = "0.16.0" } trybuild = "1.0.38" - -sp-keyring = { git = "https://github.com/paritytech/substrate/", branch = "master" } +sp-keyring = "4.0.0" diff --git a/macro/src/lib.rs b/macro/src/lib.rs index 17fcf49c48..ee4c1d76db 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 5f5c6a7e63..0000000000 --- a/src/error.rs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::{ - events::EventsDecodingError, - metadata::{ - InvalidMetadataError, - MetadataError, - }, - Metadata, -}; -use jsonrpsee::core::Error as RpcError; -use sp_core::crypto::SecretStringError; -use sp_runtime::{ - transaction_validity::TransactionValidityError, - DispatchError, -}; -use thiserror::Error; - -/// Error enum. -#[derive(Debug, Error)] -pub enum Error { - /// Io error. - #[error("Io error: {0}")] - Io(#[from] std::io::Error), - /// Codec error. - #[error("Scale codec error: {0}")] - Codec(#[from] codec::Error), - /// Rpc error. - #[error("Rpc error: {0}")] - Rpc(#[from] RpcError), - /// Serde serialization error - #[error("Serde json error: {0}")] - Serialization(#[from] serde_json::error::Error), - /// Secret string error. - #[error("Secret String Error")] - SecretString(SecretStringError), - /// Extrinsic validity error - #[error("Transaction Validity Error: {0:?}")] - Invalid(TransactionValidityError), - /// Invalid metadata error - #[error("Invalid Metadata: {0}")] - InvalidMetadata(#[from] InvalidMetadataError), - /// Invalid metadata error - #[error("Metadata: {0}")] - Metadata(#[from] MetadataError), - /// Runtime error. - #[error("Runtime error: {0}")] - Runtime(#[from] RuntimeError), - /// Events decoding error. - #[error("Events decoding error: {0}")] - EventsDecoding(#[from] EventsDecodingError), - /// Transaction progress error. - #[error("Transaction error: {0}")] - Transaction(#[from] TransactionError), - /// Other error. - #[error("Other error: {0}")] - Other(String), -} - -impl From for Error { - fn from(error: SecretStringError) -> Self { - Error::SecretString(error) - } -} - -impl From for Error { - fn from(error: TransactionValidityError) -> Self { - Error::Invalid(error) - } -} - -impl From<&str> for Error { - fn from(error: &str) -> Self { - Error::Other(error.into()) - } -} - -impl From for Error { - fn from(error: String) -> Self { - Error::Other(error) - } -} - -/// Runtime error. -#[derive(Clone, Debug, Eq, Error, PartialEq)] -pub enum RuntimeError { - /// Module error. - #[error("Runtime module error: {0}")] - Module(PalletError), - /// At least one consumer is remaining so the account cannot be destroyed. - #[error("At least one consumer is remaining so the account cannot be destroyed.")] - ConsumerRemaining, - /// There are no providers so the account cannot be created. - #[error("There are no providers so the account cannot be created.")] - NoProviders, - /// There are too many consumers so the account cannot be created. - #[error("There are too many consumers so the account cannot be created.")] - TooManyConsumers, - /// Bad origin. - #[error("Bad origin: throw by ensure_signed, ensure_root or ensure_none.")] - BadOrigin, - /// Cannot lookup. - #[error("Cannot lookup some information required to validate the transaction.")] - CannotLookup, - /// Other error. - #[error("Other error: {0}")] - Other(String), -} - -impl RuntimeError { - /// Converts a `DispatchError` into a subxt error. - pub fn from_dispatch( - metadata: &Metadata, - error: DispatchError, - ) -> Result { - match error { - DispatchError::Module { - index, - error, - message: _, - } => { - let error = metadata.error(index, error)?; - Ok(Self::Module(PalletError { - pallet: error.pallet().to_string(), - error: error.error().to_string(), - description: error.description().to_vec(), - })) - } - DispatchError::BadOrigin => Ok(Self::BadOrigin), - DispatchError::CannotLookup => Ok(Self::CannotLookup), - DispatchError::ConsumerRemaining => Ok(Self::ConsumerRemaining), - DispatchError::NoProviders => Ok(Self::NoProviders), - DispatchError::TooManyConsumers => Ok(Self::TooManyConsumers), - DispatchError::Arithmetic(_math_error) => { - Ok(Self::Other("math_error".into())) - } - DispatchError::Token(_token_error) => Ok(Self::Other("token error".into())), - DispatchError::Other(msg) => Ok(Self::Other(msg.to_string())), - } - } -} - -/// Module error. -#[derive(Clone, Debug, Eq, Error, PartialEq)] -#[error("{error} from {pallet}")] -pub struct PalletError { - /// The module where the error originated. - pub pallet: String, - /// The actual error code. - pub error: String, - /// The error description. - pub description: Vec, -} - -/// Transaction error. -#[derive(Clone, Debug, Eq, Error, PartialEq)] -pub enum TransactionError { - /// The finality subscription expired (after ~512 blocks we give up if the - /// block hasn't yet been finalized). - #[error("The finality subscription expired")] - FinalitySubscriptionTimeout, - /// The block hash that the tranaction was added to could not be found. - /// This is probably because the block was retracted before being finalized. - #[error("The block containing the transaction can no longer be found (perhaps it was on a non-finalized fork?)")] - BlockHashNotFound, -} diff --git a/src/events.rs b/src/events.rs deleted file mode 100644 index 5dbdd6bfd1..0000000000 --- a/src/events.rs +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use codec::{ - Codec, - Compact, - Decode, - Encode, - Error as CodecError, - Input, -}; -use std::marker::PhantomData; - -use crate::{ - metadata::{ - EventMetadata, - MetadataError, - }, - Config, - Error, - Event, - Metadata, - Phase, -}; -use scale_info::{ - TypeDef, - TypeDefPrimitive, -}; -use sp_core::Bytes; - -/// Raw bytes for an Event -#[derive(Debug)] -#[cfg_attr(test, derive(PartialEq, Clone))] -pub struct RawEvent { - /// The name of the pallet from whence the Event originated. - pub pallet: String, - /// The index of the pallet from whence the Event originated. - pub pallet_index: u8, - /// The name of the pallet Event variant. - pub variant: String, - /// The index of the pallet Event variant. - pub variant_index: u8, - /// The raw Event data - pub data: Bytes, -} - -impl RawEvent { - /// Attempt to decode this [`RawEvent`] into a specific event. - pub fn as_event(&self) -> Result, CodecError> { - if self.pallet == E::PALLET && self.variant == E::EVENT { - Ok(Some(E::decode(&mut &self.data[..])?)) - } else { - Ok(None) - } - } -} - -/// Events decoder. -#[derive(Debug, Clone)] -pub struct EventsDecoder { - metadata: Metadata, - marker: PhantomData, -} - -impl EventsDecoder -where - T: Config, -{ - /// Creates a new `EventsDecoder`. - pub fn new(metadata: Metadata) -> Self { - Self { - metadata, - marker: Default::default(), - } - } - - /// Decode events. - pub fn decode_events( - &self, - input: &mut &[u8], - ) -> Result, Error> { - let compact_len = >::decode(input)?; - let len = compact_len.0 as usize; - log::debug!("decoding {} events", len); - - let mut r = Vec::new(); - for _ in 0..len { - // decode EventRecord - let phase = Phase::decode(input)?; - let pallet_index = input.read_byte()?; - let variant_index = input.read_byte()?; - log::debug!( - "phase {:?}, pallet_index {}, event_variant: {}", - phase, - pallet_index, - variant_index - ); - log::debug!("remaining input: {}", hex::encode(&input)); - - let event_metadata = self.metadata.event(pallet_index, variant_index)?; - - let mut event_data = Vec::::new(); - let result = self.decode_raw_event(event_metadata, input, &mut event_data); - let raw = match result { - Ok(()) => { - log::debug!("raw bytes: {}", hex::encode(&event_data),); - - let event = RawEvent { - pallet: event_metadata.pallet().to_string(), - pallet_index, - variant: event_metadata.event().to_string(), - variant_index, - data: event_data.into(), - }; - - // topics come after the event data in EventRecord - let topics = Vec::::decode(input)?; - log::debug!("topics: {:?}", topics); - - event - } - Err(err) => return Err(err), - }; - r.push((phase.clone(), raw)); - } - Ok(r) - } - - fn decode_raw_event( - &self, - event_metadata: &EventMetadata, - input: &mut &[u8], - output: &mut Vec, - ) -> Result<(), Error> { - log::debug!( - "Decoding Event '{}::{}'", - event_metadata.pallet(), - event_metadata.event() - ); - for arg in event_metadata.variant().fields() { - let type_id = arg.ty().id(); - self.decode_type(type_id, input, output)? - } - Ok(()) - } - - fn decode_type( - &self, - type_id: u32, - input: &mut &[u8], - output: &mut Vec, - ) -> Result<(), Error> { - let ty = self - .metadata - .resolve_type(type_id) - .ok_or(MetadataError::TypeNotFound(type_id))?; - - fn decode_raw( - input: &mut &[u8], - output: &mut Vec, - ) -> Result<(), Error> { - let decoded = T::decode(input)?; - decoded.encode_to(output); - Ok(()) - } - - match ty.type_def() { - TypeDef::Composite(composite) => { - for field in composite.fields() { - self.decode_type(field.ty().id(), input, output)? - } - Ok(()) - } - TypeDef::Variant(variant) => { - let variant_index = u8::decode(input)?; - variant_index.encode_to(output); - let variant = - variant - .variants() - .get(variant_index as usize) - .ok_or_else(|| { - Error::Other(format!("Variant {} not found", variant_index)) - })?; - for field in variant.fields() { - self.decode_type(field.ty().id(), input, output)?; - } - Ok(()) - } - TypeDef::Sequence(seq) => { - let len = >::decode(input)?; - len.encode_to(output); - for _ in 0..len.0 { - self.decode_type(seq.type_param().id(), input, output)?; - } - Ok(()) - } - TypeDef::Array(arr) => { - for _ in 0..arr.len() { - self.decode_type(arr.type_param().id(), input, output)?; - } - Ok(()) - } - TypeDef::Tuple(tuple) => { - for field in tuple.fields() { - self.decode_type(field.id(), input, output)?; - } - Ok(()) - } - TypeDef::Primitive(primitive) => { - match primitive { - TypeDefPrimitive::Bool => decode_raw::(input, output), - TypeDefPrimitive::Char => { - Err(EventsDecodingError::UnsupportedPrimitive( - TypeDefPrimitive::Char, - ) - .into()) - } - TypeDefPrimitive::Str => decode_raw::(input, output), - TypeDefPrimitive::U8 => decode_raw::(input, output), - TypeDefPrimitive::U16 => decode_raw::(input, output), - TypeDefPrimitive::U32 => decode_raw::(input, output), - TypeDefPrimitive::U64 => decode_raw::(input, output), - TypeDefPrimitive::U128 => decode_raw::(input, output), - TypeDefPrimitive::U256 => { - Err(EventsDecodingError::UnsupportedPrimitive( - TypeDefPrimitive::U256, - ) - .into()) - } - TypeDefPrimitive::I8 => decode_raw::(input, output), - TypeDefPrimitive::I16 => decode_raw::(input, output), - TypeDefPrimitive::I32 => decode_raw::(input, output), - TypeDefPrimitive::I64 => decode_raw::(input, output), - TypeDefPrimitive::I128 => decode_raw::(input, output), - TypeDefPrimitive::I256 => { - Err(EventsDecodingError::UnsupportedPrimitive( - TypeDefPrimitive::I256, - ) - .into()) - } - } - } - TypeDef::Compact(_compact) => { - let inner = self - .metadata - .resolve_type(type_id) - .ok_or(MetadataError::TypeNotFound(type_id))?; - let mut decode_compact_primitive = |primitive: &TypeDefPrimitive| { - match primitive { - TypeDefPrimitive::U8 => decode_raw::>(input, output), - TypeDefPrimitive::U16 => { - decode_raw::>(input, output) - } - TypeDefPrimitive::U32 => { - decode_raw::>(input, output) - } - TypeDefPrimitive::U64 => { - decode_raw::>(input, output) - } - TypeDefPrimitive::U128 => { - decode_raw::>(input, output) - } - prim => { - Err(EventsDecodingError::InvalidCompactPrimitive( - prim.clone(), - ) - .into()) - } - } - }; - match inner.type_def() { - TypeDef::Primitive(primitive) => decode_compact_primitive(primitive), - TypeDef::Composite(composite) => { - match composite.fields() { - [field] => { - let field_ty = self - .metadata - .resolve_type(field.ty().id()) - .ok_or_else(|| { - MetadataError::TypeNotFound(field.ty().id()) - })?; - if let TypeDef::Primitive(primitive) = field_ty.type_def() - { - decode_compact_primitive(primitive) - } else { - Err(EventsDecodingError::InvalidCompactType( - "Composite type must have a single primitive field" - .into(), - ) - .into()) - } - } - _ => { - Err(EventsDecodingError::InvalidCompactType( - "Composite type must have a single field".into(), - ) - .into()) - } - } - } - _ => { - Err(EventsDecodingError::InvalidCompactType( - "Compact type must be a primitive or a composite type".into(), - ) - .into()) - } - } - } - TypeDef::BitSequence(_bitseq) => { - // decode_raw:: - unimplemented!("BitVec decoding for events not implemented yet") - } - } - } -} - -#[derive(Debug, thiserror::Error)] -pub enum EventsDecodingError { - /// Unsupported primitive type - #[error("Unsupported primitive type {0:?}")] - UnsupportedPrimitive(TypeDefPrimitive), - /// Invalid compact type, must be an unsigned int. - #[error("Invalid compact primitive {0:?}")] - InvalidCompactPrimitive(TypeDefPrimitive), - #[error("Invalid compact composite type {0}")] - InvalidCompactType(String), -} - -// #[cfg(test)] -// mod tests { -// use super::*; -// use std::convert::TryFrom; -// -// type DefaultConfig = crate::NodeTemplateRuntime; -// -// #[test] -// fn test_decode_option() { -// let decoder = EventsDecoder::::new( -// Metadata::default(), -// ); -// -// let value = Some(0u8); -// let input = value.encode(); -// let mut output = Vec::::new(); -// let mut errors = Vec::::new(); -// -// decoder -// .decode_raw_bytes( -// &[EventArg::Option(Box::new(EventArg::Primitive( -// "u8".to_string(), -// )))], -// &mut &input[..], -// &mut output, -// &mut errors, -// ) -// .unwrap(); -// -// assert_eq!(output, vec![1, 0]); -// } -// } diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml new file mode 100644 index 0000000000..7479f2c8ef --- /dev/null +++ b/subxt/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "subxt" +version = "0.16.0" +authors = ["Parity Technologies "] +edition = "2021" + +license = "GPL-3.0" +readme = "README.md" +repository = "https://github.com/paritytech/subxt" +documentation = "https://docs.rs/subxt" +homepage = "https://www.parity.io/" +description = "Submit extrinsics (transactions) to a substrate node via RPC" +keywords = ["parity", "substrate", "blockchain"] +include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] + +[dependencies] +async-trait = "0.1.49" +bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } +codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } +chameleon = "0.1.0" +scale-info = { version = "1.0.0", features = ["bit-vec"] } +futures = "0.3.13" +hex = "0.4.3" +jsonrpsee = { version = "0.8.0", features = ["macros", "async-client", "client-ws-transport"] } +log = "0.4.14" +num-traits = { version = "0.2.14", default-features = false } +serde = { version = "1.0.124", features = ["derive"] } +serde_json = "1.0.64" +thiserror = "1.0.24" +url = "2.2.1" + +subxt-macro = { version = "0.16.0", path = "../macro" } + +sp-core = { version = "4.0.0", default-features = false } +sp-runtime = { version = "4.0.0", default-features = false } +sp-version = "4.0.0" + +frame-metadata = "14.0.0" +derivative = "2.2.0" + +[dev-dependencies] +sp-arithmetic = { version = "4.0.0", default-features = false } +assert_matches = "1.5.0" +async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } +env_logger = "0.9.0" +tempdir = "0.3.7" +wabt = "0.10.0" +which = "4.0.2" +test-runtime = { path = "../test-runtime" } +sp-keyring = "4.0.0" diff --git a/src/client.rs b/subxt/src/client.rs similarity index 80% rename from src/client.rs rename to subxt/src/client.rs index b82c4b28f2..6dddfdf986 100644 --- a/src/client.rs +++ b/subxt/src/client.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -17,10 +17,9 @@ use futures::future; use sp_runtime::traits::Hash; pub use sp_runtime::traits::SignedExtension; -pub use sp_version::RuntimeVersion; use crate::{ - error::Error, + error::BasicError, events::EventsDecoder, extrinsic::{ self, @@ -31,6 +30,7 @@ use crate::{ rpc::{ Rpc, RpcClient, + RuntimeVersion, SystemProperties, }, storage::StorageClient, @@ -38,9 +38,10 @@ use crate::{ AccountData, Call, Config, - ExtrinsicExtraData, Metadata, }; +use codec::Decode; +use derivative::Derivative; use std::sync::Arc; /// ClientBuilder for constructing a Client. @@ -80,7 +81,7 @@ impl ClientBuilder { } /// Creates a new Client. - pub async fn build(self) -> Result, Error> { + pub async fn build(self) -> Result, BasicError> { let client = if let Some(client) = self.client { client } else { @@ -112,7 +113,8 @@ impl ClientBuilder { } /// Client to interface with a substrate node. -#[derive(Clone)] +#[derive(Derivative)] +#[derivative(Clone(bound = ""))] pub struct Client { rpc: Rpc, genesis_hash: T::Hash, @@ -131,7 +133,7 @@ impl std::fmt::Debug for Client { .field("metadata", &"") .field("events_decoder", &"") .field("properties", &self.properties) - .field("runtime_version", &self.runtime_version.to_string()) + .field("runtime_version", &self.runtime_version) .field("iter_page_size", &self.iter_page_size) .finish() } @@ -185,19 +187,27 @@ impl Client { } /// A constructed call ready to be signed and submitted. -pub struct SubmittableExtrinsic<'client, T: Config, C> { +pub struct SubmittableExtrinsic<'client, T: Config, X, A, C, E: Decode> { client: &'client Client, call: C, + marker: std::marker::PhantomData<(X, A, E)>, } -impl<'client, T, C> SubmittableExtrinsic<'client, T, C> +impl<'client, T, X, A, C, E> SubmittableExtrinsic<'client, T, X, A, C, E> where - T: Config + ExtrinsicExtraData, + T: Config, + X: SignedExtra, + A: AccountData, C: Call + Send + Sync, + E: Decode, { /// Create a new [`SubmittableExtrinsic`]. pub fn new(client: &'client Client, call: C) -> Self { - Self { client, call } + Self { + client, + call, + marker: Default::default(), + } } /// Creates and signs an extrinsic and submits it to the chain. @@ -206,15 +216,20 @@ where /// and obtain details about it, once it has made it into a block. pub async fn sign_and_submit_then_watch( self, - signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> + signer: &(dyn Signer + Send + Sync), + ) -> Result, BasicError> where - <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync + 'static, + ::AccountId: From<::AccountId>, + ::Index: Into<::Index>, { // Sign the call data to create our extrinsic. let extrinsic = self.create_signed(signer, Default::default()).await?; + // Get a hash of the extrinsic (we'll need this later). let ext_hash = T::Hashing::hash_of(&extrinsic); + // Submit and watch for transaction progress. let sub = self.client.rpc().watch_extrinsic(extrinsic).await?; @@ -231,10 +246,13 @@ where /// and has been included in the transaction pool. pub async fn sign_and_submit( self, - signer: &(dyn Signer + Send + Sync), - ) -> Result + signer: &(dyn Signer + Send + Sync), + ) -> Result where - <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync + 'static, + ::AccountId: From<::AccountId>, + ::Index: Into<::Index>, { let extrinsic = self.create_signed(signer, Default::default()).await?; self.client.rpc().submit_extrinsic(extrinsic).await @@ -243,25 +261,26 @@ where /// Creates a signed extrinsic. pub async fn create_signed( &self, - signer: &(dyn Signer + Send + Sync), - additional_params: >::Parameters, - ) -> Result, Error> + signer: &(dyn Signer + Send + Sync), + additional_params: X::Parameters, + ) -> Result, BasicError> where - <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync + 'static, + ::AccountId: From<::AccountId>, + ::Index: Into<::Index>, { let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { let account_storage_entry = - <>::AccountData as AccountData>::storage_entry(signer.account_id().clone()); + A::storage_entry(signer.account_id().clone().into()); let account_data = self .client .storage() .fetch_or_default(&account_storage_entry, None) .await?; - <>::AccountData as AccountData>::nonce( - &account_data, - ) + A::nonce(&account_data).into() }; let call = self .client diff --git a/src/config.rs b/subxt/src/config.rs similarity index 63% rename from src/config.rs rename to subxt/src/config.rs index 460cc4c5f0..dd7b727790 100644 --- a/src/config.rs +++ b/subxt/src/config.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,10 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use crate::{ - SignedExtra, - StorageEntry, -}; +use crate::StorageEntry; use codec::{ Codec, Encode, @@ -35,7 +32,10 @@ use sp_runtime::traits::{ }; /// Runtime types. -pub trait Config: Clone + Sized + Send + Sync + 'static { +// Note: the 'static bound isn't strictly required, but currently deriving TypeInfo +// automatically applies a 'static bound to all generic types (including this one), +// and so until that is resolved, we'll keep the (easy to satisfy) constraint here. +pub trait Config: 'static { /// Account index (aka nonce) type. This stores the number of previous /// transactions associated with a sender account. type Index: Parameter + Member + Default + AtLeast32Bit + Copy + scale_info::TypeInfo; @@ -85,21 +85,39 @@ pub trait Config: Clone + Sized + Send + Sync + 'static { pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug {} impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug {} -/// Trait to fetch data about an account. -/// -/// Should be implemented on a type implementing `StorageEntry`, -/// usually generated by the `subxt` macro. -pub trait AccountData: StorageEntry { - /// Create a new storage entry key from the account id. - fn storage_entry(account_id: T::AccountId) -> Self; - /// Get the nonce from the storage entry value. - fn nonce(result: &::Value) -> T::Index; +/// Default set of commonly used types by Substrate runtimes. +// Note: We only use this at the type level, so it should be impossible to +// create an instance of it. +pub enum DefaultConfig {} + +impl Config for DefaultConfig { + type Index = u32; + type BlockNumber = u32; + type Hash = sp_core::H256; + type Hashing = sp_runtime::traits::BlakeTwo256; + type AccountId = sp_runtime::AccountId32; + type Address = sp_runtime::MultiAddress; + type Header = + sp_runtime::generic::Header; + type Signature = sp_runtime::MultiSignature; + type Extrinsic = sp_runtime::OpaqueExtrinsic; } -/// Trait to configure the extra data for an extrinsic. -pub trait ExtrinsicExtraData { - /// The type of the [`StorageEntry`] which can be used to retrieve an account nonce. - type AccountData: AccountData; - /// The type of extra data and additional signed data to be included in a transaction. - type Extra: SignedExtra + Send + Sync + 'static; +/// Trait to fetch data about an account. +pub trait AccountData { + /// The runtime storage entry from which the account data can be fetched. + /// Usually generated by the `subxt` macro. + type StorageEntry: StorageEntry; + + /// The type of the account id to fetch the account data for. + type AccountId; + + /// The type of the account nonce returned from storage. + type Index; + + /// Create a new storage entry key from the account id. + fn storage_entry(account_id: Self::AccountId) -> Self::StorageEntry; + + /// Get the nonce from the storage entry value. + fn nonce(result: &::Value) -> Self::Index; } diff --git a/subxt/src/error.rs b/subxt/src/error.rs new file mode 100644 index 0000000000..650f091536 --- /dev/null +++ b/subxt/src/error.rs @@ -0,0 +1,181 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + events::EventsDecodingError, + metadata::{ + InvalidMetadataError, + MetadataError, + }, +}; +use core::fmt::Debug; +use jsonrpsee::core::error::Error as RequestError; +use sp_core::crypto::SecretStringError; +use sp_runtime::transaction_validity::TransactionValidityError; + +/// An error that may contain some runtime error `E` +pub type Error = GenericError>; + +/// An error that will never contain a runtime error. +pub type BasicError = GenericError; + +/// The underlying error enum, generic over the type held by the `Runtime` +/// variant. Prefer to use the [`Error`] and [`BasicError`] aliases over +/// using this type directly. +#[derive(Debug, thiserror::Error)] +pub enum GenericError { + /// Io error. + #[error("Io error: {0}")] + Io(#[from] std::io::Error), + /// Codec error. + #[error("Scale codec error: {0}")] + Codec(#[from] codec::Error), + /// Rpc error. + #[error("Rpc error: {0}")] + Rpc(#[from] RequestError), + /// Serde serialization error + #[error("Serde json error: {0}")] + Serialization(#[from] serde_json::error::Error), + /// Secret string error. + #[error("Secret String Error")] + SecretString(SecretStringError), + /// Extrinsic validity error + #[error("Transaction Validity Error: {0:?}")] + Invalid(TransactionValidityError), + /// Invalid metadata error + #[error("Invalid Metadata: {0}")] + InvalidMetadata(#[from] InvalidMetadataError), + /// Invalid metadata error + #[error("Metadata: {0}")] + Metadata(#[from] MetadataError), + /// Runtime error. + #[error("Runtime error: {0:?}")] + Runtime(E), + /// Events decoding error. + #[error("Events decoding error: {0}")] + EventsDecoding(#[from] EventsDecodingError), + /// Transaction progress error. + #[error("Transaction error: {0}")] + Transaction(#[from] TransactionError), + /// Other error. + #[error("Other error: {0}")] + Other(String), +} + +impl GenericError { + /// [`GenericError`] is parameterised over the type that it holds in the `Runtime` + /// variant. This function allows us to map the Runtime error contained within (if present) + /// to a different type. + pub fn map_runtime_err(self, f: F) -> GenericError + where + F: FnOnce(E) -> NewE, + { + match self { + GenericError::Io(e) => GenericError::Io(e), + GenericError::Codec(e) => GenericError::Codec(e), + GenericError::Rpc(e) => GenericError::Rpc(e), + GenericError::Serialization(e) => GenericError::Serialization(e), + GenericError::SecretString(e) => GenericError::SecretString(e), + GenericError::Invalid(e) => GenericError::Invalid(e), + GenericError::InvalidMetadata(e) => GenericError::InvalidMetadata(e), + GenericError::Metadata(e) => GenericError::Metadata(e), + GenericError::EventsDecoding(e) => GenericError::EventsDecoding(e), + GenericError::Transaction(e) => GenericError::Transaction(e), + GenericError::Other(e) => GenericError::Other(e), + // This is the only branch we really care about: + GenericError::Runtime(e) => GenericError::Runtime(f(e)), + } + } +} + +impl BasicError { + /// Convert an [`BasicError`] into any + /// arbitrary [`Error`]. + pub fn into_error(self) -> Error { + self.map_runtime_err(|e| match e {}) + } +} + +impl From for Error { + fn from(err: BasicError) -> Self { + err.into_error() + } +} + +impl From for GenericError { + fn from(error: SecretStringError) -> Self { + GenericError::SecretString(error) + } +} + +impl From for GenericError { + fn from(error: TransactionValidityError) -> Self { + GenericError::Invalid(error) + } +} + +impl From<&str> for GenericError { + fn from(error: &str) -> Self { + GenericError::Other(error.into()) + } +} + +impl From for GenericError { + fn from(error: String) -> Self { + GenericError::Other(error) + } +} + +/// This is used in the place of the `E` in [`GenericError`] when we may have a +/// Runtime Error. We use this wrapper so that it is possible to implement +/// `From` for `Error>`. +/// +/// This should not be used as a type; prefer to use the alias [`Error`] when referring +/// to errors which may contain some Runtime error `E`. +#[derive(Clone, Debug, PartialEq)] +pub struct RuntimeError(pub E); + +impl RuntimeError { + /// Extract the actual runtime error from this struct. + pub fn inner(self) -> E { + self.0 + } +} + +/// Module error. +#[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] +#[error("{error} from {pallet}")] +pub struct PalletError { + /// The module where the error originated. + pub pallet: String, + /// The actual error code. + pub error: String, + /// The error description. + pub description: Vec, +} + +/// Transaction error. +#[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] +pub enum TransactionError { + /// The finality subscription expired (after ~512 blocks we give up if the + /// block hasn't yet been finalized). + #[error("The finality subscription expired")] + FinalitySubscriptionTimeout, + /// The block hash that the tranaction was added to could not be found. + /// This is probably because the block was retracted before being finalized. + #[error("The block containing the transaction can no longer be found (perhaps it was on a non-finalized fork?)")] + BlockHashNotFound, +} diff --git a/subxt/src/events.rs b/subxt/src/events.rs new file mode 100644 index 0000000000..d7f5fb9e93 --- /dev/null +++ b/subxt/src/events.rs @@ -0,0 +1,646 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use crate::{ + error::BasicError, + metadata::{ + EventMetadata, + MetadataError, + }, + Config, + Event, + Metadata, + PhantomDataSendSync, + Phase, +}; +use bitvec::{ + order::Lsb0, + vec::BitVec, +}; +use codec::{ + Codec, + Compact, + Decode, + Error as CodecError, + Input, +}; +use derivative::Derivative; +use scale_info::{ + PortableRegistry, + TypeDef, + TypeDefPrimitive, +}; +use sp_core::Bytes; + +/// Raw bytes for an Event +#[derive(Debug)] +#[cfg_attr(test, derive(PartialEq, Clone))] +pub struct RawEvent { + /// The name of the pallet from whence the Event originated. + pub pallet: String, + /// The index of the pallet from whence the Event originated. + pub pallet_index: u8, + /// The name of the pallet Event variant. + pub variant: String, + /// The index of the pallet Event variant. + pub variant_index: u8, + /// The raw Event data + pub data: Bytes, +} + +impl RawEvent { + /// Attempt to decode this [`RawEvent`] into a specific event. + pub fn as_event(&self) -> Result, CodecError> { + if self.pallet == E::PALLET && self.variant == E::EVENT { + Ok(Some(E::decode(&mut &self.data[..])?)) + } else { + Ok(None) + } + } +} + +/// Events decoder. +#[derive(Derivative)] +#[derivative(Clone(bound = ""), Debug(bound = ""))] +pub struct EventsDecoder { + metadata: Metadata, + marker: PhantomDataSendSync, +} + +impl EventsDecoder { + /// Creates a new `EventsDecoder`. + pub fn new(metadata: Metadata) -> Self { + Self { + metadata, + marker: Default::default(), + } + } + + /// Decode events. + pub fn decode_events( + &self, + input: &mut &[u8], + ) -> Result, BasicError> { + let compact_len = >::decode(input)?; + let len = compact_len.0 as usize; + log::debug!("decoding {} events", len); + + let mut r = Vec::new(); + for _ in 0..len { + // decode EventRecord + let phase = Phase::decode(input)?; + let pallet_index = input.read_byte()?; + let variant_index = input.read_byte()?; + log::debug!( + "phase {:?}, pallet_index {}, event_variant: {}", + phase, + pallet_index, + variant_index + ); + log::debug!("remaining input: {}", hex::encode(&input)); + + let event_metadata = self.metadata.event(pallet_index, variant_index)?; + + let mut event_data = Vec::::new(); + let result = self.decode_raw_event(event_metadata, input, &mut event_data); + let raw = match result { + Ok(()) => { + log::debug!("raw bytes: {}", hex::encode(&event_data),); + + let event = RawEvent { + pallet: event_metadata.pallet().to_string(), + pallet_index, + variant: event_metadata.event().to_string(), + variant_index, + data: event_data.into(), + }; + + // topics come after the event data in EventRecord + let topics = Vec::::decode(input)?; + log::debug!("topics: {:?}", topics); + + event + } + Err(err) => return Err(err), + }; + r.push((phase.clone(), raw)); + } + Ok(r) + } + + fn decode_raw_event( + &self, + event_metadata: &EventMetadata, + input: &mut &[u8], + output: &mut Vec, + ) -> Result<(), BasicError> { + log::debug!( + "Decoding Event '{}::{}'", + event_metadata.pallet(), + event_metadata.event() + ); + for arg in event_metadata.variant().fields() { + let type_id = arg.ty().id(); + self.decode_type(type_id, input, output)? + } + Ok(()) + } + + fn decode_type( + &self, + type_id: u32, + input: &mut &[u8], + output: &mut Vec, + ) -> Result<(), BasicError> { + let all_bytes = *input; + // consume some bytes, moving the cursor forward: + decode_and_consume_type(type_id, &self.metadata.runtime_metadata().types, input)?; + // count how many bytes were consumed based on remaining length: + let consumed_len = all_bytes.len() - input.len(); + // move those consumed bytes to the output vec unaltered: + output.extend(&all_bytes[0..consumed_len]); + Ok(()) + } +} + +// Given a type Id and a type registry, attempt to consume the bytes +// corresponding to that type from our input. +fn decode_and_consume_type( + type_id: u32, + types: &PortableRegistry, + input: &mut &[u8], +) -> Result<(), BasicError> { + let ty = types + .resolve(type_id) + .ok_or(MetadataError::TypeNotFound(type_id))?; + + fn consume_type(input: &mut &[u8]) -> Result<(), BasicError> { + T::decode(input)?; + Ok(()) + } + + match ty.type_def() { + TypeDef::Composite(composite) => { + for field in composite.fields() { + decode_and_consume_type(field.ty().id(), types, input)? + } + Ok(()) + } + TypeDef::Variant(variant) => { + let variant_index = u8::decode(input)?; + let variant = variant + .variants() + .iter() + .find(|v| v.index() == variant_index) + .ok_or_else(|| { + BasicError::Other(format!("Variant {} not found", variant_index)) + })?; + for field in variant.fields() { + decode_and_consume_type(field.ty().id(), types, input)?; + } + Ok(()) + } + TypeDef::Sequence(seq) => { + let len = >::decode(input)?; + for _ in 0..len.0 { + decode_and_consume_type(seq.type_param().id(), types, input)?; + } + Ok(()) + } + TypeDef::Array(arr) => { + for _ in 0..arr.len() { + decode_and_consume_type(arr.type_param().id(), types, input)?; + } + Ok(()) + } + TypeDef::Tuple(tuple) => { + for field in tuple.fields() { + decode_and_consume_type(field.id(), types, input)?; + } + Ok(()) + } + TypeDef::Primitive(primitive) => { + match primitive { + TypeDefPrimitive::Bool => consume_type::(input), + TypeDefPrimitive::Char => { + Err( + EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::Char) + .into(), + ) + } + TypeDefPrimitive::Str => consume_type::(input), + TypeDefPrimitive::U8 => consume_type::(input), + TypeDefPrimitive::U16 => consume_type::(input), + TypeDefPrimitive::U32 => consume_type::(input), + TypeDefPrimitive::U64 => consume_type::(input), + TypeDefPrimitive::U128 => consume_type::(input), + TypeDefPrimitive::U256 => { + Err( + EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::U256) + .into(), + ) + } + TypeDefPrimitive::I8 => consume_type::(input), + TypeDefPrimitive::I16 => consume_type::(input), + TypeDefPrimitive::I32 => consume_type::(input), + TypeDefPrimitive::I64 => consume_type::(input), + TypeDefPrimitive::I128 => consume_type::(input), + TypeDefPrimitive::I256 => { + Err( + EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::I256) + .into(), + ) + } + } + } + TypeDef::Compact(compact) => { + let inner = types + .resolve(compact.type_param().id()) + .ok_or(MetadataError::TypeNotFound(type_id))?; + let mut decode_compact_primitive = |primitive: &TypeDefPrimitive| { + match primitive { + TypeDefPrimitive::U8 => consume_type::>(input), + TypeDefPrimitive::U16 => consume_type::>(input), + TypeDefPrimitive::U32 => consume_type::>(input), + TypeDefPrimitive::U64 => consume_type::>(input), + TypeDefPrimitive::U128 => consume_type::>(input), + prim => { + Err(EventsDecodingError::InvalidCompactPrimitive(prim.clone()) + .into()) + } + } + }; + match inner.type_def() { + TypeDef::Primitive(primitive) => decode_compact_primitive(primitive), + TypeDef::Composite(composite) => { + match composite.fields() { + [field] => { + let field_ty = + types.resolve(field.ty().id()).ok_or_else(|| { + MetadataError::TypeNotFound(field.ty().id()) + })?; + if let TypeDef::Primitive(primitive) = field_ty.type_def() { + decode_compact_primitive(primitive) + } else { + Err(EventsDecodingError::InvalidCompactType( + "Composite type must have a single primitive field" + .into(), + ) + .into()) + } + } + _ => { + Err(EventsDecodingError::InvalidCompactType( + "Composite type must have a single field".into(), + ) + .into()) + } + } + } + _ => { + Err(EventsDecodingError::InvalidCompactType( + "Compact type must be a primitive or a composite type".into(), + ) + .into()) + } + } + } + TypeDef::BitSequence(bitseq) => { + let bit_store_def = types + .resolve(bitseq.bit_store_type().id()) + .ok_or(MetadataError::TypeNotFound(type_id))? + .type_def(); + + // We just need to consume the correct number of bytes. Roughly, we encode this + // as a Compact length, and then a slice of T of that length, where T is the + // bit store type. So, we ignore the bit order and only care that the bit store type + // used lines up in terms of the number of bytes it will take to encode/decode it. + match bit_store_def { + TypeDef::Primitive(TypeDefPrimitive::U8) => { + consume_type::>(input) + } + TypeDef::Primitive(TypeDefPrimitive::U16) => { + consume_type::>(input) + } + TypeDef::Primitive(TypeDefPrimitive::U32) => { + consume_type::>(input) + } + TypeDef::Primitive(TypeDefPrimitive::U64) => { + consume_type::>(input) + } + store => { + return Err(EventsDecodingError::InvalidBitSequenceType(format!( + "{:?}", + store + )) + .into()) + } + } + } + } +} + +#[derive(Debug, thiserror::Error)] +pub enum EventsDecodingError { + /// Unsupported primitive type + #[error("Unsupported primitive type {0:?}")] + UnsupportedPrimitive(TypeDefPrimitive), + /// Invalid compact type, must be an unsigned int. + #[error("Invalid compact primitive {0:?}")] + InvalidCompactPrimitive(TypeDefPrimitive), + /// Invalid compact type; error details in string. + #[error("Invalid compact composite type {0}")] + InvalidCompactType(String), + /// Invalid bit sequence type; bit store type or bit order type used aren't supported. + #[error("Invalid bit sequence type; bit store type {0} is not supported")] + InvalidBitSequenceType(String), +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{ + Config, + DefaultConfig, + Phase, + }; + use codec::Encode; + use frame_metadata::{ + v14::{ + ExtrinsicMetadata, + PalletEventMetadata, + PalletMetadata, + RuntimeMetadataLastVersion, + }, + RuntimeMetadataPrefixed, + }; + use scale_info::{ + meta_type, + TypeInfo, + }; + use std::convert::TryFrom; + + type TypeId = scale_info::interner::UntrackedSymbol; + + #[derive(Encode)] + pub struct EventRecord { + phase: Phase, + pallet_index: u8, + event: E, + topics: Vec<::Hash>, + } + + fn event_record(pallet_index: u8, event: E) -> EventRecord { + EventRecord { + phase: Phase::Finalization, + pallet_index, + event, + topics: vec![], + } + } + + fn singleton_type_registry( + ) -> (TypeId, PortableRegistry) { + let m = scale_info::MetaType::new::(); + let mut types = scale_info::Registry::new(); + let id = types.register_type(&m); + let portable_registry: PortableRegistry = types.into(); + + (id, portable_registry) + } + + fn pallet_metadata(pallet_index: u8) -> PalletMetadata { + let event = PalletEventMetadata { + ty: meta_type::(), + }; + PalletMetadata { + name: "Test", + storage: None, + calls: None, + event: Some(event), + constants: vec![], + error: None, + index: pallet_index, + } + } + + fn init_decoder(pallets: Vec) -> EventsDecoder { + let extrinsic = ExtrinsicMetadata { + ty: meta_type::<()>(), + version: 0, + signed_extensions: vec![], + }; + let v14 = RuntimeMetadataLastVersion::new(pallets, extrinsic, meta_type::<()>()); + let runtime_metadata: RuntimeMetadataPrefixed = v14.into(); + let metadata = Metadata::try_from(runtime_metadata).unwrap(); + EventsDecoder::::new(metadata) + } + + fn decode_and_consume_type_consumes_all_bytes< + T: codec::Encode + scale_info::TypeInfo + 'static, + >( + val: T, + ) { + let (type_id, registry) = singleton_type_registry::(); + let bytes = val.encode(); + let cursor = &mut &*bytes; + + decode_and_consume_type(type_id.id(), ®istry, cursor).unwrap(); + assert_eq!(cursor.len(), 0); + } + + #[test] + fn decode_single_event() { + #[derive(Clone, Encode, TypeInfo)] + enum Event { + A(u8), + } + + let pallet_index = 0; + let pallet = pallet_metadata::(pallet_index); + let decoder = init_decoder(vec![pallet]); + + let event = Event::A(1); + let encoded_event = event.encode(); + let event_records = vec![event_record(pallet_index, event)]; + + let mut input = Vec::new(); + event_records.encode_to(&mut input); + + let events = decoder.decode_events(&mut &input[..]).unwrap(); + + assert_eq!(events[0].1.variant_index, encoded_event[0]); + assert_eq!(events[0].1.data.0, encoded_event[1..]); + } + + #[test] + fn decode_multiple_events() { + #[derive(Clone, Encode, TypeInfo)] + enum Event { + A(u8), + B, + C { a: u32 }, + } + + let pallet_index = 0; + let pallet = pallet_metadata::(pallet_index); + let decoder = init_decoder(vec![pallet]); + + let event1 = Event::A(1); + let event2 = Event::B; + let event3 = Event::C { a: 3 }; + + let encoded_event1 = event1.encode(); + let encoded_event2 = event2.encode(); + let encoded_event3 = event3.encode(); + + let event_records = vec![ + event_record(pallet_index, event1), + event_record(pallet_index, event2), + event_record(pallet_index, event3), + ]; + + let mut input = Vec::new(); + event_records.encode_to(&mut input); + + let events = decoder.decode_events(&mut &input[..]).unwrap(); + + assert_eq!(events[0].1.variant_index, encoded_event1[0]); + assert_eq!(events[0].1.data.0, encoded_event1[1..]); + + assert_eq!(events[1].1.variant_index, encoded_event2[0]); + assert_eq!(events[1].1.data.0, encoded_event2[1..]); + + assert_eq!(events[2].1.variant_index, encoded_event3[0]); + assert_eq!(events[2].1.data.0, encoded_event3[1..]); + } + + #[test] + fn compact_event_field() { + #[derive(Clone, Encode, TypeInfo)] + enum Event { + A(#[codec(compact)] u32), + } + + let pallet_index = 0; + let pallet = pallet_metadata::(pallet_index); + let decoder = init_decoder(vec![pallet]); + + let event = Event::A(u32::MAX); + let encoded_event = event.encode(); + let event_records = vec![event_record(pallet_index, event)]; + + let mut input = Vec::new(); + event_records.encode_to(&mut input); + + let events = decoder.decode_events(&mut &input[..]).unwrap(); + + assert_eq!(events[0].1.variant_index, encoded_event[0]); + assert_eq!(events[0].1.data.0, encoded_event[1..]); + } + + #[test] + fn compact_wrapper_struct_field() { + #[derive(Clone, Encode, TypeInfo)] + enum Event { + A(#[codec(compact)] CompactWrapper), + } + + #[derive(Clone, codec::CompactAs, Encode, TypeInfo)] + struct CompactWrapper(u64); + + let pallet_index = 0; + let pallet = pallet_metadata::(pallet_index); + let decoder = init_decoder(vec![pallet]); + + let event = Event::A(CompactWrapper(0)); + let encoded_event = event.encode(); + let event_records = vec![event_record(pallet_index, event)]; + + let mut input = Vec::new(); + event_records.encode_to(&mut input); + + let events = decoder.decode_events(&mut &input[..]).unwrap(); + + assert_eq!(events[0].1.variant_index, encoded_event[0]); + assert_eq!(events[0].1.data.0, encoded_event[1..]); + } + + #[test] + fn event_containing_explicit_index() { + #[derive(Clone, Encode, TypeInfo)] + #[repr(u8)] + #[allow(trivial_numeric_casts, clippy::unnecessary_cast)] // required because the Encode derive produces a warning otherwise + pub enum MyType { + B = 10u8, + } + + #[derive(Clone, Encode, TypeInfo)] + enum Event { + A(MyType), + } + + let pallet_index = 0; + let pallet = pallet_metadata::(pallet_index); + let decoder = init_decoder(vec![pallet]); + + let event = Event::A(MyType::B); + let encoded_event = event.encode(); + let event_records = vec![event_record(pallet_index, event)]; + + let mut input = Vec::new(); + event_records.encode_to(&mut input); + + // this would panic if the explicit enum item index were not correctly used + let events = decoder.decode_events(&mut &input[..]).unwrap(); + + assert_eq!(events[0].1.variant_index, encoded_event[0]); + assert_eq!(events[0].1.data.0, encoded_event[1..]); + } + + #[test] + fn decode_bitvec() { + use bitvec::order::Msb0; + + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Lsb0, u8; 0, 1, 1, 0, 1], + ); + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Msb0, u8; 0, 1, 1, 0, 1, 0, 1, 0, 0], + ); + + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Lsb0, u16; 0, 1, 1, 0, 1], + ); + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Msb0, u16; 0, 1, 1, 0, 1, 0, 1, 0, 0], + ); + + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Lsb0, u32; 0, 1, 1, 0, 1], + ); + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Msb0, u32; 0, 1, 1, 0, 1, 0, 1, 0, 0], + ); + + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Lsb0, u64; 0, 1, 1, 0, 1], + ); + decode_and_consume_type_consumes_all_bytes( + bitvec::bitvec![Msb0, u64; 0, 1, 1, 0, 1, 0, 1, 0, 0], + ); + } +} diff --git a/src/extrinsic/extra.rs b/subxt/src/extrinsic/extra.rs similarity index 65% rename from src/extrinsic/extra.rs rename to subxt/src/extrinsic/extra.rs index 29c4e38682..7a456e4a5c 100644 --- a/src/extrinsic/extra.rs +++ b/subxt/src/extrinsic/extra.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,14 +14,12 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +use crate::PhantomDataSendSync; use codec::{ Decode, Encode, }; -use core::{ - fmt::Debug, - marker::PhantomData, -}; +use derivative::Derivative; use scale_info::TypeInfo; use sp_runtime::{ generic::Era, @@ -48,21 +46,24 @@ use crate::Config; /// returned via `additional_signed()`. /// Ensure the runtime version registered in the transaction is the same as at present. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = "") +)] #[scale_info(skip_type_params(T))] pub struct CheckSpecVersion( - pub PhantomData, + pub PhantomDataSendSync, /// Local version to be used for `AdditionalSigned` #[codec(skip)] pub u32, ); -impl SignedExtension for CheckSpecVersion -where - T: Config + Clone + Debug + Eq + Send + Sync, -{ +impl SignedExtension for CheckSpecVersion { const IDENTIFIER: &'static str = "CheckSpecVersion"; - type AccountId = u64; + type AccountId = T::AccountId; type Call = (); type AdditionalSigned = u32; type Pre = (); @@ -88,21 +89,24 @@ where /// /// This is modified from the substrate version to allow passing in of the version, which is /// returned via `additional_signed()`. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = "") +)] #[scale_info(skip_type_params(T))] pub struct CheckTxVersion( - pub PhantomData, + pub PhantomDataSendSync, /// Local version to be used for `AdditionalSigned` #[codec(skip)] pub u32, ); -impl SignedExtension for CheckTxVersion -where - T: Config + Clone + Debug + Eq + Send + Sync, -{ +impl SignedExtension for CheckTxVersion { const IDENTIFIER: &'static str = "CheckTxVersion"; - type AccountId = u64; + type AccountId = T::AccountId; type Call = (); type AdditionalSigned = u32; type Pre = (); @@ -128,21 +132,24 @@ where /// /// This is modified from the substrate version to allow passing in of the genesis hash, which is /// returned via `additional_signed()`. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = "") +)] #[scale_info(skip_type_params(T))] pub struct CheckGenesis( - pub PhantomData, + pub PhantomDataSendSync, /// Local genesis hash to be used for `AdditionalSigned` #[codec(skip)] pub T::Hash, ); -impl SignedExtension for CheckGenesis -where - T: Config + Clone + Debug + Eq + Send + Sync, -{ +impl SignedExtension for CheckGenesis { const IDENTIFIER: &'static str = "CheckGenesis"; - type AccountId = u64; + type AccountId = T::AccountId; type Call = (); type AdditionalSigned = T::Hash; type Pre = (); @@ -169,22 +176,25 @@ where /// This is modified from the substrate version to allow passing in of the genesis hash, which is /// returned via `additional_signed()`. It assumes therefore `Era::Immortal` (The transaction is /// valid forever) -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = "") +)] #[scale_info(skip_type_params(T))] pub struct CheckMortality( /// The default structure for the Extra encoding - pub (Era, PhantomData), + pub (Era, PhantomDataSendSync), /// Local genesis hash to be used for `AdditionalSigned` #[codec(skip)] pub T::Hash, ); -impl SignedExtension for CheckMortality -where - T: Config + Clone + Debug + Eq + Send + Sync, -{ +impl SignedExtension for CheckMortality { const IDENTIFIER: &'static str = "CheckMortality"; - type AccountId = u64; + type AccountId = T::AccountId; type Call = (); type AdditionalSigned = T::Hash; type Pre = (); @@ -205,16 +215,19 @@ where } /// Nonce check and increment to give replay protection for transactions. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = "") +)] #[scale_info(skip_type_params(T))] pub struct CheckNonce(#[codec(compact)] pub T::Index); -impl SignedExtension for CheckNonce -where - T: Config + Clone + Debug + Eq + Send + Sync, -{ +impl SignedExtension for CheckNonce { const IDENTIFIER: &'static str = "CheckNonce"; - type AccountId = u64; + type AccountId = T::AccountId; type Call = (); type AdditionalSigned = (); type Pre = (); @@ -235,16 +248,19 @@ where } /// Resource limit check. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = "") +)] #[scale_info(skip_type_params(T))] -pub struct CheckWeight(pub PhantomData); +pub struct CheckWeight(pub PhantomDataSendSync); -impl SignedExtension for CheckWeight -where - T: Config + Clone + Debug + Eq + Send + Sync, -{ +impl SignedExtension for CheckWeight { const IDENTIFIER: &'static str = "CheckWeight"; - type AccountId = u64; + type AccountId = T::AccountId; type Call = (); type AdditionalSigned = (); type Pre = (); @@ -266,19 +282,66 @@ where /// Require the transactor pay for themselves and maybe include a tip to gain additional priority /// in the queue. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = ""), + Default(bound = "") +)] #[scale_info(skip_type_params(T))] -pub struct ChargeAssetTxPayment { +pub struct ChargeTransactionPayment( + #[codec(compact)] u128, + pub PhantomDataSendSync, +); + +impl SignedExtension for ChargeTransactionPayment { + const IDENTIFIER: &'static str = "ChargeTransactionPayment"; + type AccountId = T::AccountId; + type Call = (); + type AdditionalSigned = (); + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(()) + } + fn pre_dispatch( + self, + _who: &Self::AccountId, + _call: &Self::Call, + _info: &DispatchInfoOf, + _len: usize, + ) -> Result { + Ok(()) + } +} + +/// Require the transactor pay for themselves and maybe include a tip to gain additional priority +/// in the queue. +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = ""), + Default(bound = "") +)] +#[scale_info(skip_type_params(T))] +pub struct ChargeAssetTxPayment { /// The tip for the block author. #[codec(compact)] pub tip: u128, /// The asset with which to pay the tip. pub asset_id: Option, + /// Marker for unused type parameter. + pub marker: PhantomDataSendSync, } -impl SignedExtension for ChargeAssetTxPayment { +impl SignedExtension for ChargeAssetTxPayment { const IDENTIFIER: &'static str = "ChargeAssetTxPayment"; - type AccountId = u64; + type AccountId = T::AccountId; type Call = (); type AdditionalSigned = (); type Pre = (); @@ -319,16 +382,27 @@ pub trait SignedExtra: SignedExtension { } /// Default `SignedExtra` for substrate runtimes. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[derive(Derivative, Encode, Decode, TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = "") +)] #[scale_info(skip_type_params(T))] -pub struct DefaultExtra { +pub struct DefaultExtraWithTxPayment { spec_version: u32, tx_version: u32, nonce: T::Index, genesis_hash: T::Hash, + marker: PhantomDataSendSync, } -impl SignedExtra for DefaultExtra { +impl SignedExtra for DefaultExtraWithTxPayment +where + T: Config, + X: SignedExtension + Default, +{ type Extra = ( CheckSpecVersion, CheckTxVersion, @@ -336,7 +410,7 @@ impl SignedExtra for DefaultExt CheckMortality, CheckNonce, CheckWeight, - ChargeAssetTxPayment, + X, ); type Parameters = (); @@ -347,31 +421,37 @@ impl SignedExtra for DefaultExt genesis_hash: T::Hash, _params: Self::Parameters, ) -> Self { - DefaultExtra { + DefaultExtraWithTxPayment { spec_version, tx_version, nonce, genesis_hash, + marker: PhantomDataSendSync::new(), } } fn extra(&self) -> Self::Extra { ( - CheckSpecVersion(PhantomData, self.spec_version), - CheckTxVersion(PhantomData, self.tx_version), - CheckGenesis(PhantomData, self.genesis_hash), - CheckMortality((Era::Immortal, PhantomData), self.genesis_hash), + CheckSpecVersion(PhantomDataSendSync::new(), self.spec_version), + CheckTxVersion(PhantomDataSendSync::new(), self.tx_version), + CheckGenesis(PhantomDataSendSync::new(), self.genesis_hash), + CheckMortality( + (Era::Immortal, PhantomDataSendSync::new()), + self.genesis_hash, + ), CheckNonce(self.nonce), - CheckWeight(PhantomData), - ChargeAssetTxPayment { - tip: u128::default(), - asset_id: None, - }, + CheckWeight(PhantomDataSendSync::new()), + X::default(), ) } } -impl SignedExtension for DefaultExtra { +impl + Default> SignedExtension + for DefaultExtraWithTxPayment +where + T: Config, + X: SignedExtension, +{ const IDENTIFIER: &'static str = "DefaultExtra"; type AccountId = T::AccountId; type Call = (); @@ -394,3 +474,8 @@ impl SignedExtension for DefaultEx Ok(()) } } + +/// A default `SignedExtra` configuration, with [`ChargeTransactionPayment`] for tipping. +/// +/// Note that this must match the `SignedExtra` type in the target runtime's extrinsic definition. +pub type DefaultExtra = DefaultExtraWithTxPayment>; diff --git a/src/extrinsic/mod.rs b/subxt/src/extrinsic/mod.rs similarity index 65% rename from src/extrinsic/mod.rs rename to subxt/src/extrinsic/mod.rs index 1336c3565b..d87d491f2f 100644 --- a/src/extrinsic/mod.rs +++ b/subxt/src/extrinsic/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -22,6 +22,7 @@ mod signer; pub use self::{ extra::{ ChargeAssetTxPayment, + ChargeTransactionPayment, CheckGenesis, CheckMortality, CheckNonce, @@ -29,6 +30,7 @@ pub use self::{ CheckTxVersion, CheckWeight, DefaultExtra, + DefaultExtraWithTxPayment, SignedExtra, }, signer::{ @@ -38,53 +40,50 @@ pub use self::{ }; use sp_runtime::traits::SignedExtension; -use sp_version::RuntimeVersion; use crate::{ + error::BasicError, + rpc::RuntimeVersion, Config, Encoded, - Error, - ExtrinsicExtraData, }; /// UncheckedExtrinsic type. -pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< +pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< ::Address, Encoded, ::Signature, - <>::Extra as SignedExtra>::Extra, + >::Extra, >; /// SignedPayload type. -pub type SignedPayload = sp_runtime::generic::SignedPayload< - Encoded, - <>::Extra as SignedExtra>::Extra, ->; +pub type SignedPayload = + sp_runtime::generic::SignedPayload>::Extra>; /// Creates a signed extrinsic -pub async fn create_signed( +pub async fn create_signed( runtime_version: &RuntimeVersion, genesis_hash: T::Hash, nonce: T::Index, call: Encoded, - signer: &(dyn Signer + Send + Sync), - additional_params: >::Parameters, -) -> Result, Error> + signer: &(dyn Signer + Send + Sync), + additional_params: X::Parameters, +) -> Result, BasicError> where - T: Config + ExtrinsicExtraData, - <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, + T: Config, + X: SignedExtra, + ::AdditionalSigned: Send + Sync, { let spec_version = runtime_version.spec_version; let tx_version = runtime_version.transaction_version; - let extra = >::Extra::new( + let extra = X::new( spec_version, tx_version, nonce, genesis_hash, additional_params, ); - let payload = SignedPayload::::new(call, extra.extra())?; + let payload = SignedPayload::::new(call, extra.extra())?; let signed = signer.sign(payload).await?; Ok(signed) } diff --git a/src/extrinsic/signer.rs b/subxt/src/extrinsic/signer.rs similarity index 79% rename from src/extrinsic/signer.rs rename to subxt/src/extrinsic/signer.rs index 36c42e01a5..65f5fef0f1 100644 --- a/src/extrinsic/signer.rs +++ b/subxt/src/extrinsic/signer.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -18,14 +18,11 @@ //! [substrate](https://github.com/paritytech/substrate) node via RPC. use super::{ + SignedExtra, SignedPayload, UncheckedExtrinsic, }; -use crate::{ - Config, - ExtrinsicExtraData, - SignedExtra, -}; +use crate::Config; use codec::Encode; use sp_core::Pair; use sp_runtime::traits::{ @@ -36,7 +33,7 @@ use sp_runtime::traits::{ /// Extrinsic signer. #[async_trait::async_trait] -pub trait Signer> { +pub trait Signer> { /// Returns the account id. fn account_id(&self) -> &T::AccountId; @@ -49,21 +46,23 @@ pub trait Signer> { /// refused the operation. async fn sign( &self, - extrinsic: SignedPayload, - ) -> Result, String>; + extrinsic: SignedPayload, + ) -> Result, String>; } /// Extrinsic signer using a private key. #[derive(Clone, Debug)] -pub struct PairSigner { +pub struct PairSigner { account_id: T::AccountId, nonce: Option, signer: P, + marker: std::marker::PhantomData, } -impl PairSigner +impl PairSigner where - T: Config + ExtrinsicExtraData, + T: Config, + E: SignedExtra, T::Signature: From, ::Signer: From + IdentifyAccount, @@ -77,6 +76,7 @@ where account_id, nonce: None, signer, + marker: Default::default(), } } @@ -97,11 +97,13 @@ where } #[async_trait::async_trait] -impl Signer for PairSigner +impl Signer for PairSigner where - T: Config + ExtrinsicExtraData, + T: Config, + E: SignedExtra, T::AccountId: Into + 'static, - <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static, + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync + 'static, P: Pair + 'static, P::Signature: Into + 'static, { @@ -115,11 +117,11 @@ where async fn sign( &self, - extrinsic: SignedPayload, - ) -> Result, String> { + extrinsic: SignedPayload, + ) -> Result, String> { let signature = extrinsic.using_encoded(|payload| self.signer.sign(payload)); let (call, extra, _) = extrinsic.deconstruct(); - let extrinsic = UncheckedExtrinsic::::new_signed( + let extrinsic = UncheckedExtrinsic::::new_signed( call, self.account_id.clone().into(), signature.into(), diff --git a/src/lib.rs b/subxt/src/lib.rs similarity index 79% rename from src/lib.rs rename to subxt/src/lib.rs index da3d25c570..02077fcd8c 100644 --- a/src/lib.rs +++ b/subxt/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -53,10 +53,8 @@ use codec::{ DecodeAll, Encode, }; -use core::{ - fmt::Debug, - marker::PhantomData, -}; +use core::fmt::Debug; +use derivative::Derivative; mod client; mod config; @@ -78,12 +76,12 @@ pub use crate::{ config::{ AccountData, Config, - ExtrinsicExtraData, + DefaultConfig, }, error::{ + BasicError, Error, PalletError, - RuntimeError, TransactionError, }, events::{ @@ -92,6 +90,7 @@ pub use crate::{ }, extrinsic::{ DefaultExtra, + DefaultExtraWithTxPayment, PairSigner, SignedExtra, Signer, @@ -165,7 +164,7 @@ impl codec::Encode for Encoded { } /// A phase of a block's execution. -#[derive(Clone, Debug, Eq, PartialEq, Decode)] +#[derive(Clone, Debug, Eq, PartialEq, Decode, Encode)] pub enum Phase { /// Applying an extrinsic. ApplyExtrinsic(u32), @@ -179,10 +178,17 @@ pub enum Phase { /// /// [`WrapperKeepOpaque`] stores the type only in its opaque format, aka as a `Vec`. To /// access the real type `T` [`Self::try_decode`] needs to be used. -#[derive(Debug, Eq, PartialEq, Default, Clone, Decode, Encode)] +#[derive(Derivative, Encode, Decode)] +#[derivative( + Debug(bound = ""), + Clone(bound = ""), + PartialEq(bound = ""), + Eq(bound = ""), + Default(bound = "") +)] pub struct WrapperKeepOpaque { data: Vec, - _phantom: PhantomData, + _phantom: PhantomDataSendSync, } impl WrapperKeepOpaque { @@ -207,7 +213,31 @@ impl WrapperKeepOpaque { pub fn from_encoded(data: Vec) -> Self { Self { data, - _phantom: PhantomData, + _phantom: PhantomDataSendSync::new(), } } } + +/// A version of [`std::marker::PhantomData`] that is also Send and Sync (which is fine +/// because regardless of the generic param, it is always possible to Send + Sync this +/// 0 size type). +#[derive(Derivative, Encode, Decode, scale_info::TypeInfo)] +#[derivative( + Clone(bound = ""), + PartialEq(bound = ""), + Debug(bound = ""), + Eq(bound = ""), + Default(bound = "") +)] +#[scale_info(skip_type_params(T))] +#[doc(hidden)] +pub struct PhantomDataSendSync(core::marker::PhantomData); + +impl PhantomDataSendSync { + pub(crate) fn new() -> Self { + Self(core::marker::PhantomData) + } +} + +unsafe impl Send for PhantomDataSendSync {} +unsafe impl Sync for PhantomDataSendSync {} diff --git a/src/metadata.rs b/subxt/src/metadata.rs similarity index 82% rename from src/metadata.rs rename to subxt/src/metadata.rs index 51af03f282..553f17c8b1 100644 --- a/src/metadata.rs +++ b/subxt/src/metadata.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -84,7 +84,6 @@ pub struct Metadata { metadata: RuntimeMetadataLastVersion, pallets: HashMap, events: HashMap<(u8, u8), EventMetadata>, - errors: HashMap<(u8, u8), ErrorMetadata>, } impl Metadata { @@ -108,19 +107,6 @@ impl Metadata { Ok(event) } - /// Returns the metadata for the error at the given pallet and error indices. - pub fn error( - &self, - pallet_index: u8, - error_index: u8, - ) -> Result<&ErrorMetadata, MetadataError> { - let error = self - .errors - .get(&(pallet_index, error_index)) - .ok_or(MetadataError::ErrorNotFound(pallet_index, error_index))?; - Ok(error) - } - /// Resolve a type definition. pub fn resolve_type(&self, id: u32) -> Option<&Type> { self.metadata.types.resolve(id) @@ -207,30 +193,6 @@ impl EventMetadata { } } -#[derive(Clone, Debug)] -pub struct ErrorMetadata { - pallet: String, - error: String, - variant: Variant, -} - -impl ErrorMetadata { - /// Get the name of the pallet from which the error originates. - pub fn pallet(&self) -> &str { - &self.pallet - } - - /// Get the name of the specific pallet error. - pub fn error(&self) -> &str { - &self.error - } - - /// Get the description of the specific pallet error. - pub fn description(&self) -> &[String] { - self.variant.docs() - } -} - #[derive(Debug, thiserror::Error)] pub enum InvalidMetadataError { #[error("Invalid prefix")] @@ -331,36 +293,10 @@ impl TryFrom for Metadata { }) .collect(); - let pallet_errors = metadata - .pallets - .iter() - .filter_map(|pallet| { - pallet.error.as_ref().map(|error| { - let type_def_variant = get_type_def_variant(error.ty.id())?; - Ok((pallet, type_def_variant)) - }) - }) - .collect::, _>>()?; - let errors = pallet_errors - .iter() - .flat_map(|(pallet, type_def_variant)| { - type_def_variant.variants().iter().map(move |var| { - let key = (pallet.index, var.index()); - let value = ErrorMetadata { - pallet: pallet.name.clone(), - error: var.name().clone(), - variant: var.clone(), - }; - (key, value) - }) - }) - .collect(); - Ok(Self { metadata, pallets, events, - errors, }) } } diff --git a/src/rpc.rs b/subxt/src/rpc.rs similarity index 78% rename from src/rpc.rs rename to subxt/src/rpc.rs index 86cda9f097..f3bb891e62 100644 --- a/src/rpc.rs +++ b/subxt/src/rpc.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -21,8 +21,22 @@ // Related: https://github.com/paritytech/subxt/issues/66 #![allow(irrefutable_let_patterns)] -use std::sync::Arc; +use std::{ + collections::HashMap, + sync::Arc, +}; +use crate::{ + error::BasicError, + storage::StorageKeyPrefix, + subscription::{ + EventStorageSubscription, + FinalizedEventStorageSubscription, + SystemEvents, + }, + Config, + Metadata, +}; use codec::{ Decode, Encode, @@ -72,19 +86,6 @@ use sp_runtime::generic::{ Block, SignedBlock, }; -use sp_version::RuntimeVersion; - -use crate::{ - error::Error, - storage::StorageKeyPrefix, - subscription::{ - EventStorageSubscription, - FinalizedEventStorageSubscription, - SystemEvents, - }, - Config, - Metadata, -}; /// A number type that can be serialized both as a number or a string that encodes a number in a /// string. @@ -169,6 +170,33 @@ pub enum SubstrateTransactionStatus { Invalid, } +/// This contains the runtime version information necessary to make transactions, as obtained from +/// the RPC call `state_getRuntimeVersion`, +#[derive(Debug, Clone, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RuntimeVersion { + /// Version of the runtime specification. A full-node will not attempt to use its native + /// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`, + /// `spec_version` and `authoring_version` are the same between Wasm and native. + pub spec_version: u32, + + /// All existing dispatches are fully compatible when this number doesn't change. If this + /// number changes, then `spec_version` must change, also. + /// + /// This number must change when an existing dispatchable (module ID, dispatch ID) is changed, + /// either through an alteration in its user-level semantics, a parameter + /// added/removed/changed, a dispatchable being removed, a module being removed, or a + /// dispatchable/module changing its index. + /// + /// It need *not* change when a new module is added or when a dispatchable is added. + pub transaction_version: u32, + + /// The other fields present may vary and aren't necessary for `subxt`; they are preserved in + /// this map. + #[serde(flatten)] + pub other: HashMap, +} + /// ReadProof struct returned by the RPC /// /// # Note @@ -214,7 +242,7 @@ impl Rpc { &self, key: &StorageKey, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let params = rpc_params![key, hash]; let data = self.client.request("state_getStorage", params).await?; Ok(data) @@ -229,7 +257,7 @@ impl Rpc { count: u32, start_key: Option, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let prefix = prefix.map(|p| p.to_storage_key()); let params = rpc_params![prefix, count, start_key, hash]; let data = self.client.request("state_getKeysPaged", params).await?; @@ -242,7 +270,7 @@ impl Rpc { keys: Vec, from: T::Hash, to: Option, - ) -> Result>, Error> { + ) -> Result>, BasicError> { let params = rpc_params![keys, from, to]; self.client .request("state_queryStorage", params) @@ -255,7 +283,7 @@ impl Rpc { &self, keys: &[StorageKey], at: Option, - ) -> Result>, Error> { + ) -> Result>, BasicError> { let params = rpc_params![keys, at]; self.client .request("state_queryStorageAt", params) @@ -264,7 +292,7 @@ impl Rpc { } /// Fetch the genesis hash - pub async fn genesis_hash(&self) -> Result { + pub async fn genesis_hash(&self) -> Result { let block_zero = Some(ListOrValue::Value(NumberOrHex::Number(0))); let params = rpc_params![block_zero]; let list_or_value: ListOrValue> = @@ -278,7 +306,7 @@ impl Rpc { } /// Fetch the metadata - pub async fn metadata(&self) -> Result { + pub async fn metadata(&self) -> Result { let bytes: Bytes = self .client .request("state_getMetadata", rpc_params![]) @@ -289,18 +317,33 @@ impl Rpc { } /// Fetch system properties - pub async fn system_properties(&self) -> Result { + pub async fn system_properties(&self) -> Result { Ok(self .client .request("system_properties", rpc_params![]) .await?) } + /// Fetch system chain + pub async fn system_chain(&self) -> Result { + Ok(self.client.request("system_chain", rpc_params![]).await?) + } + + /// Fetch system name + pub async fn system_name(&self) -> Result { + Ok(self.client.request("system_name", rpc_params![]).await?) + } + + /// Fetch system version + pub async fn system_version(&self) -> Result { + Ok(self.client.request("system_version", rpc_params![]).await?) + } + /// Get a header pub async fn header( &self, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let params = rpc_params![hash]; let header = self.client.request("chain_getHeader", params).await?; Ok(header) @@ -310,7 +353,7 @@ impl Rpc { pub async fn block_hash( &self, block_number: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let block_number = block_number.map(ListOrValue::Value); let params = rpc_params![block_number]; let list_or_value = self.client.request("chain_getBlockHash", params).await?; @@ -321,7 +364,7 @@ impl Rpc { } /// Get a block hash of the latest finalized block - pub async fn finalized_head(&self) -> Result { + pub async fn finalized_head(&self) -> Result { let hash = self .client .request("chain_getFinalizedHead", rpc_params![]) @@ -333,7 +376,7 @@ impl Rpc { pub async fn block( &self, hash: Option, - ) -> Result>, Error> { + ) -> Result>, BasicError> { let params = rpc_params![hash]; let block = self.client.request("chain_getBlock", params).await?; Ok(block) @@ -344,7 +387,7 @@ impl Rpc { &self, keys: Vec, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let params = rpc_params![keys, hash]; let proof = self.client.request("state_getReadProof", params).await?; Ok(proof) @@ -354,7 +397,7 @@ impl Rpc { pub async fn runtime_version( &self, at: Option, - ) -> Result { + ) -> Result { let params = rpc_params![at]; let version = self .client @@ -367,7 +410,9 @@ impl Rpc { /// /// *WARNING* these may not be included in the finalized chain, use /// `subscribe_finalized_events` to ensure events are finalized. - pub async fn subscribe_events(&self) -> Result, Error> { + pub async fn subscribe_events( + &self, + ) -> Result, BasicError> { let keys = Some(vec![StorageKey::from(SystemEvents::new())]); let params = rpc_params![keys]; @@ -381,7 +426,7 @@ impl Rpc { /// Subscribe to finalized events. pub async fn subscribe_finalized_events( &self, - ) -> Result, Error> { + ) -> Result, BasicError> { Ok(EventStorageSubscription::Finalized( FinalizedEventStorageSubscription::new( self.clone(), @@ -391,7 +436,7 @@ impl Rpc { } /// Subscribe to blocks. - pub async fn subscribe_blocks(&self) -> Result, Error> { + pub async fn subscribe_blocks(&self) -> Result, BasicError> { let subscription = self .client .subscribe( @@ -407,7 +452,7 @@ impl Rpc { /// Subscribe to finalized blocks. pub async fn subscribe_finalized_blocks( &self, - ) -> Result, Error> { + ) -> Result, BasicError> { let subscription = self .client .subscribe( @@ -420,10 +465,10 @@ impl Rpc { } /// Create and submit an extrinsic and return corresponding Hash if successful - pub async fn submit_extrinsic( + pub async fn submit_extrinsic( &self, - extrinsic: E, - ) -> Result { + extrinsic: X, + ) -> Result { let bytes: Bytes = extrinsic.encode().into(); let params = rpc_params![bytes]; let xt_hash = self @@ -434,10 +479,11 @@ impl Rpc { } /// Create and submit an extrinsic and return a subscription to the events triggered. - pub async fn watch_extrinsic( + pub async fn watch_extrinsic( &self, - extrinsic: E, - ) -> Result>, Error> { + extrinsic: X, + ) -> Result>, BasicError> + { let bytes: Bytes = extrinsic.encode().into(); let params = rpc_params![bytes]; let subscription = self @@ -457,14 +503,14 @@ impl Rpc { key_type: String, suri: String, public: Bytes, - ) -> Result<(), Error> { + ) -> Result<(), BasicError> { let params = rpc_params![key_type, suri, public]; self.client.request("author_insertKey", params).await?; Ok(()) } /// Generate new session keys and returns the corresponding public keys. - pub async fn rotate_keys(&self) -> Result { + pub async fn rotate_keys(&self) -> Result { Ok(self .client .request("author_rotateKeys", rpc_params![]) @@ -476,7 +522,10 @@ impl Rpc { /// `session_keys` is the SCALE encoded session keys object from the runtime. /// /// Returns `true` iff all private keys could be found. - pub async fn has_session_keys(&self, session_keys: Bytes) -> Result { + pub async fn has_session_keys( + &self, + session_keys: Bytes, + ) -> Result { let params = rpc_params![session_keys]; Ok(self.client.request("author_hasSessionKeys", params).await?) } @@ -488,7 +537,7 @@ impl Rpc { &self, public_key: Bytes, key_type: String, - ) -> Result { + ) -> Result { let params = rpc_params![public_key, key_type]; Ok(self.client.request("author_hasKey", params).await?) } @@ -511,3 +560,34 @@ async fn ws_transport(url: &str) -> Result<(WsSender, WsReceiver), RpcError> { .await .map_err(|e| RpcError::Transport(e.into())) } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_deser_runtime_version() { + let val: RuntimeVersion = serde_json::from_str( + r#"{ + "specVersion": 123, + "transactionVersion": 456, + "foo": true, + "wibble": [1,2,3] + }"#, + ) + .expect("deserializing failed"); + + let mut m = std::collections::HashMap::new(); + m.insert("foo".to_owned(), serde_json::json!(true)); + m.insert("wibble".to_owned(), serde_json::json!([1, 2, 3])); + + assert_eq!( + val, + RuntimeVersion { + spec_version: 123, + transaction_version: 456, + other: m + } + ); + } +} diff --git a/src/storage.rs b/subxt/src/storage.rs similarity index 92% rename from src/storage.rs rename to subxt/src/storage.rs index e94d640926..3d1b6f11e2 100644 --- a/src/storage.rs +++ b/subxt/src/storage.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -30,13 +30,13 @@ pub use sp_version::RuntimeVersion; use std::marker::PhantomData; use crate::{ + error::BasicError, metadata::{ Metadata, MetadataError, }, rpc::Rpc, Config, - Error, StorageHasher, }; @@ -132,13 +132,22 @@ impl StorageMapKey { } /// Client for querying runtime storage. -#[derive(Clone)] pub struct StorageClient<'a, T: Config> { rpc: &'a Rpc, metadata: &'a Metadata, iter_page_size: u32, } +impl<'a, T: Config> Clone for StorageClient<'a, T> { + fn clone(&self) -> Self { + Self { + rpc: self.rpc, + metadata: self.metadata, + iter_page_size: self.iter_page_size, + } + } +} + impl<'a, T: Config> StorageClient<'a, T> { /// Create a new [`StorageClient`] pub fn new(rpc: &'a Rpc, metadata: &'a Metadata, iter_page_size: u32) -> Self { @@ -154,7 +163,7 @@ impl<'a, T: Config> StorageClient<'a, T> { &self, key: StorageKey, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { if let Some(data) = self.rpc.storage(&key, hash).await? { Ok(Some(Decode::decode(&mut &data.0[..])?)) } else { @@ -167,7 +176,7 @@ impl<'a, T: Config> StorageClient<'a, T> { &self, key: StorageKey, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { self.rpc.storage(&key, hash).await } @@ -176,7 +185,7 @@ impl<'a, T: Config> StorageClient<'a, T> { &self, store: &F, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let prefix = StorageKeyPrefix::new::(); let key = store.key().final_key(prefix); self.fetch_unhashed::(key, hash).await @@ -187,7 +196,7 @@ impl<'a, T: Config> StorageClient<'a, T> { &self, store: &F, hash: Option, - ) -> Result { + ) -> Result { if let Some(data) = self.fetch(store, hash).await? { Ok(data) } else { @@ -205,7 +214,7 @@ impl<'a, T: Config> StorageClient<'a, T> { keys: Vec, from: T::Hash, to: Option, - ) -> Result>, Error> { + ) -> Result>, BasicError> { self.rpc.query_storage(keys, from, to).await } @@ -217,7 +226,7 @@ impl<'a, T: Config> StorageClient<'a, T> { count: u32, start_key: Option, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let prefix = StorageKeyPrefix::new::(); let keys = self .rpc @@ -230,7 +239,7 @@ impl<'a, T: Config> StorageClient<'a, T> { pub async fn iter( &self, hash: Option, - ) -> Result, Error> { + ) -> Result, BasicError> { let hash = if let Some(hash) = hash { hash } else { @@ -262,7 +271,7 @@ pub struct KeyIter<'a, T: Config, F: StorageEntry> { impl<'a, T: Config, F: StorageEntry> KeyIter<'a, T, F> { /// Returns the next key value pair from a map. - pub async fn next(&mut self) -> Result, Error> { + pub async fn next(&mut self) -> Result, BasicError> { loop { if let Some((k, v)) = self.buffer.pop() { return Ok(Some((k, Decode::decode(&mut &v.0[..])?))) diff --git a/src/subscription.rs b/subxt/src/subscription.rs similarity index 91% rename from src/subscription.rs rename to subxt/src/subscription.rs index 693c160a6a..307bfea222 100644 --- a/src/subscription.rs +++ b/subxt/src/subscription.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -14,6 +14,17 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +use crate::{ + error::BasicError, + events::{ + EventsDecoder, + RawEvent, + }, + rpc::Rpc, + Config, + Event, + Phase, +}; use jsonrpsee::core::{ client::Subscription, DeserializeOwned, @@ -28,18 +39,6 @@ use sp_core::{ use sp_runtime::traits::Header; use std::collections::VecDeque; -use crate::{ - error::Error, - events::{ - EventsDecoder, - RawEvent, - }, - rpc::Rpc, - Config, - Event, - Phase, -}; - /// Event subscription simplifies filtering a storage change set stream for /// events of interest. pub struct EventSubscription<'a, T: Config> { @@ -58,11 +57,13 @@ enum BlockReader<'a, T: Config> { }, /// Mock event listener for unit tests #[cfg(test)] - Mock(Box, Error>)>>), + Mock(Box, BasicError>)>>), } impl<'a, T: Config> BlockReader<'a, T> { - async fn next(&mut self) -> Option<(T::Hash, Result, Error>)> { + async fn next( + &mut self, + ) -> Option<(T::Hash, Result, BasicError>)> { match self { BlockReader::Decoder { subscription, @@ -117,12 +118,12 @@ impl<'a, T: Config> EventSubscription<'a, T> { } /// Filters events by type. - pub fn filter_event(&mut self) { - self.event = Some((E::PALLET, E::EVENT)); + pub fn filter_event(&mut self) { + self.event = Some((Ev::PALLET, Ev::EVENT)); } /// Gets the next event. - pub async fn next(&mut self) -> Option> { + pub async fn next(&mut self) -> Option> { loop { if let Some(raw_event) = self.events.pop_front() { return Some(Ok(raw_event)) @@ -259,24 +260,8 @@ where #[cfg(test)] mod tests { use super::*; + use crate::DefaultConfig; use sp_core::H256; - #[derive(Clone)] - struct MockConfig; - - impl Config for MockConfig { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = sp_runtime::traits::BlakeTwo256; - type AccountId = sp_runtime::AccountId32; - type Address = sp_runtime::MultiAddress; - type Header = sp_runtime::generic::Header< - Self::BlockNumber, - sp_runtime::traits::BlakeTwo256, - >; - type Signature = sp_runtime::MultiSignature; - type Extrinsic = sp_runtime::OpaqueExtrinsic; - } fn named_event(event_name: &str) -> RawEvent { RawEvent { @@ -315,7 +300,7 @@ mod tests { for block_filter in [None, Some(H256::from([1; 32]))] { for extrinsic_filter in [None, Some(1)] { for event_filter in [None, Some(("b", "b"))] { - let mut subscription: EventSubscription = + let mut subscription: EventSubscription = EventSubscription { block_reader: BlockReader::Mock(Box::new( vec![ diff --git a/src/transaction.rs b/subxt/src/transaction.rs similarity index 85% rename from src/transaction.rs rename to subxt/src/transaction.rs index 625a0e4fd8..ff0d3132cb 100644 --- a/src/transaction.rs +++ b/subxt/src/transaction.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -16,6 +16,8 @@ use std::task::Poll; +use crate::PhantomDataSendSync; +use codec::Decode; use sp_core::storage::StorageKey; use sp_runtime::traits::Hash; pub use sp_runtime::traits::SignedExtension; @@ -24,7 +26,9 @@ pub use sp_version::RuntimeVersion; use crate::{ client::Client, error::{ + BasicError, Error, + RuntimeError, TransactionError, }, rpc::SubstrateTransactionStatus, @@ -32,6 +36,7 @@ use crate::{ Config, Phase, }; +use derivative::Derivative; use futures::{ Stream, StreamExt, @@ -43,20 +48,23 @@ use jsonrpsee::core::{ /// This struct represents a subscription to the progress of some transaction, and is /// returned from [`crate::SubmittableExtrinsic::sign_and_submit_then_watch()`]. -#[derive(Debug)] -pub struct TransactionProgress<'client, T: Config> { +#[derive(Derivative)] +#[derivative(Debug(bound = ""))] +pub struct TransactionProgress<'client, T: Config, E: Decode> { sub: Option>>, ext_hash: T::Hash, client: &'client Client, + _error: PhantomDataSendSync, } // The above type is not `Unpin` by default unless the generic param `T` is, // so we manually make it clear that Unpin is actually fine regardless of `T` // (we don't care if this moves around in memory while it's "pinned"). -impl<'client, T: Config> Unpin for TransactionProgress<'client, T> {} +impl<'client, T: Config, E: Decode> Unpin for TransactionProgress<'client, T, E> {} -impl<'client, T: Config> TransactionProgress<'client, T> { - pub(crate) fn new( +impl<'client, T: Config, E: Decode> TransactionProgress<'client, T, E> { + /// Instantiate a new [`TransactionProgress`] from a custom subscription. + pub fn new( sub: RpcSubscription>, client: &'client Client, ext_hash: T::Hash, @@ -65,6 +73,7 @@ impl<'client, T: Config> TransactionProgress<'client, T> { sub: Some(sub), client, ext_hash, + _error: PhantomDataSendSync::new(), } } @@ -73,7 +82,7 @@ impl<'client, T: Config> TransactionProgress<'client, T> { /// avoid importing that trait if you don't otherwise need it. pub async fn next_item( &mut self, - ) -> Option, Error>> { + ) -> Option, BasicError>> { self.next().await } @@ -90,7 +99,7 @@ impl<'client, T: Config> TransactionProgress<'client, T> { /// level [`TransactionProgress::next_item()`] API if you'd like to handle these statuses yourself. pub async fn wait_for_in_block( mut self, - ) -> Result, Error> { + ) -> Result, BasicError> { while let Some(status) = self.next_item().await { match status? { // Finalized or otherwise in a block! Return. @@ -120,7 +129,7 @@ impl<'client, T: Config> TransactionProgress<'client, T> { /// level [`TransactionProgress::next_item()`] API if you'd like to handle these statuses yourself. pub async fn wait_for_finalized( mut self, - ) -> Result, Error> { + ) -> Result, BasicError> { while let Some(status) = self.next_item().await { match status? { // Finalized! Return. @@ -147,14 +156,16 @@ impl<'client, T: Config> TransactionProgress<'client, T> { /// may well indicate with some probability that the transaction will not make it into a block, /// there is no guarantee that this is true. Thus, we prefer to "play it safe" here. Use the lower /// level [`TransactionProgress::next_item()`] API if you'd like to handle these statuses yourself. - pub async fn wait_for_finalized_success(self) -> Result, Error> { + pub async fn wait_for_finalized_success( + self, + ) -> Result, Error> { let evs = self.wait_for_finalized().await?.wait_for_success().await?; Ok(evs) } } -impl<'client, T: Config> Stream for TransactionProgress<'client, T> { - type Item = Result, Error>; +impl<'client, T: Config, E: Decode> Stream for TransactionProgress<'client, T, E> { + type Item = Result, BasicError>; fn poll_next( mut self: std::pin::Pin<&mut Self>, @@ -175,11 +186,11 @@ impl<'client, T: Config> Stream for TransactionProgress<'client, T> { TransactionStatus::Broadcast(peers) } SubstrateTransactionStatus::InBlock(hash) => { - TransactionStatus::InBlock(TransactionInBlock { - block_hash: hash, - ext_hash: self.ext_hash, - client: self.client, - }) + TransactionStatus::InBlock(TransactionInBlock::new( + hash, + self.ext_hash, + self.client, + )) } SubstrateTransactionStatus::Retracted(hash) => { TransactionStatus::Retracted(hash) @@ -204,11 +215,11 @@ impl<'client, T: Config> Stream for TransactionProgress<'client, T> { } SubstrateTransactionStatus::Finalized(hash) => { self.sub = None; - TransactionStatus::Finalized(TransactionInBlock { - block_hash: hash, - ext_hash: self.ext_hash, - client: self.client, - }) + TransactionStatus::Finalized(TransactionInBlock::new( + hash, + self.ext_hash, + self.client, + )) } } }) @@ -261,8 +272,9 @@ impl<'client, T: Config> Stream for TransactionProgress<'client, T> { /// finalized. The `FinalityTimeout` event will be emitted when the block did not reach finality /// within 512 blocks. This either indicates that finality is not available for your chain, /// or that finality gadget is lagging behind. -#[derive(Debug)] -pub enum TransactionStatus<'client, T: Config> { +#[derive(Derivative)] +#[derivative(Debug(bound = ""))] +pub enum TransactionStatus<'client, T: Config, E: Decode> { /// The transaction is part of the "future" queue. Future, /// The transaction is part of the "ready" queue. @@ -270,7 +282,7 @@ pub enum TransactionStatus<'client, T: Config> { /// The transaction has been broadcast to the given peers. Broadcast(Vec), /// The transaction has been included in a block with given hash. - InBlock(TransactionInBlock<'client, T>), + InBlock(TransactionInBlock<'client, T, E>), /// The block this transaction was included in has been retracted, /// probably because it did not make it onto the blocks which were /// finalized. @@ -279,7 +291,7 @@ pub enum TransactionStatus<'client, T: Config> { /// blocks, and so the subscription has ended. FinalityTimeout(T::Hash), /// The transaction has been finalized by a finality-gadget, e.g GRANDPA. - Finalized(TransactionInBlock<'client, T>), + Finalized(TransactionInBlock<'client, T, E>), /// The transaction has been replaced in the pool by another transaction /// that provides the same tags. (e.g. same (sender, nonce)). Usurped(T::Hash), @@ -289,10 +301,10 @@ pub enum TransactionStatus<'client, T: Config> { Invalid, } -impl<'client, T: Config> TransactionStatus<'client, T> { +impl<'client, T: Config, E: Decode> TransactionStatus<'client, T, E> { /// A convenience method to return the `Finalized` details. Returns /// [`None`] if the enum variant is not [`TransactionStatus::Finalized`]. - pub fn as_finalized(&self) -> Option<&TransactionInBlock<'client, T>> { + pub fn as_finalized(&self) -> Option<&TransactionInBlock<'client, T, E>> { match self { Self::Finalized(val) => Some(val), _ => None, @@ -301,7 +313,7 @@ impl<'client, T: Config> TransactionStatus<'client, T> { /// A convenience method to return the `InBlock` details. Returns /// [`None`] if the enum variant is not [`TransactionStatus::InBlock`]. - pub fn as_in_block(&self) -> Option<&TransactionInBlock<'client, T>> { + pub fn as_in_block(&self) -> Option<&TransactionInBlock<'client, T, E>> { match self { Self::InBlock(val) => Some(val), _ => None, @@ -310,14 +322,29 @@ impl<'client, T: Config> TransactionStatus<'client, T> { } /// This struct represents a transaction that has made it into a block. -#[derive(Debug)] -pub struct TransactionInBlock<'client, T: Config> { +#[derive(Derivative)] +#[derivative(Debug(bound = ""))] +pub struct TransactionInBlock<'client, T: Config, E: Decode> { block_hash: T::Hash, ext_hash: T::Hash, client: &'client Client, + _error: PhantomDataSendSync, } -impl<'client, T: Config> TransactionInBlock<'client, T> { +impl<'client, T: Config, E: Decode> TransactionInBlock<'client, T, E> { + pub(crate) fn new( + block_hash: T::Hash, + ext_hash: T::Hash, + client: &'client Client, + ) -> Self { + Self { + block_hash, + ext_hash, + client, + _error: PhantomDataSendSync::new(), + } + } + /// Return the hash of the block that the transaction has made it into. pub fn block_hash(&self) -> T::Hash { self.block_hash @@ -341,19 +368,14 @@ impl<'client, T: Config> TransactionInBlock<'client, T> { /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn wait_for_success(&self) -> Result, Error> { + pub async fn wait_for_success(&self) -> Result, Error> { let events = self.fetch_events().await?; // Try to find any errors; return the first one we encounter. for ev in events.as_slice() { if &ev.pallet == "System" && &ev.variant == "ExtrinsicFailed" { - use codec::Decode; - let dispatch_error = sp_runtime::DispatchError::decode(&mut &*ev.data)?; - let runtime_error = crate::RuntimeError::from_dispatch( - self.client.metadata(), - dispatch_error, - )?; - return Err(runtime_error.into()) + let dispatch_error = E::decode(&mut &*ev.data)?; + return Err(Error::Runtime(RuntimeError(dispatch_error))) } } @@ -366,13 +388,13 @@ impl<'client, T: Config> TransactionInBlock<'client, T> { /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn fetch_events(&self) -> Result, Error> { + pub async fn fetch_events(&self) -> Result, BasicError> { let block = self .client .rpc() .block(Some(self.block_hash)) .await? - .ok_or(Error::Transaction(TransactionError::BlockHashNotFound))?; + .ok_or(BasicError::Transaction(TransactionError::BlockHashNotFound))?; let extrinsic_idx = block.block.extrinsics .iter() @@ -382,7 +404,7 @@ impl<'client, T: Config> TransactionInBlock<'client, T> { }) // If we successfully obtain the block hash we think contains our // extrinsic, the extrinsic should be in there somewhere.. - .ok_or(Error::Transaction(TransactionError::BlockHashNotFound))?; + .ok_or(BasicError::Transaction(TransactionError::BlockHashNotFound))?; let raw_events = self .client @@ -416,7 +438,8 @@ impl<'client, T: Config> TransactionInBlock<'client, T> { /// This represents the events related to our transaction. /// We can iterate over the events, or look for a specific one. -#[derive(Debug)] +#[derive(Derivative)] +#[derivative(Debug(bound = ""))] pub struct TransactionEvents { block_hash: T::Hash, ext_hash: T::Hash, @@ -441,10 +464,10 @@ impl TransactionEvents { /// Find all of the events matching the event type provided as a generic parameter. This /// will return an error if a matching event is found but cannot be properly decoded. - pub fn find_events(&self) -> Result, Error> { + pub fn find_events(&self) -> Result, BasicError> { self.events .iter() - .filter_map(|e| e.as_event::().map_err(Into::into).transpose()) + .filter_map(|e| e.as_event::().map_err(Into::into).transpose()) .collect() } @@ -453,18 +476,18 @@ impl TransactionEvents { /// /// Use [`TransactionEvents::find_events`], or iterate over [`TransactionEvents`] yourself /// if you'd like to handle multiple events of the same type. - pub fn find_first_event(&self) -> Result, Error> { + pub fn find_first_event(&self) -> Result, BasicError> { self.events .iter() - .filter_map(|e| e.as_event::().transpose()) + .filter_map(|e| e.as_event::().transpose()) .next() .transpose() .map_err(Into::into) } /// Find an event. Returns true if it was found. - pub fn has_event(&self) -> Result { - Ok(self.find_first_event::()?.is_some()) + pub fn has_event(&self) -> Result { + Ok(self.find_first_event::()?.is_some()) } } diff --git a/tests/integration/client.rs b/subxt/tests/integration/client.rs similarity index 89% rename from tests/integration/client.rs rename to subxt/tests/integration/client.rs index 66898837c6..47676fb6ee 100644 --- a/tests/integration/client.rs +++ b/subxt/tests/integration/client.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -122,3 +122,12 @@ async fn test_iter() { } assert_eq!(i, 13); } + +#[async_std::test] +async fn fetch_system_info() { + let node_process = test_node_process().await; + let client = node_process.client(); + assert_eq!(client.rpc().system_chain().await.unwrap(), "Development"); + assert_eq!(client.rpc().system_name().await.unwrap(), "Substrate Node"); + assert!(!client.rpc().system_version().await.unwrap().is_empty()); +} diff --git a/tests/integration/codegen/mod.rs b/subxt/tests/integration/codegen/mod.rs similarity index 95% rename from tests/integration/codegen/mod.rs rename to subxt/tests/integration/codegen/mod.rs index aa1f6aa502..0c4beca589 100644 --- a/tests/integration/codegen/mod.rs +++ b/subxt/tests/integration/codegen/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs similarity index 53% rename from tests/integration/codegen/polkadot.rs rename to subxt/tests/integration/codegen/polkadot.rs index 95ecb82005..b1057261d9 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/subxt/tests/integration/codegen/polkadot.rs @@ -1,61 +1,80 @@ #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod api { - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Event { #[codec(index = 0)] System(system::Event), - #[codec(index = 3)] - Indices(indices::Event), + #[codec(index = 1)] + Scheduler(scheduler::Event), #[codec(index = 4)] + Indices(indices::Event), + #[codec(index = 5)] Balances(balances::Event), #[codec(index = 7)] + Staking(staking::Event), + #[codec(index = 8)] Offences(offences::Event), #[codec(index = 9)] Session(session::Event), - #[codec(index = 10)] - Grandpa(grandpa::Event), #[codec(index = 11)] + Grandpa(grandpa::Event), + #[codec(index = 12)] ImOnline(im_online::Event), + #[codec(index = 14)] + Democracy(democracy::Event), + #[codec(index = 15)] + Council(council::Event), #[codec(index = 16)] - ParaInclusion(para_inclusion::Event), + TechnicalCommittee(technical_committee::Event), + #[codec(index = 17)] + PhragmenElection(phragmen_election::Event), + #[codec(index = 18)] + TechnicalMembership(technical_membership::Event), #[codec(index = 19)] - Paras(paras::Event), - #[codec(index = 22)] - Ump(ump::Event), - #[codec(index = 23)] - Hrmp(hrmp::Event), + Treasury(treasury::Event), + #[codec(index = 24)] + Claims(claims::Event), #[codec(index = 25)] - ParasDisputes(paras_disputes::Event), + Vesting(vesting::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)] - Sudo(sudo::Event), - #[codec(index = 35)] - ValidatorManager(validator_manager::Event), - #[codec(index = 80)] - Collective(collective::Event), - #[codec(index = 81)] - Membership(membership::Event), - #[codec(index = 90)] Utility(utility::Event), - #[codec(index = 91)] + #[codec(index = 28)] + Identity(identity::Event), + #[codec(index = 29)] Proxy(proxy::Event), - #[codec(index = 92)] + #[codec(index = 30)] Multisig(multisig::Event), - #[codec(index = 99)] - XcmPallet(xcm_pallet::Event), + #[codec(index = 34)] + Bounties(bounties::Event), + #[codec(index = 35)] + Tips(tips::Event), + #[codec(index = 36)] + ElectionProviderMultiPhase(election_provider_multi_phase::Event), + #[codec(index = 37)] + BagsList(bags_list::Event), + #[codec(index = 53)] + ParaInclusion(para_inclusion::Event), + #[codec(index = 56)] + Paras(paras::Event), + #[codec(index = 59)] + Ump(ump::Event), + #[codec(index = 60)] + Hrmp(hrmp::Event), + #[codec(index = 70)] + Registrar(registrar::Event), + #[codec(index = 71)] + Slots(slots::Event), + #[codec(index = 72)] + Auctions(auctions::Event), + #[codec(index = 73)] + Crowdloan(crowdloan::Event), } pub mod system { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct FillBlock { pub ratio: runtime_types::sp_arithmetic::per_things::Perbill, } @@ -63,7 +82,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "fill_block"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Remark { pub remark: ::std::vec::Vec<::core::primitive::u8>, } @@ -71,7 +90,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "remark"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHeapPages { pub pages: ::core::primitive::u64, } @@ -79,7 +98,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_heap_pages"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetCode { pub code: ::std::vec::Vec<::core::primitive::u8>, } @@ -87,7 +106,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_code"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetCodeWithoutChecks { pub code: ::std::vec::Vec<::core::primitive::u8>, } @@ -95,7 +114,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_code_without_checks"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetChangesTrieConfig { pub changes_trie_config: ::core::option::Option< runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, @@ -105,7 +124,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_changes_trie_config"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetStorage { pub items: ::std::vec::Vec<( ::std::vec::Vec<::core::primitive::u8>, @@ -116,7 +135,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_storage"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct KillStorage { pub keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, } @@ -124,7 +143,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "kill_storage"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct KillPrefix { pub prefix: ::std::vec::Vec<::core::primitive::u8>, pub subkeys: ::core::primitive::u32, @@ -133,7 +152,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "kill_prefix"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct RemarkWithEvent { pub remark: ::std::vec::Vec<::core::primitive::u8>, } @@ -141,52 +160,65 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "remark_with_event"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn fill_block( &self, ratio: runtime_types::sp_arithmetic::per_things::Perbill, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, FillBlock, DispatchError> + { let call = FillBlock { ratio }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn remark( &self, remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Remark, DispatchError> + { let call = Remark { remark }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_heap_pages( &self, pages: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetHeapPages, DispatchError> + { let call = SetHeapPages { pages }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_code( &self, code: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetCode, DispatchError> + { let call = SetCode { code }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_code_without_checks( &self, code: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetCodeWithoutChecks, + DispatchError, + > { let call = SetCodeWithoutChecks { code }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -195,8 +227,14 @@ pub mod api { changes_trie_config: ::core::option::Option< runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, >, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetChangesTrieConfig, + DispatchError, + > { let call = SetChangesTrieConfig { changes_trie_config, }; @@ -208,14 +246,16 @@ pub mod api { ::std::vec::Vec<::core::primitive::u8>, ::std::vec::Vec<::core::primitive::u8>, )>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetStorage, DispatchError> + { let call = SetStorage { items }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn kill_storage( &self, keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, KillStorage, DispatchError> + { let call = KillStorage { keys }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -223,14 +263,22 @@ pub mod api { &self, prefix: ::std::vec::Vec<::core::primitive::u8>, subkeys: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, KillPrefix, DispatchError> + { let call = KillPrefix { prefix, subkeys }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn remark_with_event( &self, remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RemarkWithEvent, + DispatchError, + > { let call = RemarkWithEvent { remark }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -239,7 +287,7 @@ pub mod api { pub type Event = runtime_types::frame_system::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ExtrinsicSuccess( pub runtime_types::frame_support::weights::DispatchInfo, ); @@ -247,7 +295,7 @@ pub mod api { const PALLET: &'static str = "System"; const EVENT: &'static str = "ExtrinsicSuccess"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ExtrinsicFailed( pub runtime_types::sp_runtime::DispatchError, pub runtime_types::frame_support::weights::DispatchInfo, @@ -256,25 +304,25 @@ pub mod api { const PALLET: &'static str = "System"; const EVENT: &'static str = "ExtrinsicFailed"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CodeUpdated {} impl ::subxt::Event for CodeUpdated { const PALLET: &'static str = "System"; const EVENT: &'static str = "CodeUpdated"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct NewAccount(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for NewAccount { const PALLET: &'static str = "System"; const EVENT: &'static str = "NewAccount"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct KilledAccount(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for KilledAccount { const PALLET: &'static str = "System"; const EVENT: &'static str = "KilledAccount"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Remarked( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::H256, @@ -389,7 +437,7 @@ pub mod api { const STORAGE: &'static str = "Events"; type Value = ::std::vec::Vec< runtime_types::frame_system::EventRecord< - runtime_types::rococo_runtime::Event, + runtime_types::polkadot_runtime::Event, ::subxt::sp_core::H256, >, >; @@ -473,7 +521,7 @@ pub mod api { ::core::primitive::u128, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Account(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -483,7 +531,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -492,7 +540,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ExtrinsicCount; self.client.storage().fetch(&entry, hash).await @@ -504,7 +552,7 @@ pub mod api { runtime_types::frame_support::weights::PerDispatchClass< ::core::primitive::u64, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = BlockWeight; self.client.storage().fetch_or_default(&entry, hash).await @@ -514,7 +562,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = AllExtrinsicsLen; self.client.storage().fetch(&entry, hash).await @@ -523,7 +571,7 @@ pub mod api { &self, _0: ::core::primitive::u32, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> { let entry = BlockHash(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -533,7 +581,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, BlockHash>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -543,7 +591,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec<::core::primitive::u8>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ExtrinsicData(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -553,14 +601,14 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, ExtrinsicData>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } pub async fn number( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = Number; self.client.storage().fetch_or_default(&entry, hash).await @@ -568,7 +616,7 @@ pub mod api { pub async fn parent_hash( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> { let entry = ParentHash; self.client.storage().fetch_or_default(&entry, hash).await @@ -580,7 +628,7 @@ pub mod api { runtime_types::sp_runtime::generic::digest::Digest< ::subxt::sp_core::H256, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Digest; self.client.storage().fetch_or_default(&entry, hash).await @@ -591,11 +639,11 @@ pub mod api { ) -> ::core::result::Result< ::std::vec::Vec< runtime_types::frame_system::EventRecord< - runtime_types::rococo_runtime::Event, + runtime_types::polkadot_runtime::Event, ::subxt::sp_core::H256, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Events; self.client.storage().fetch_or_default(&entry, hash).await @@ -603,7 +651,7 @@ pub mod api { pub async fn event_count( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = EventCount; self.client.storage().fetch_or_default(&entry, hash).await @@ -614,7 +662,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = EventTopics(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -624,7 +672,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, EventTopics>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -635,7 +683,7 @@ pub mod api { ::core::option::Option< runtime_types::frame_system::LastRuntimeUpgradeInfo, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = LastRuntimeUpgrade; self.client.storage().fetch(&entry, hash).await @@ -643,7 +691,7 @@ pub mod api { pub async fn upgraded_to_u32_ref_count( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> { let entry = UpgradedToU32RefCount; self.client.storage().fetch_or_default(&entry, hash).await @@ -651,7 +699,7 @@ pub mod api { pub async fn upgraded_to_triple_ref_count( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> { let entry = UpgradedToTripleRefCount; self.client.storage().fetch_or_default(&entry, hash).await @@ -661,7 +709,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ExecutionPhase; self.client.storage().fetch(&entry, hash).await @@ -669,11 +717,367 @@ pub mod api { } } } + pub mod scheduler { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Schedule { + pub when: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for Schedule { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Cancel { + pub when: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Cancel { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduleNamed { + pub id: ::std::vec::Vec<::core::primitive::u8>, + pub when: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ScheduleNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelNamed { + pub id: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for CancelNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel_named"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduleAfter { + pub after: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_after"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduleNamedAfter { + pub id: ::std::vec::Vec<::core::primitive::u8>, + pub after: ::core::primitive::u32, + pub maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + pub priority: ::core::primitive::u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ScheduleNamedAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named_after"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn schedule( + &self, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Schedule, DispatchError> + { + let call = Schedule { + when, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel( + &self, + when: ::core::primitive::u32, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Cancel, DispatchError> + { + let call = Cancel { when, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_named( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ScheduleNamed, + DispatchError, + > { + let call = ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_named( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, CancelNamed, DispatchError> + { + let call = CancelNamed { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_after( + &self, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ScheduleAfter, + DispatchError, + > { + let call = ScheduleAfter { + after, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_named_after( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ScheduleNamedAfter, + DispatchError, + > { + let call = ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Scheduled(pub ::core::primitive::u32, pub ::core::primitive::u32); + impl ::subxt::Event for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Canceled(pub ::core::primitive::u32, pub ::core::primitive::u32); + impl ::subxt::Event for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Dispatched( + pub (::core::primitive::u32, ::core::primitive::u32), + pub ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Agenda(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Agenda { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Agenda"; + type Value = ::std::vec::Vec< + ::core::option::Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::polkadot_runtime::Call, + ::core::primitive::u32, + runtime_types::polkadot_runtime::OriginCaller, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Lookup(pub ::std::vec::Vec<::core::primitive::u8>); + impl ::subxt::StorageEntry for Lookup { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Lookup"; + 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 StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_scheduler::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 agenda( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + ::core::option::Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::polkadot_runtime::Call, + ::core::primitive::u32, + runtime_types::polkadot_runtime::OriginCaller, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >, + ::subxt::BasicError, + > { + let entry = Agenda(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn agenda_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Agenda>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn lookup( + &self, + _0: ::std::vec::Vec<::core::primitive::u8>, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + let entry = Lookup(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn lookup_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Lookup>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_scheduler::Releases, + ::subxt::BasicError, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } pub mod babe { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReportEquivocation { pub equivocation_proof: runtime_types::sp_consensus_slots::EquivocationProof< @@ -689,7 +1093,7 @@ pub mod api { const PALLET: &'static str = "Babe"; const FUNCTION: &'static str = "report_equivocation"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReportEquivocationUnsigned { pub equivocation_proof: runtime_types::sp_consensus_slots::EquivocationProof< @@ -705,7 +1109,7 @@ pub mod api { const PALLET: &'static str = "Babe"; const FUNCTION: &'static str = "report_equivocation_unsigned"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct PlanConfigChange { pub config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, @@ -714,25 +1118,34 @@ pub mod api { const PALLET: &'static str = "Babe"; const FUNCTION: &'static str = "plan_config_change"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } 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, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ReportEquivocation, + DispatchError, + > { let call = ReportEquivocation { equivocation_proof, key_owner_proof, @@ -743,8 +1156,14 @@ pub mod api { &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, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ReportEquivocationUnsigned, + DispatchError, + > { let call = ReportEquivocationUnsigned { equivocation_proof, key_owner_proof, @@ -754,7 +1173,14 @@ pub mod api { pub fn plan_config_change( &self, config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + PlanConfigChange, + DispatchError, + > { let call = PlanConfigChange { config }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -923,11 +1349,11 @@ pub mod api { pub async fn epoch_index( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> { let entry = EpochIndex; self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn authorities (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > , :: subxt :: Error >{ + } pub async fn authorities (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: 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 entry = Authorities; self.client.storage().fetch_or_default(&entry, hash).await } @@ -936,7 +1362,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::sp_consensus_slots::Slot, - ::subxt::Error, + ::subxt::BasicError, > { let entry = GenesisSlot; self.client.storage().fetch_or_default(&entry, hash).await @@ -946,7 +1372,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::sp_consensus_slots::Slot, - ::subxt::Error, + ::subxt::BasicError, > { let entry = CurrentSlot; self.client.storage().fetch_or_default(&entry, hash).await @@ -956,7 +1382,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< [::core::primitive::u8; 32usize], - ::subxt::Error, + ::subxt::BasicError, > { let entry = Randomness; self.client.storage().fetch_or_default(&entry, hash).await @@ -968,7 +1394,7 @@ pub mod api { ::core::option::Option< runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = PendingEpochConfigChange; self.client.storage().fetch(&entry, hash).await @@ -978,18 +1404,18 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< [::core::primitive::u8; 32usize], - ::subxt::Error, + ::subxt::BasicError, > { let entry = NextRandomness; self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn next_authorities (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < (runtime_types :: sp_consensus_babe :: app :: Public , :: core :: primitive :: u64 ,) > , :: subxt :: Error >{ + } pub async fn next_authorities (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: 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 entry = NextAuthorities; self.client.storage().fetch_or_default(&entry, hash).await } pub async fn segment_index( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = SegmentIndex; self.client.storage().fetch_or_default(&entry, hash).await @@ -1002,7 +1428,7 @@ pub mod api { runtime_types::frame_support::storage::bounded_vec::BoundedVec< [::core::primitive::u8; 32usize], >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = UnderConstruction(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -1012,7 +1438,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, UnderConstruction>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -1023,7 +1449,7 @@ pub mod api { ::core::option::Option< ::core::option::Option<[::core::primitive::u8; 32usize]>, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Initialized; self.client.storage().fetch(&entry, hash).await @@ -1033,7 +1459,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<[::core::primitive::u8; 32usize]>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = AuthorVrfRandomness; self.client.storage().fetch_or_default(&entry, hash).await @@ -1043,7 +1469,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< (::core::primitive::u32, ::core::primitive::u32), - ::subxt::Error, + ::subxt::BasicError, > { let entry = EpochStart; self.client.storage().fetch_or_default(&entry, hash).await @@ -1051,7 +1477,7 @@ pub mod api { pub async fn lateness( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = Lateness; self.client.storage().fetch_or_default(&entry, hash).await @@ -1063,7 +1489,7 @@ pub mod api { ::core::option::Option< runtime_types::sp_consensus_babe::BabeEpochConfiguration, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = EpochConfig; self.client.storage().fetch(&entry, hash).await @@ -1075,7 +1501,7 @@ pub mod api { ::core::option::Option< runtime_types::sp_consensus_babe::BabeEpochConfiguration, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = NextEpochConfig; self.client.storage().fetch(&entry, hash).await @@ -1087,7 +1513,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Set { #[codec(compact)] pub now: ::core::primitive::u64, @@ -1096,23 +1523,27 @@ pub mod api { const PALLET: &'static str = "Timestamp"; const FUNCTION: &'static str = "set"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn set( &self, now: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Set, DispatchError> + { let call = Set { now }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1148,7 +1579,7 @@ pub mod api { pub async fn now( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> { let entry = Now; self.client.storage().fetch_or_default(&entry, hash).await @@ -1156,7 +1587,7 @@ pub mod api { pub async fn did_update( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> { let entry = DidUpdate; self.client.storage().fetch_or_default(&entry, hash).await @@ -1168,7 +1599,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Claim { pub index: ::core::primitive::u32, } @@ -1176,7 +1608,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "claim"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Transfer { pub new: ::subxt::sp_core::crypto::AccountId32, pub index: ::core::primitive::u32, @@ -1185,7 +1617,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "transfer"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Free { pub index: ::core::primitive::u32, } @@ -1193,7 +1625,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "free"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceTransfer { pub new: ::subxt::sp_core::crypto::AccountId32, pub index: ::core::primitive::u32, @@ -1203,7 +1635,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "force_transfer"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Freeze { pub index: ::core::primitive::u32, } @@ -1211,23 +1643,27 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "freeze"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn claim( &self, index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Claim, DispatchError> + { let call = Claim { index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1235,14 +1671,16 @@ pub mod api { &self, new: ::subxt::sp_core::crypto::AccountId32, index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Transfer, DispatchError> + { let call = Transfer { new, index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn free( &self, index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Free, DispatchError> + { let call = Free { index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1251,14 +1689,22 @@ pub mod api { new: ::subxt::sp_core::crypto::AccountId32, index: ::core::primitive::u32, freeze: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceTransfer, + DispatchError, + > { let call = ForceTransfer { new, index, freeze }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn freeze( &self, index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Freeze, DispatchError> + { let call = Freeze { index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1267,7 +1713,7 @@ pub mod api { pub type Event = runtime_types::pallet_indices::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct IndexAssigned( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u32, @@ -1276,13 +1722,13 @@ pub mod api { const PALLET: &'static str = "Indices"; const EVENT: &'static str = "IndexAssigned"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct IndexFreed(pub ::core::primitive::u32); impl ::subxt::Event for IndexFreed { const PALLET: &'static str = "Indices"; const EVENT: &'static str = "IndexFreed"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct IndexFrozen( pub ::core::primitive::u32, pub ::subxt::sp_core::crypto::AccountId32, @@ -1327,7 +1773,7 @@ pub mod api { ::core::primitive::u128, ::core::primitive::bool, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Accounts(_0); self.client.storage().fetch(&entry, hash).await @@ -1337,7 +1783,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Accounts>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -1348,7 +1794,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Transfer { pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, @@ -1361,7 +1808,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "transfer"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetBalance { pub who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, @@ -1376,7 +1823,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "set_balance"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceTransfer { pub source: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, @@ -1393,7 +1840,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "force_transfer"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct TransferKeepAlive { pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, @@ -1406,7 +1853,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "transfer_keep_alive"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct TransferAll { pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, @@ -1418,7 +1865,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "transfer_all"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceUnreserve { pub who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, @@ -1430,18 +1877,21 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "force_unreserve"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn transfer( &self, @@ -1450,7 +1900,8 @@ pub mod api { (), >, value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Transfer, DispatchError> + { let call = Transfer { dest, value }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1462,7 +1913,8 @@ pub mod api { >, new_free: ::core::primitive::u128, new_reserved: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetBalance, DispatchError> + { let call = SetBalance { who, new_free, @@ -1481,7 +1933,14 @@ pub mod api { (), >, value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceTransfer, + DispatchError, + > { let call = ForceTransfer { source, dest, @@ -1496,7 +1955,14 @@ pub mod api { (), >, value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + TransferKeepAlive, + DispatchError, + > { let call = TransferKeepAlive { dest, value }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1507,7 +1973,8 @@ pub mod api { (), >, keep_alive: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, TransferAll, DispatchError> + { let call = TransferAll { dest, keep_alive }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1518,7 +1985,14 @@ pub mod api { (), >, amount: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceUnreserve, + DispatchError, + > { let call = ForceUnreserve { who, amount }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1527,7 +2001,7 @@ pub mod api { pub type Event = runtime_types::pallet_balances::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Endowed( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u128, @@ -1536,7 +2010,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Endowed"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct DustLost( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u128, @@ -1545,7 +2019,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "DustLost"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Transfer( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::crypto::AccountId32, @@ -1555,7 +2029,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Transfer"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct BalanceSet( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u128, @@ -1565,16 +2039,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "BalanceSet"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Deposit( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Deposit"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Reserved( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u128, @@ -1583,7 +2048,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Reserved"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Unreserved( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u128, @@ -1592,7 +2057,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Unreserved"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReserveRepatriated( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::crypto::AccountId32, @@ -1603,6 +2068,33 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "ReserveRepatriated"; } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Deposit( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Deposit"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Withdraw( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Withdraw { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Withdraw"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Slashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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; @@ -1677,7 +2169,7 @@ pub mod api { pub async fn total_issuance( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> { let entry = TotalIssuance; self.client.storage().fetch_or_default(&entry, hash).await @@ -1688,7 +2180,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Account(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -1698,18 +2190,20 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await - } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > , :: subxt :: Error >{ + } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < :: core :: primitive :: u128 > > , :: subxt :: BasicError >{ let entry = Locks(_0); self.client.storage().fetch_or_default(&entry, hash).await } pub async fn locks_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> - { + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Locks>, + ::subxt::BasicError, + > { self.client.storage().iter(hash).await } pub async fn reserves( @@ -1723,7 +2217,7 @@ pub mod api { ::core::primitive::u128, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Reserves(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -1733,7 +2227,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Reserves>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -1742,7 +2236,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::pallet_balances::Releases, - ::subxt::Error, + ::subxt::BasicError, > { let entry = StorageVersion; self.client.storage().fetch_or_default(&entry, hash).await @@ -1784,7 +2278,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::sp_arithmetic::fixed_point::FixedU128, - ::subxt::Error, + ::subxt::BasicError, > { let entry = NextFeeMultiplier; self.client.storage().fetch_or_default(&entry, hash).await @@ -1794,7 +2288,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::pallet_transaction_payment::Releases, - ::subxt::Error, + ::subxt::BasicError, > { let entry = StorageVersion; self.client.storage().fetch_or_default(&entry, hash).await @@ -1806,7 +2300,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetUncles { pub new_uncles: ::std::vec::Vec< runtime_types::sp_runtime::generic::header::Header< @@ -1819,18 +2314,21 @@ pub mod api { const PALLET: &'static str = "Authorship"; const FUNCTION: &'static str = "set_uncles"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn set_uncles( &self, @@ -1840,7 +2338,8 @@ pub mod api { runtime_types::sp_runtime::traits::BlakeTwo256, >, >, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetUncles, DispatchError> + { let call = SetUncles { new_uncles }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -1899,7 +2398,7 @@ pub mod api { ::subxt::sp_core::crypto::AccountId32, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Uncles; self.client.storage().fetch_or_default(&entry, hash).await @@ -1909,7 +2408,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Author; self.client.storage().fetch(&entry, hash).await @@ -1917,7 +2416,7 @@ pub mod api { pub async fn did_set_uncles( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> { let entry = DidSetUncles; self.client.storage().fetch_or_default(&entry, hash).await @@ -1925,12 +2424,1735 @@ pub mod api { } } } + pub mod staking { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Bond { + pub controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + pub payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + } + impl ::subxt::Call for Bond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "bond"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BondExtra { + #[codec(compact)] + pub max_additional: ::core::primitive::u128, + } + impl ::subxt::Call for BondExtra { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "bond_extra"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Unbond { + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Unbond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "unbond"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct WithdrawUnbonded { + pub num_slashing_spans: ::core::primitive::u32, + } + impl ::subxt::Call for WithdrawUnbonded { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "withdraw_unbonded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Validate { + pub prefs: runtime_types::pallet_staking::ValidatorPrefs, + } + impl ::subxt::Call for Validate { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "validate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Nominate { + pub targets: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + } + impl ::subxt::Call for Nominate { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "nominate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Chill {} + impl ::subxt::Call for Chill { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "chill"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetPayee { + pub payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + } + impl ::subxt::Call for SetPayee { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_payee"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetController { + pub controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for SetController { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_controller"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetValidatorCount { + #[codec(compact)] + pub new: ::core::primitive::u32, + } + impl ::subxt::Call for SetValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_validator_count"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IncreaseValidatorCount { + #[codec(compact)] + pub additional: ::core::primitive::u32, + } + impl ::subxt::Call for IncreaseValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "increase_validator_count"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScaleValidatorCount { + pub factor: runtime_types::sp_arithmetic::per_things::Percent, + } + impl ::subxt::Call for ScaleValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "scale_validator_count"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceNoEras {} + impl ::subxt::Call for ForceNoEras { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_no_eras"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceNewEra {} + impl ::subxt::Call for ForceNewEra { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_new_era"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetInvulnerables { + pub invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for SetInvulnerables { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_invulnerables"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceUnstake { + pub stash: ::subxt::sp_core::crypto::AccountId32, + pub num_slashing_spans: ::core::primitive::u32, + } + impl ::subxt::Call for ForceUnstake { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_unstake"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceNewEraAlways {} + impl ::subxt::Call for ForceNewEraAlways { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_new_era_always"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelDeferredSlash { + pub era: ::core::primitive::u32, + pub slash_indices: ::std::vec::Vec<::core::primitive::u32>, + } + impl ::subxt::Call for CancelDeferredSlash { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "cancel_deferred_slash"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PayoutStakers { + pub validator_stash: ::subxt::sp_core::crypto::AccountId32, + pub era: ::core::primitive::u32, + } + impl ::subxt::Call for PayoutStakers { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "payout_stakers"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rebond { + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Rebond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "rebond"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetHistoryDepth { + #[codec(compact)] + pub new_history_depth: ::core::primitive::u32, + #[codec(compact)] + pub era_items_deleted: ::core::primitive::u32, + } + impl ::subxt::Call for SetHistoryDepth { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_history_depth"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReapStash { + pub stash: ::subxt::sp_core::crypto::AccountId32, + pub num_slashing_spans: ::core::primitive::u32, + } + impl ::subxt::Call for ReapStash { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "reap_stash"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Kick { + pub who: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + } + impl ::subxt::Call for Kick { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "kick"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetStakingLimits { + pub min_nominator_bond: ::core::primitive::u128, + pub min_validator_bond: ::core::primitive::u128, + pub max_nominator_count: ::core::option::Option<::core::primitive::u32>, + pub max_validator_count: ::core::option::Option<::core::primitive::u32>, + pub threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + } + impl ::subxt::Call for SetStakingLimits { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_staking_limits"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ChillOther { + pub controller: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ChillOther { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "chill_other"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn bond( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Bond, DispatchError> + { + let call = Bond { + controller, + value, + payee, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn bond_extra( + &self, + max_additional: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, BondExtra, DispatchError> + { + let call = BondExtra { max_additional }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unbond( + &self, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Unbond, DispatchError> + { + let call = Unbond { value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn withdraw_unbonded( + &self, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + WithdrawUnbonded, + DispatchError, + > { + let call = WithdrawUnbonded { num_slashing_spans }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn validate( + &self, + prefs: runtime_types::pallet_staking::ValidatorPrefs, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Validate, DispatchError> + { + let call = Validate { prefs }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn nominate( + &self, + targets: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Nominate, DispatchError> + { + let call = Nominate { targets }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn chill( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Chill, DispatchError> + { + let call = Chill {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_payee( + &self, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetPayee, DispatchError> + { + let call = SetPayee { payee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_controller( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetController, + DispatchError, + > { + let call = SetController { controller }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_validator_count( + &self, + new: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetValidatorCount, + DispatchError, + > { + let call = SetValidatorCount { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn increase_validator_count( + &self, + additional: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + IncreaseValidatorCount, + DispatchError, + > { + let call = IncreaseValidatorCount { additional }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn scale_validator_count( + &self, + factor: runtime_types::sp_arithmetic::per_things::Percent, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ScaleValidatorCount, + DispatchError, + > { + let call = ScaleValidatorCount { factor }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_no_eras( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ForceNoEras, DispatchError> + { + let call = ForceNoEras {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_new_era( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ForceNewEra, DispatchError> + { + let call = ForceNewEra {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_invulnerables( + &self, + invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetInvulnerables, + DispatchError, + > { + let call = SetInvulnerables { invulnerables }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_unstake( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ForceUnstake, DispatchError> + { + let call = ForceUnstake { + stash, + num_slashing_spans, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_new_era_always( + &self, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceNewEraAlways, + DispatchError, + > { + let call = ForceNewEraAlways {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_deferred_slash( + &self, + era: ::core::primitive::u32, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + CancelDeferredSlash, + DispatchError, + > { + let call = CancelDeferredSlash { era, slash_indices }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn payout_stakers( + &self, + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + PayoutStakers, + DispatchError, + > { + let call = PayoutStakers { + validator_stash, + era, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn rebond( + &self, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Rebond, DispatchError> + { + let call = Rebond { value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_history_depth( + &self, + new_history_depth: ::core::primitive::u32, + era_items_deleted: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHistoryDepth, + DispatchError, + > { + let call = SetHistoryDepth { + new_history_depth, + era_items_deleted, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reap_stash( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ReapStash, DispatchError> + { + let call = ReapStash { + stash, + num_slashing_spans, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kick( + &self, + who: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Kick, DispatchError> + { + let call = Kick { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_staking_limits( + &self, + min_nominator_bond: ::core::primitive::u128, + min_validator_bond: ::core::primitive::u128, + max_nominator_count: ::core::option::Option<::core::primitive::u32>, + max_validator_count: ::core::option::Option<::core::primitive::u32>, + threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetStakingLimits, + DispatchError, + > { + let call = SetStakingLimits { + min_nominator_bond, + min_validator_bond, + max_nominator_count, + max_validator_count, + threshold, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn chill_other( + &self, + controller: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ChillOther, DispatchError> + { + let call = ChillOther { controller }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EraPaid( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for EraPaid { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "EraPaid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rewarded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Slashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Slashed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct OldSlashingReportDiscarded(pub ::core::primitive::u32); + impl ::subxt::Event for OldSlashingReportDiscarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "OldSlashingReportDiscarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct StakersElected {} + impl ::subxt::Event for StakersElected { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakersElected"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Bonded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Bonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Bonded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Unbonded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Unbonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Unbonded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Withdrawn( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Withdrawn { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Withdrawn"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Kicked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Kicked { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Kicked"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct StakingElectionFailed {} + impl ::subxt::Event for StakingElectionFailed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakingElectionFailed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Chilled(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Chilled { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Chilled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PayoutStarted( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for PayoutStarted { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "PayoutStarted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct HistoryDepth; + impl ::subxt::StorageEntry for HistoryDepth { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "HistoryDepth"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ValidatorCount; + impl ::subxt::StorageEntry for ValidatorCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ValidatorCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MinimumValidatorCount; + impl ::subxt::StorageEntry for MinimumValidatorCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MinimumValidatorCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Invulnerables; + impl ::subxt::StorageEntry for Invulnerables { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Invulnerables"; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Bonded(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Bonded { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Bonded"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct MinNominatorBond; + impl ::subxt::StorageEntry for MinNominatorBond { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MinNominatorBond"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MinValidatorBond; + impl ::subxt::StorageEntry for MinValidatorBond { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MinValidatorBond"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Ledger(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Ledger { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Ledger"; + type Value = runtime_types::pallet_staking::StakingLedger< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct Payee(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Payee { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Payee"; + type Value = runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Validators(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Validators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Validators"; + type Value = runtime_types::pallet_staking::ValidatorPrefs; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CounterForValidators; + impl ::subxt::StorageEntry for CounterForValidators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CounterForValidators"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MaxValidatorsCount; + impl ::subxt::StorageEntry for MaxValidatorsCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MaxValidatorsCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Nominators(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Nominators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "Nominators"; + type Value = runtime_types::pallet_staking::Nominations< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CounterForNominators; + impl ::subxt::StorageEntry for CounterForNominators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CounterForNominators"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MaxNominatorsCount; + impl ::subxt::StorageEntry for MaxNominatorsCount { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "MaxNominatorsCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentEra; + impl ::subxt::StorageEntry for CurrentEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CurrentEra"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ActiveEra; + impl ::subxt::StorageEntry for ActiveEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ActiveEra"; + type Value = runtime_types::pallet_staking::ActiveEraInfo; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ErasStartSessionIndex(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasStartSessionIndex { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasStartSessionIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasStakers( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ErasStakers { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasStakers"; + type Value = runtime_types::pallet_staking::Exposure< + ::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, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ErasStakersClipped( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ErasStakersClipped { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasStakersClipped"; + type Value = runtime_types::pallet_staking::Exposure< + ::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, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ErasValidatorPrefs( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ErasValidatorPrefs { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasValidatorPrefs"; + type Value = runtime_types::pallet_staking::ValidatorPrefs; + 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 ErasValidatorReward(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasValidatorReward { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasValidatorReward"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasRewardPoints(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasRewardPoints { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasRewardPoints"; + type Value = runtime_types::pallet_staking::EraRewardPoints< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasTotalStake(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ErasTotalStake { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasTotalStake"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ForceEra; + impl ::subxt::StorageEntry for ForceEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ForceEra"; + type Value = runtime_types::pallet_staking::Forcing; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SlashRewardFraction; + impl ::subxt::StorageEntry for SlashRewardFraction { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "SlashRewardFraction"; + type Value = runtime_types::sp_arithmetic::per_things::Perbill; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CanceledSlashPayout; + impl ::subxt::StorageEntry for CanceledSlashPayout { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CanceledSlashPayout"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UnappliedSlashes(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for UnappliedSlashes { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "UnappliedSlashes"; + type Value = ::std::vec::Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::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 BondedEras; + impl ::subxt::StorageEntry for BondedEras { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "BondedEras"; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ValidatorSlashInEra( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ValidatorSlashInEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ValidatorSlashInEra"; + type Value = ( + runtime_types::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + ); + 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 NominatorSlashInEra( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for NominatorSlashInEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "NominatorSlashInEra"; + type Value = ::core::primitive::u128; + 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 SlashingSpans(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SlashingSpans { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "SlashingSpans"; + type Value = runtime_types::pallet_staking::slashing::SlashingSpans; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct SpanSlash( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + ); + impl ::subxt::StorageEntry for SpanSlash { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "SpanSlash"; + type Value = runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct EarliestUnappliedSlash; + impl ::subxt::StorageEntry for EarliestUnappliedSlash { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "EarliestUnappliedSlash"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentPlannedSession; + impl ::subxt::StorageEntry for CurrentPlannedSession { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "CurrentPlannedSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct OffendingValidators; + impl ::subxt::StorageEntry for OffendingValidators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "OffendingValidators"; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_staking::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ChillThreshold; + impl ::subxt::StorageEntry for ChillThreshold { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ChillThreshold"; + type Value = runtime_types::sp_arithmetic::per_things::Percent; + 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 history_depth( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = HistoryDepth; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validator_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ValidatorCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn minimum_validator_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = MinimumValidatorCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn invulnerables( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Invulnerables; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn bonded( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Bonded(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bonded_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Bonded>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn min_nominator_bond( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + let entry = MinNominatorBond; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn min_validator_bond( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + let entry = MinValidatorBond; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn ledger( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::StakingLedger< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + let entry = Ledger(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn ledger_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Ledger>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn payee( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ::subxt::BasicError, + > { + let entry = Payee(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn payee_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Payee>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn validators( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::ValidatorPrefs, + ::subxt::BasicError, + > { + let entry = Validators(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validators_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Validators>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn counter_for_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = CounterForValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn max_validators_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = MaxValidatorsCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominators( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::Nominations< + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::BasicError, + > { + let entry = Nominators(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominators_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Nominators>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn counter_for_nominators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = CounterForNominators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn max_nominators_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = MaxNominatorsCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = CurrentEra; + self.client.storage().fetch(&entry, hash).await + } + pub async fn active_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + let entry = ActiveEra; + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_start_session_index( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = ErasStartSessionIndex(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_start_session_index_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStartSessionIndex>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_stakers( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ::subxt::BasicError, + > { + let entry = ErasStakers(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_stakers_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStakers>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_stakers_clipped( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ::subxt::BasicError, + > { + let entry = ErasStakersClipped(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_stakers_clipped_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStakersClipped>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_validator_prefs( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::ValidatorPrefs, + ::subxt::BasicError, + > { + let entry = ErasValidatorPrefs(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_validator_prefs_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasValidatorPrefs>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_validator_reward( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::BasicError, + > { + let entry = ErasValidatorReward(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_validator_reward_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasValidatorReward>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_reward_points( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::EraRewardPoints< + ::subxt::sp_core::crypto::AccountId32, + >, + ::subxt::BasicError, + > { + let entry = ErasRewardPoints(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_reward_points_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasRewardPoints>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_total_stake( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + let entry = ErasTotalStake(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_total_stake_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasTotalStake>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn force_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Forcing, + ::subxt::BasicError, + > { + let entry = ForceEra; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn slash_reward_fraction( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Perbill, + ::subxt::BasicError, + > { + let entry = SlashRewardFraction; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn canceled_slash_payout( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + let entry = CanceledSlashPayout; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn unapplied_slashes( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + let entry = UnappliedSlashes(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn unapplied_slashes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, UnappliedSlashes>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn bonded_eras( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, + ::subxt::BasicError, + > { + let entry = BondedEras; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validator_slash_in_era( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + runtime_types::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + )>, + ::subxt::BasicError, + > { + let entry = ValidatorSlashInEra(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn validator_slash_in_era_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ValidatorSlashInEra>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn nominator_slash_in_era( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::BasicError, + > { + let entry = NominatorSlashInEra(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominator_slash_in_era_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, NominatorSlashInEra>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn slashing_spans( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + ::subxt::BasicError, + > { + let entry = SlashingSpans(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn slashing_spans_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SlashingSpans>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn span_slash( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >, + ::subxt::BasicError, + > { + let entry = SpanSlash(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn span_slash_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SpanSlash>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn earliest_unapplied_slash( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = EarliestUnappliedSlash; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_planned_session( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = CurrentPlannedSession; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn offending_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>, + ::subxt::BasicError, + > { + let entry = OffendingValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Releases, + ::subxt::BasicError, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn chill_threshold( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ::subxt::BasicError, + > { + let entry = ChillThreshold; + self.client.storage().fetch(&entry, hash).await + } + } + } + } pub mod offences { use super::runtime_types; pub type Event = runtime_types::pallet_offences::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Offence( pub [::core::primitive::u8; 16usize], pub ::std::vec::Vec<::core::primitive::u8>, @@ -1948,7 +4170,13 @@ pub mod api { const STORAGE: &'static str = "Reports"; type Value = runtime_types::sp_staking::offence::OffenceDetails< ::subxt::sp_core::crypto::AccountId32, - (::subxt::sp_core::crypto::AccountId32, ()), + ( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( @@ -1958,8 +4186,8 @@ pub mod api { } } pub struct ConcurrentReportsIndex( - [::core::primitive::u8; 16usize], - ::std::vec::Vec<::core::primitive::u8>, + pub [::core::primitive::u8; 16usize], + pub ::std::vec::Vec<::core::primitive::u8>, ); impl ::subxt::StorageEntry for ConcurrentReportsIndex { const PALLET: &'static str = "Offences"; @@ -2005,10 +4233,16 @@ pub mod api { ::core::option::Option< runtime_types::sp_staking::offence::OffenceDetails< ::subxt::sp_core::crypto::AccountId32, - (::subxt::sp_core::crypto::AccountId32, ()), + ( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Reports(_0); self.client.storage().fetch(&entry, hash).await @@ -2018,7 +4252,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Reports>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2029,7 +4263,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec<::subxt::sp_core::H256>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ConcurrentReportsIndex(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await @@ -2039,7 +4273,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, ConcurrentReportsIndex>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2049,7 +4283,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec<::core::primitive::u8>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ReportsByKindIndex(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -2059,7 +4293,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, ReportsByKindIndex>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2073,43 +4307,51 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetKeys { - pub keys: runtime_types::rococo_runtime::SessionKeys, + pub keys: runtime_types::polkadot_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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn set_keys( &self, - keys: runtime_types::rococo_runtime::SessionKeys, + keys: runtime_types::polkadot_runtime::SessionKeys, proof: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetKeys, DispatchError> + { let call = SetKeys { keys, proof }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn purge_keys(&self) -> ::subxt::SubmittableExtrinsic { + pub fn purge_keys( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, PurgeKeys, DispatchError> + { let call = PurgeKeys {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -2118,7 +4360,7 @@ pub mod api { pub type Event = runtime_types::pallet_session::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct NewSession(pub ::core::primitive::u32); impl ::subxt::Event for NewSession { const PALLET: &'static str = "Session"; @@ -2160,7 +4402,7 @@ pub mod api { const STORAGE: &'static str = "QueuedKeys"; type Value = ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::SessionKeys, + runtime_types::polkadot_runtime::SessionKeys, )>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain @@ -2179,7 +4421,7 @@ pub mod api { impl ::subxt::StorageEntry for NextKeys { const PALLET: &'static str = "Session"; const STORAGE: &'static str = "NextKeys"; - type Value = runtime_types::rococo_runtime::SessionKeys; + type Value = runtime_types::polkadot_runtime::SessionKeys; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -2188,8 +4430,8 @@ pub mod api { } } pub struct KeyOwner( - runtime_types::sp_core::crypto::KeyTypeId, - ::std::vec::Vec<::core::primitive::u8>, + pub runtime_types::sp_core::crypto::KeyTypeId, + pub ::std::vec::Vec<::core::primitive::u8>, ); impl ::subxt::StorageEntry for KeyOwner { const PALLET: &'static str = "Session"; @@ -2214,7 +4456,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Validators; self.client.storage().fetch_or_default(&entry, hash).await @@ -2222,7 +4464,7 @@ pub mod api { pub async fn current_index( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = CurrentIndex; self.client.storage().fetch_or_default(&entry, hash).await @@ -2230,7 +4472,7 @@ pub mod api { pub async fn queued_changed( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> { let entry = QueuedChanged; self.client.storage().fetch_or_default(&entry, hash).await @@ -2241,9 +4483,9 @@ pub mod api { ) -> ::core::result::Result< ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::SessionKeys, + runtime_types::polkadot_runtime::SessionKeys, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = QueuedKeys; self.client.storage().fetch_or_default(&entry, hash).await @@ -2253,7 +4495,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = DisabledValidators; self.client.storage().fetch_or_default(&entry, hash).await @@ -2263,8 +4505,8 @@ pub mod api { _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, + ::core::option::Option, + ::subxt::BasicError, > { let entry = NextKeys(_0); self.client.storage().fetch(&entry, hash).await @@ -2274,7 +4516,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, NextKeys>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2285,7 +4527,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = KeyOwner(_0, _1); self.client.storage().fetch(&entry, hash).await @@ -2295,7 +4537,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, KeyOwner>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2306,7 +4548,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReportEquivocation { pub equivocation_proof: runtime_types::sp_finality_grandpa::EquivocationProof< @@ -2319,7 +4562,7 @@ pub mod api { const PALLET: &'static str = "Grandpa"; const FUNCTION: &'static str = "report_equivocation"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReportEquivocationUnsigned { pub equivocation_proof: runtime_types::sp_finality_grandpa::EquivocationProof< @@ -2332,7 +4575,7 @@ pub mod api { const PALLET: &'static str = "Grandpa"; const FUNCTION: &'static str = "report_equivocation_unsigned"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct NoteStalled { pub delay: ::core::primitive::u32, pub best_finalized_block_number: ::core::primitive::u32, @@ -2341,25 +4584,34 @@ pub mod api { const PALLET: &'static str = "Grandpa"; const FUNCTION: &'static str = "note_stalled"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } 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, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ReportEquivocation, + DispatchError, + > { let call = ReportEquivocation { equivocation_proof, key_owner_proof, @@ -2370,8 +4622,14 @@ pub mod api { &self, equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , :: core :: primitive :: u32 >, key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ReportEquivocationUnsigned, + DispatchError, + > { let call = ReportEquivocationUnsigned { equivocation_proof, key_owner_proof, @@ -2382,7 +4640,8 @@ pub mod api { &self, delay: ::core::primitive::u32, best_finalized_block_number: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, NoteStalled, DispatchError> + { let call = NoteStalled { delay, best_finalized_block_number, @@ -2394,7 +4653,7 @@ pub mod api { pub type Event = runtime_types::pallet_grandpa::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct NewAuthorities( pub ::std::vec::Vec<( runtime_types::sp_finality_grandpa::app::Public, @@ -2405,13 +4664,13 @@ pub mod api { const PALLET: &'static str = "Grandpa"; const EVENT: &'static str = "NewAuthorities"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Paused {} impl ::subxt::Event for Paused { const PALLET: &'static str = "Grandpa"; const EVENT: &'static str = "Paused"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Resumed {} impl ::subxt::Event for Resumed { const PALLET: &'static str = "Grandpa"; @@ -2492,7 +4751,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = State; self.client.storage().fetch_or_default(&entry, hash).await @@ -2506,7 +4765,7 @@ pub mod api { ::core::primitive::u32, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = PendingChange; self.client.storage().fetch(&entry, hash).await @@ -2516,7 +4775,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = NextForced; self.client.storage().fetch(&entry, hash).await @@ -2529,7 +4788,7 @@ pub mod api { ::core::primitive::u32, ::core::primitive::u32, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Stalled; self.client.storage().fetch(&entry, hash).await @@ -2537,7 +4796,7 @@ pub mod api { pub async fn current_set_id( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> { let entry = CurrentSetId; self.client.storage().fetch_or_default(&entry, hash).await @@ -2548,7 +4807,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = SetIdSession(_0); self.client.storage().fetch(&entry, hash).await @@ -2558,7 +4817,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, SetIdSession>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2569,7 +4828,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Heartbeat { pub heartbeat: runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, @@ -2580,18 +4840,21 @@ pub mod api { const PALLET: &'static str = "ImOnline"; const FUNCTION: &'static str = "heartbeat"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn heartbeat( &self, @@ -2599,7 +4862,8 @@ pub mod api { ::core::primitive::u32, >, signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Heartbeat, DispatchError> + { let call = Heartbeat { heartbeat, signature, @@ -2611,7 +4875,7 @@ pub mod api { pub type Event = runtime_types::pallet_im_online::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct HeartbeatReceived( pub runtime_types::pallet_im_online::sr25519::app_sr25519::Public, ); @@ -2619,15 +4883,21 @@ pub mod api { const PALLET: &'static str = "ImOnline"; const EVENT: &'static str = "HeartbeatReceived"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct AllGood {} impl ::subxt::Event for AllGood { const PALLET: &'static str = "ImOnline"; const EVENT: &'static str = "AllGood"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SomeOffline( - pub ::std::vec::Vec<(::subxt::sp_core::crypto::AccountId32, ())>, + pub ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + )>, ); impl ::subxt::Event for SomeOffline { const PALLET: &'static str = "ImOnline"; @@ -2654,7 +4924,10 @@ pub mod api { ::subxt::StorageEntryKey::Plain } } - pub struct ReceivedHeartbeats(::core::primitive::u32, ::core::primitive::u32); + pub struct ReceivedHeartbeats( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); impl ::subxt::StorageEntry for ReceivedHeartbeats { const PALLET: &'static str = "ImOnline"; const STORAGE: &'static str = "ReceivedHeartbeats"; @@ -2675,8 +4948,8 @@ pub mod api { } } pub struct AuthoredBlocks( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, ); impl ::subxt::StorageEntry for AuthoredBlocks { const PALLET: &'static str = "ImOnline"; @@ -2705,11 +4978,11 @@ pub mod api { pub async fn heartbeat_after( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = HeartbeatAfter; self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn keys (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > , :: subxt :: Error >{ + } pub async fn keys (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Public > , :: subxt :: BasicError >{ let entry = Keys; self.client.storage().fetch_or_default(&entry, hash).await } @@ -2724,7 +4997,7 @@ pub mod api { runtime_types::pallet_im_online::BoundedOpaqueNetworkState, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ReceivedHeartbeats(_0, _1); self.client.storage().fetch(&entry, hash).await @@ -2734,7 +5007,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, ReceivedHeartbeats>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2743,7 +5016,7 @@ pub mod api { _0: ::core::primitive::u32, _1: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = AuthoredBlocks(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await @@ -2753,7 +5026,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, AuthoredBlocks>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -2763,6 +5036,6043 @@ pub mod api { pub mod authority_discovery { use super::runtime_types; } + pub mod democracy { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Propose { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Second { + #[codec(compact)] + pub proposal: ::core::primitive::u32, + #[codec(compact)] + pub seconds_upper_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Second { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "second"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vote { + #[codec(compact)] + pub ref_index: ::core::primitive::u32, + pub vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EmergencyCancel { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Call for EmergencyCancel { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "emergency_cancel"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExternalPropose { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for ExternalPropose { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExternalProposeMajority { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for ExternalProposeMajority { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose_majority"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExternalProposeDefault { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for ExternalProposeDefault { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose_default"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct FastTrack { + pub proposal_hash: ::subxt::sp_core::H256, + pub voting_period: ::core::primitive::u32, + pub delay: ::core::primitive::u32, + } + impl ::subxt::Call for FastTrack { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "fast_track"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VetoExternal { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for VetoExternal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "veto_external"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelReferendum { + #[codec(compact)] + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::Call for CancelReferendum { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_referendum"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelQueued { + pub which: ::core::primitive::u32, + } + impl ::subxt::Call for CancelQueued { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_queued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Delegate { + pub to: ::subxt::sp_core::crypto::AccountId32, + pub conviction: runtime_types::pallet_democracy::conviction::Conviction, + pub balance: ::core::primitive::u128, + } + impl ::subxt::Call for Delegate { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "delegate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Undelegate {} + impl ::subxt::Call for Undelegate { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "undelegate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClearPublicProposals {} + impl ::subxt::Call for ClearPublicProposals { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "clear_public_proposals"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NotePreimage { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NotePreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NotePreimageOperational { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NotePreimageOperational { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage_operational"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NoteImminentPreimage { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NoteImminentPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_imminent_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NoteImminentPreimageOperational { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for NoteImminentPreimageOperational { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_imminent_preimage_operational"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReapPreimage { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub proposal_len_upper_bound: ::core::primitive::u32, + } + impl ::subxt::Call for ReapPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "reap_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Unlock { + pub target: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for Unlock { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "unlock"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveVote { + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for RemoveVote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "remove_vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveOtherVote { + pub target: ::subxt::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for RemoveOtherVote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "remove_other_vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EnactProposal { + pub proposal_hash: ::subxt::sp_core::H256, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for EnactProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "enact_proposal"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Blacklist { + pub proposal_hash: ::subxt::sp_core::H256, + pub maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + } + impl ::subxt::Call for Blacklist { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "blacklist"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelProposal { + #[codec(compact)] + pub prop_index: ::core::primitive::u32, + } + impl ::subxt::Call for CancelProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Propose, DispatchError> + { + let call = Propose { + proposal_hash, + value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn second( + &self, + proposal: ::core::primitive::u32, + seconds_upper_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Second, DispatchError> + { + let call = Second { + proposal, + seconds_upper_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Vote, DispatchError> + { + let call = Vote { ref_index, vote }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn emergency_cancel( + &self, + ref_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + EmergencyCancel, + DispatchError, + > { + let call = EmergencyCancel { ref_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ExternalPropose, + DispatchError, + > { + let call = ExternalPropose { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose_majority( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ExternalProposeMajority, + DispatchError, + > { + let call = ExternalProposeMajority { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose_default( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ExternalProposeDefault, + DispatchError, + > { + let call = ExternalProposeDefault { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn fast_track( + &self, + proposal_hash: ::subxt::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, FastTrack, DispatchError> + { + let call = FastTrack { + proposal_hash, + voting_period, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn veto_external( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, VetoExternal, DispatchError> + { + let call = VetoExternal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_referendum( + &self, + ref_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + CancelReferendum, + DispatchError, + > { + let call = CancelReferendum { ref_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_queued( + &self, + which: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, CancelQueued, DispatchError> + { + let call = CancelQueued { which }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn delegate( + &self, + to: ::subxt::sp_core::crypto::AccountId32, + conviction: runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Delegate, DispatchError> + { + let call = Delegate { + to, + conviction, + balance, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn undelegate( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Undelegate, DispatchError> + { + let call = Undelegate {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_public_proposals( + &self, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ClearPublicProposals, + DispatchError, + > { + let call = ClearPublicProposals {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_preimage( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, NotePreimage, DispatchError> + { + let call = NotePreimage { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_preimage_operational( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + NotePreimageOperational, + DispatchError, + > { + let call = NotePreimageOperational { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_imminent_preimage( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + NoteImminentPreimage, + DispatchError, + > { + let call = NoteImminentPreimage { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_imminent_preimage_operational( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + NoteImminentPreimageOperational, + DispatchError, + > { + let call = NoteImminentPreimageOperational { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reap_preimage( + &self, + proposal_hash: ::subxt::sp_core::H256, + proposal_len_upper_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ReapPreimage, DispatchError> + { + let call = ReapPreimage { + proposal_hash, + proposal_len_upper_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unlock( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Unlock, DispatchError> + { + let call = Unlock { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_vote( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RemoveVote, DispatchError> + { + let call = RemoveVote { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_other_vote( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RemoveOtherVote, + DispatchError, + > { + let call = RemoveOtherVote { target, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn enact_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + EnactProposal, + DispatchError, + > { + let call = EnactProposal { + proposal_hash, + index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn blacklist( + &self, + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Blacklist, DispatchError> + { + let call = Blacklist { + proposal_hash, + maybe_ref_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_proposal( + &self, + prop_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + CancelProposal, + DispatchError, + > { + let call = CancelProposal { prop_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_democracy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proposed(pub ::core::primitive::u32, pub ::core::primitive::u128); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Tabled( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ); + impl ::subxt::Event for Tabled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Tabled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExternalTabled {} + impl ::subxt::Event for ExternalTabled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "ExternalTabled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Started( + pub ::core::primitive::u32, + pub runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ); + impl ::subxt::Event for Started { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Started"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Passed(pub ::core::primitive::u32); + impl ::subxt::Event for Passed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Passed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NotPassed(pub ::core::primitive::u32); + impl ::subxt::Event for NotPassed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "NotPassed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Cancelled(pub ::core::primitive::u32); + impl ::subxt::Event for Cancelled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Cancelled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Executed( + pub ::core::primitive::u32, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Executed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Executed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Delegated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Delegated { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Delegated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Undelegated(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Undelegated { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Undelegated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vetoed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for Vetoed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Vetoed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PreimageNoted( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for PreimageNoted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageNoted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PreimageUsed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for PreimageUsed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageUsed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PreimageInvalid( + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for PreimageInvalid { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageInvalid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PreimageMissing( + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for PreimageMissing { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageMissing"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PreimageReaped( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for PreimageReaped { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageReaped"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Blacklisted(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Blacklisted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Blacklisted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct PublicPropCount; + impl ::subxt::StorageEntry for PublicPropCount { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "PublicPropCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct PublicProps; + impl ::subxt::StorageEntry for PublicProps { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "PublicProps"; + type Value = ::std::vec::Vec<( + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DepositOf(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for DepositOf { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "DepositOf"; + type Value = ( + ::std::vec::Vec<::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 Preimages(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Preimages { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Preimages"; + type Value = runtime_types::pallet_democracy::PreimageStatus< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct ReferendumCount; + impl ::subxt::StorageEntry for ReferendumCount { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "ReferendumCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct LowestUnbaked; + impl ::subxt::StorageEntry for LowestUnbaked { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "LowestUnbaked"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ReferendumInfoOf(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ReferendumInfoOf { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "ReferendumInfoOf"; + type Value = runtime_types::pallet_democracy::types::ReferendumInfo< + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct VotingOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for VotingOf { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "VotingOf"; + type Value = runtime_types::pallet_democracy::vote::Voting< + ::core::primitive::u128, + ::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 Locks(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Locks { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Locks"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct LastTabledWasExternal; + impl ::subxt::StorageEntry for LastTabledWasExternal { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "LastTabledWasExternal"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextExternal; + impl ::subxt::StorageEntry for NextExternal { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "NextExternal"; + type Value = ( + ::subxt::sp_core::H256, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Blacklist(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Blacklist { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Blacklist"; + type Value = ( + ::core::primitive::u32, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Cancellations(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Cancellations { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Cancellations"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_democracy::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 public_prop_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = PublicPropCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn public_props( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<( + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + )>, + ::subxt::BasicError, + > { + let entry = PublicProps; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn deposit_of( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::core::primitive::u128, + )>, + ::subxt::BasicError, + > { + let entry = DepositOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn deposit_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, DepositOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn preimages( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_democracy::PreimageStatus< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + ::subxt::BasicError, + > { + let entry = Preimages(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn preimages_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Preimages>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn referendum_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ReferendumCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lowest_unbaked( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = LowestUnbaked; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn referendum_info_of( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_democracy::types::ReferendumInfo< + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + let entry = ReferendumInfoOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn referendum_info_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ReferendumInfoOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn voting_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_democracy::vote::Voting< + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ::subxt::BasicError, + > { + let entry = VotingOf(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn voting_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, VotingOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn locks( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = Locks(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn locks_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Locks>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn last_tabled_was_external( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + let entry = LastTabledWasExternal; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn next_external( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::H256, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + )>, + ::subxt::BasicError, + > { + let entry = NextExternal; + self.client.storage().fetch(&entry, hash).await + } + pub async fn blacklist( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + )>, + ::subxt::BasicError, + > { + let entry = Blacklist(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn blacklist_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Blacklist>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn cancellations( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::BasicError> + { + let entry = Cancellations(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn cancellations_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Cancellations>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + let entry = StorageVersion; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod council { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 = "Council"; + const FUNCTION: &'static str = "set_members"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Execute { + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Execute { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "execute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 = "Council"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 = "Council"; + const FUNCTION: &'static str = "close"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DisapproveProposal { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for DisapproveProposal { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "disapprove_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + 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, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetMembers, DispatchError> + { + let call = SetMembers { + new_members, + prime, + old_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn execute( + &self, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Execute, DispatchError> + { + let call = Execute { + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Propose, DispatchError> + { + let call = Propose { + threshold, + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Vote, DispatchError> + { + let call = Vote { + proposal, + index, + approve, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Close, DispatchError> + { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + DisapproveProposal, + DispatchError, + > { + let call = DisapproveProposal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proposed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Voted( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub ::core::primitive::bool, + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for Voted { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Voted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Approved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Approved { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Approved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Disapproved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Disapproved { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Disapproved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Executed( + pub ::subxt::sp_core::H256, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Executed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Executed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MemberExecuted( + pub ::subxt::sp_core::H256, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for MemberExecuted { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "MemberExecuted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Closed( + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for Closed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Closed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proposals; + impl ::subxt::StorageEntry for Proposals { + const PALLET: &'static str = "Council"; + 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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for ProposalOf { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "ProposalOf"; + type Value = runtime_types::polkadot_runtime::Call; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Voting(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Voting { + const PALLET: &'static str = "Council"; + 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 = "Council"; + 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 = "Council"; + 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 = "Council"; + 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 } + } + pub async fn proposals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >, + ::subxt::BasicError, + > { + let entry = Proposals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposal_of( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + let entry = ProposalOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposal_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ProposalOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::H256, + 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 entry = Voting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Voting>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod technical_committee { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 = "TechnicalCommittee"; + const FUNCTION: &'static str = "set_members"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Execute { + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Execute { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "execute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "propose"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 = "TechnicalCommittee"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 = "TechnicalCommittee"; + const FUNCTION: &'static str = "close"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DisapproveProposal { + pub proposal_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for DisapproveProposal { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "disapprove_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + 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, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetMembers, DispatchError> + { + let call = SetMembers { + new_members, + prime, + old_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn execute( + &self, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Execute, DispatchError> + { + let call = Execute { + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Propose, DispatchError> + { + let call = Propose { + threshold, + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Vote, DispatchError> + { + let call = Vote { + proposal, + index, + approve, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Close, DispatchError> + { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + DisapproveProposal, + DispatchError, + > { + let call = DisapproveProposal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proposed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Voted( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub ::core::primitive::bool, + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for Voted { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Voted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Approved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Approved { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Approved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Disapproved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Disapproved { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Disapproved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Executed( + pub ::subxt::sp_core::H256, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Executed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Executed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MemberExecuted( + pub ::subxt::sp_core::H256, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for MemberExecuted { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "MemberExecuted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Closed( + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for Closed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Closed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proposals; + impl ::subxt::StorageEntry for Proposals { + const PALLET: &'static str = "TechnicalCommittee"; + 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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for ProposalOf { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "ProposalOf"; + type Value = runtime_types::polkadot_runtime::Call; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Voting(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Voting { + const PALLET: &'static str = "TechnicalCommittee"; + 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 = "TechnicalCommittee"; + 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 = "TechnicalCommittee"; + 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 = "TechnicalCommittee"; + 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 } + } + pub async fn proposals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >, + ::subxt::BasicError, + > { + let entry = Proposals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposal_of( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + let entry = ProposalOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposal_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ProposalOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::H256, + 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 entry = Voting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Voting>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod phragmen_election { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vote { + pub votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveVoter {} + impl ::subxt::Call for RemoveVoter { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "remove_voter"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SubmitCandidacy { + #[codec(compact)] + pub candidate_count: ::core::primitive::u32, + } + impl ::subxt::Call for SubmitCandidacy { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "submit_candidacy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RenounceCandidacy { + pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + } + impl ::subxt::Call for RenounceCandidacy { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "renounce_candidacy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveMember { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub has_replacement: ::core::primitive::bool, + } + impl ::subxt::Call for RemoveMember { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "remove_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CleanDefunctVoters { + pub num_voters: ::core::primitive::u32, + pub num_defunct: ::core::primitive::u32, + } + impl ::subxt::Call for CleanDefunctVoters { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "clean_defunct_voters"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn vote( + &self, + votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Vote, DispatchError> + { + let call = Vote { votes, value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_voter( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RemoveVoter, DispatchError> + { + let call = RemoveVoter {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit_candidacy( + &self, + candidate_count: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SubmitCandidacy, + DispatchError, + > { + let call = SubmitCandidacy { candidate_count }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn renounce_candidacy( + &self, + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RenounceCandidacy, + DispatchError, + > { + let call = RenounceCandidacy { renouncing }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_member( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + has_replacement: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RemoveMember, DispatchError> + { + let call = RemoveMember { + who, + has_replacement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clean_defunct_voters( + &self, + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + CleanDefunctVoters, + DispatchError, + > { + let call = CleanDefunctVoters { + num_voters, + num_defunct, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NewTerm( + pub ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ); + impl ::subxt::Event for NewTerm { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "NewTerm"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EmptyTerm {} + impl ::subxt::Event for EmptyTerm { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "EmptyTerm"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ElectionError {} + impl ::subxt::Event for ElectionError { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "ElectionError"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MemberKicked(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for MemberKicked { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "MemberKicked"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Renounced(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Renounced { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "Renounced"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CandidateSlashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for CandidateSlashed { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "CandidateSlashed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SeatHolderSlashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for SeatHolderSlashed { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "SeatHolderSlashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "Members"; + type Value = ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct RunnersUp; + impl ::subxt::StorageEntry for RunnersUp { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "RunnersUp"; + type Value = ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Candidates; + impl ::subxt::StorageEntry for Candidates { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "Candidates"; + type Value = ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ElectionRounds; + impl ::subxt::StorageEntry for ElectionRounds { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "ElectionRounds"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Voting(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Voting { + const PALLET: &'static str = "PhragmenElection"; + const STORAGE: &'static str = "Voting"; + type Value = runtime_types::pallet_elections_phragmen::Voter< + ::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 } + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn runners_up( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + let entry = RunnersUp; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn candidates( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ::subxt::BasicError, + > { + let entry = Candidates; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn election_rounds( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ElectionRounds; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_elections_phragmen::Voter< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ::subxt::BasicError, + > { + let entry = Voting(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Voting>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod technical_membership { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddMember { + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for AddMember { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "add_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveMember { + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for RemoveMember { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "remove_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 = "TechnicalMembership"; + const FUNCTION: &'static str = "swap_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ResetMembers { + pub members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for ResetMembers { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "reset_members"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ChangeKey { + pub new: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ChangeKey { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "change_key"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetPrime { + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for SetPrime { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "set_prime"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClearPrime {} + impl ::subxt::Call for ClearPrime { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "clear_prime"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn add_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AddMember, DispatchError> + { + let call = AddMember { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RemoveMember, DispatchError> + { + let call = RemoveMember { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn swap_member( + &self, + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SwapMember, DispatchError> + { + let call = SwapMember { remove, add }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reset_members( + &self, + members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ResetMembers, DispatchError> + { + let call = ResetMembers { members }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn change_key( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ChangeKey, DispatchError> + { + let call = ChangeKey { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_prime( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetPrime, DispatchError> + { + let call = SetPrime { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_prime( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ClearPrime, DispatchError> + { + let call = ClearPrime {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_membership::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MemberAdded {} + impl ::subxt::Event for MemberAdded { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MemberAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MemberRemoved {} + impl ::subxt::Event for MemberRemoved { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MemberRemoved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MembersSwapped {} + impl ::subxt::Event for MembersSwapped { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MembersSwapped"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MembersReset {} + impl ::subxt::Event for MembersReset { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MembersReset"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct KeyChanged {} + impl ::subxt::Event for KeyChanged { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "KeyChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Dummy {} + impl ::subxt::Event for Dummy { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "Dummy"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "TechnicalMembership"; + 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 = "TechnicalMembership"; + 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 } + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::BasicError, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod treasury { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProposeSpend { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for ProposeSpend { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "propose_spend"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RejectProposal { + #[codec(compact)] + pub proposal_id: ::core::primitive::u32, + } + impl ::subxt::Call for RejectProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "reject_proposal"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ApproveProposal { + #[codec(compact)] + pub proposal_id: ::core::primitive::u32, + } + impl ::subxt::Call for ApproveProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "approve_proposal"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn propose_spend( + &self, + value: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ProposeSpend, DispatchError> + { + let call = ProposeSpend { value, beneficiary }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reject_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RejectProposal, + DispatchError, + > { + let call = RejectProposal { proposal_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ApproveProposal, + DispatchError, + > { + let call = ApproveProposal { proposal_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_treasury::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proposed(pub ::core::primitive::u32); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Spending(pub ::core::primitive::u128); + impl ::subxt::Event for Spending { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Spending"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Awarded( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Awarded { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Awarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rejected(pub ::core::primitive::u32, pub ::core::primitive::u128); + impl ::subxt::Event for Rejected { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rejected"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Burnt(pub ::core::primitive::u128); + impl ::subxt::Event for Burnt { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Burnt"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rollover(pub ::core::primitive::u128); + impl ::subxt::Event for Rollover { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rollover"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Deposit(pub ::core::primitive::u128); + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Deposit"; + } + } + pub mod storage { + use super::runtime_types; + pub struct ProposalCount; + impl ::subxt::StorageEntry for ProposalCount { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "ProposalCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Proposals(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Proposals { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "Proposals"; + type Value = runtime_types::pallet_treasury::Proposal< + ::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 Approvals; + impl ::subxt::StorageEntry for Approvals { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "Approvals"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::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 } + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposals( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_treasury::Proposal< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + let entry = Proposals(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposals_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Proposals>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn approvals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u32, + >, + ::subxt::BasicError, + > { + let entry = Approvals; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod claims { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Claim { + pub dest: ::subxt::sp_core::crypto::AccountId32, + pub ethereum_signature: + runtime_types::polkadot_runtime_common::claims::EcdsaSignature, + } + impl ::subxt::Call for Claim { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "claim"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MintClaim { + pub who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub value: ::core::primitive::u128, + pub vesting_schedule: ::core::option::Option<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>, + pub statement: ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + } + impl ::subxt::Call for MintClaim { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "mint_claim"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClaimAttest { + pub dest: ::subxt::sp_core::crypto::AccountId32, + pub ethereum_signature: + runtime_types::polkadot_runtime_common::claims::EcdsaSignature, + pub statement: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for ClaimAttest { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "claim_attest"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Attest { + pub statement: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for Attest { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "attest"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MoveClaim { + pub old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub maybe_preclaim: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for MoveClaim { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "move_claim"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn claim( + &self, + dest: ::subxt::sp_core::crypto::AccountId32, + ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Claim, DispatchError> + { + let call = Claim { + dest, + ethereum_signature, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn mint_claim( + &self, + who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + value: ::core::primitive::u128, + vesting_schedule: ::core::option::Option<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>, + statement: ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, MintClaim, DispatchError> + { + let call = MintClaim { + who, + value, + vesting_schedule, + statement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn claim_attest( + &self, + dest: ::subxt::sp_core::crypto::AccountId32, + ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, + statement: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ClaimAttest, DispatchError> + { + let call = ClaimAttest { + dest, + ethereum_signature, + statement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn attest( + &self, + statement: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Attest, DispatchError> + { + let call = Attest { statement }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn move_claim( + &self, + old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + maybe_preclaim: ::core::option::Option< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, MoveClaim, DispatchError> + { + let call = MoveClaim { + old, + new, + maybe_preclaim, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::claims::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Claimed( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Claimed { + const PALLET: &'static str = "Claims"; + const EVENT: &'static str = "Claimed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Claims( + pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Claims { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Claims"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Total; + impl ::subxt::StorageEntry for Total { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Total"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Vesting( + pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Vesting { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Vesting"; + type Value = ( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Signing( + pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Signing { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Signing"; + type Value = + runtime_types::polkadot_runtime_common::claims::StatementKind; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Preclaims(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Preclaims { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Preclaims"; + type Value = + runtime_types::polkadot_runtime_common::claims::EthereumAddress; + 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 } + } + pub async fn claims( + &self, + _0: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::BasicError, + > { + let entry = Claims(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn claims_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Claims>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn total( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + let entry = Total; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn vesting( + &self, + _0: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u128, + ::core::primitive::u128, + ::core::primitive::u32, + )>, + ::subxt::BasicError, + > { + let entry = Vesting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn vesting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Vesting>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn signing( + &self, + _0: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + ::subxt::BasicError, + > { + let entry = Signing(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn signing_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Signing>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn preclaims( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + >, + ::subxt::BasicError, + > { + let entry = Preclaims(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn preclaims_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Preclaims>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod vesting { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Vest {} + impl ::subxt::Call for Vest { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VestOther { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for VestOther { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest_other"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VestedTransfer { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for VestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vested_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceVestedTransfer { + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for ForceVestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "force_vested_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MergeSchedules { + pub schedule1_index: ::core::primitive::u32, + pub schedule2_index: ::core::primitive::u32, + } + impl ::subxt::Call for MergeSchedules { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "merge_schedules"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn vest( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Vest, DispatchError> + { + let call = Vest {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vest_other( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, VestOther, DispatchError> + { + let call = VestOther { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vested_transfer( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + VestedTransfer, + DispatchError, + > { + let call = VestedTransfer { target, schedule }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_vested_transfer( + &self, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceVestedTransfer, + DispatchError, + > { + let call = ForceVestedTransfer { + source, + target, + schedule, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn merge_schedules( + &self, + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + MergeSchedules, + DispatchError, + > { + let call = MergeSchedules { + schedule1_index, + schedule2_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VestingUpdated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for VestingUpdated { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct VestingCompleted(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for VestingCompleted { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingCompleted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Vesting(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Vesting { + const PALLET: &'static str = "Vesting"; + const STORAGE: &'static str = "Vesting"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >; + 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 = "Vesting"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_vesting::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 vesting( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + >, + ::subxt::BasicError, + > { + let entry = Vesting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn vesting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Vesting>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_vesting::Releases, + ::subxt::BasicError, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod utility { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AsDerivative { + pub index: ::core::primitive::u16, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for AsDerivative { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "as_derivative"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DispatchAs { + pub as_origin: runtime_types::polkadot_runtime::OriginCaller, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for DispatchAs { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "dispatch_as"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn batch( + &self, + calls: ::std::vec::Vec, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Batch, DispatchError> + { + let call = Batch { calls }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn as_derivative( + &self, + index: ::core::primitive::u16, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AsDerivative, DispatchError> + { + let call = AsDerivative { index, call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn batch_all( + &self, + calls: ::std::vec::Vec, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, BatchAll, DispatchError> + { + let call = BatchAll { calls }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn dispatch_as( + &self, + as_origin: runtime_types::polkadot_runtime::OriginCaller, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, DispatchAs, DispatchError> + { + let call = DispatchAs { as_origin, call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_utility::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BatchInterrupted( + pub ::core::primitive::u32, + pub runtime_types::sp_runtime::DispatchError, + ); + impl ::subxt::Event for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BatchCompleted {} + impl ::subxt::Event for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ItemCompleted {} + impl ::subxt::Event for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DispatchedAs( + pub ::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 identity { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddRegistrar { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for AddRegistrar { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "add_registrar"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetIdentity { + pub info: runtime_types::pallet_identity::types::IdentityInfo, + } + impl ::subxt::Call for SetIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_identity"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetSubs { + pub subs: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + } + impl ::subxt::Call for SetSubs { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_subs"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClearIdentity {} + impl ::subxt::Call for ClearIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "clear_identity"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RequestJudgement { + #[codec(compact)] + pub reg_index: ::core::primitive::u32, + #[codec(compact)] + pub max_fee: ::core::primitive::u128, + } + impl ::subxt::Call for RequestJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "request_judgement"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CancelRequest { + pub reg_index: ::core::primitive::u32, + } + impl ::subxt::Call for CancelRequest { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "cancel_request"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetFee { + #[codec(compact)] + pub index: ::core::primitive::u32, + #[codec(compact)] + pub fee: ::core::primitive::u128, + } + impl ::subxt::Call for SetFee { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_fee"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetAccountId { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub new: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for SetAccountId { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_account_id"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetFields { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + } + impl ::subxt::Call for SetFields { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_fields"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProvideJudgement { + #[codec(compact)] + pub reg_index: ::core::primitive::u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + } + impl ::subxt::Call for ProvideJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "provide_judgement"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct KillIdentity { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for KillIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "kill_identity"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub data: runtime_types::pallet_identity::types::Data, + } + impl ::subxt::Call for AddSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "add_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RenameSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub data: runtime_types::pallet_identity::types::Data, + } + impl ::subxt::Call for RenameSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "rename_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for RemoveSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "remove_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct QuitSub {} + impl ::subxt::Call for QuitSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "quit_sub"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn add_registrar( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AddRegistrar, DispatchError> + { + let call = AddRegistrar { account }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_identity( + &self, + info: runtime_types::pallet_identity::types::IdentityInfo, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetIdentity, DispatchError> + { + let call = SetIdentity { info }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_subs( + &self, + subs: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetSubs, DispatchError> + { + let call = SetSubs { subs }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_identity( + &self, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ClearIdentity, + DispatchError, + > { + let call = ClearIdentity {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn request_judgement( + &self, + reg_index: ::core::primitive::u32, + max_fee: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RequestJudgement, + DispatchError, + > { + let call = RequestJudgement { reg_index, max_fee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_request( + &self, + reg_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + CancelRequest, + DispatchError, + > { + let call = CancelRequest { reg_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_fee( + &self, + index: ::core::primitive::u32, + fee: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetFee, DispatchError> + { + let call = SetFee { index, fee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_account_id( + &self, + index: ::core::primitive::u32, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetAccountId, DispatchError> + { + let call = SetAccountId { index, new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_fields( + &self, + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SetFields, DispatchError> + { + let call = SetFields { index, fields }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn provide_judgement( + &self, + reg_index: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ProvideJudgement, + DispatchError, + > { + let call = ProvideJudgement { + reg_index, + target, + judgement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_identity( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, KillIdentity, DispatchError> + { + let call = KillIdentity { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AddSub, DispatchError> + { + let call = AddSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn rename_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RenameSub, DispatchError> + { + let call = RenameSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RemoveSub, DispatchError> + { + let call = RemoveSub { sub }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn quit_sub( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, QuitSub, DispatchError> + { + let call = QuitSub {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_identity::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IdentitySet(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for IdentitySet { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentitySet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IdentityCleared( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for IdentityCleared { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IdentityKilled( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for IdentityKilled { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityKilled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct JudgementRequested( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for JudgementRequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementRequested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct JudgementUnrequested( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for JudgementUnrequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementUnrequested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct JudgementGiven( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for JudgementGiven { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementGiven"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RegistrarAdded(pub ::core::primitive::u32); + impl ::subxt::Event for RegistrarAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "RegistrarAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SubIdentityAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for SubIdentityAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SubIdentityRemoved( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for SubIdentityRemoved { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRemoved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SubIdentityRevoked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for SubIdentityRevoked { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRevoked"; + } + } + pub mod storage { + use super::runtime_types; + pub struct IdentityOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for IdentityOf { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "IdentityOf"; + type Value = runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct SuperOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SuperOf { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "SuperOf"; + type Value = ( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct SubsOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SubsOf { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "SubsOf"; + type Value = ( + ::core::primitive::u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Registrars; + impl ::subxt::StorageEntry for Registrars { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "Registrars"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_identity::types::RegistrarInfo< + ::core::primitive::u128, + ::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 } + } + pub async fn identity_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >, + >, + ::subxt::BasicError, + > { + let entry = IdentityOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn identity_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, IdentityOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn super_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ::subxt::BasicError, + > { + let entry = SuperOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn super_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SuperOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn subs_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ( + ::core::primitive::u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + ::subxt::BasicError, + > { + let entry = SubsOf(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn subs_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SubsOf>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn registrars( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_identity::types::RegistrarInfo< + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >, + ::subxt::BasicError, + > { + let entry = Registrars; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod proxy { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proxy { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: + ::core::option::Option, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for Proxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AddProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RemoveProxies {} + impl ::subxt::Call for RemoveProxies { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_proxies"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Anonymous { + pub proxy_type: runtime_types::polkadot_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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct KillAnonymous { + pub spawner: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_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 :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, 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: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ProxyAnnounced { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy_announced"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn proxy( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::polkadot_runtime::ProxyType, + >, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Proxy, DispatchError> + { + let call = Proxy { + real, + force_proxy_type, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AddProxy, DispatchError> + { + let call = AddProxy { + delegate, + proxy_type, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RemoveProxy, DispatchError> + { + let call = RemoveProxy { + delegate, + proxy_type, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_proxies( + &self, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RemoveProxies, + DispatchError, + > { + let call = RemoveProxies {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn anonymous( + &self, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + index: ::core::primitive::u16, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Anonymous, DispatchError> + { + let call = Anonymous { + proxy_type, + delay, + index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_anonymous( + &self, + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + index: ::core::primitive::u16, + height: ::core::primitive::u32, + ext_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + KillAnonymous, + DispatchError, + > { + let call = KillAnonymous { + spawner, + proxy_type, + index, + height, + ext_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn announce( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Announce, DispatchError> + { + let call = Announce { real, call_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_announcement( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RemoveAnnouncement, + DispatchError, + > { + let call = RemoveAnnouncement { real, call_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reject_announcement( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + RejectAnnouncement, + DispatchError, + > { + let call = RejectAnnouncement { + delegate, + call_hash, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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::polkadot_runtime::ProxyType, + >, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ProxyAnnounced, + DispatchError, + > { + let call = ProxyAnnounced { + delegate, + real, + force_proxy_type, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_proxy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProxyExecuted( + pub ::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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AnonymousCreated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_runtime::ProxyType, + pub ::core::primitive::u16, + ); + impl ::subxt::Event for AnonymousCreated { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "AnonymousCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Announced( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + ); + impl ::subxt::Event for Announced { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "Announced"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProxyAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_runtime::ProxyType, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for ProxyAdded { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyAdded"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proxies(pub ::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::polkadot_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(pub ::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 } + } + pub async fn proxies( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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::polkadot_runtime::ProxyType, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ), + ::subxt::BasicError, + > { + let entry = Proxies(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proxies_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Proxies>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn announcements( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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 entry = Announcements(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn announcements_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Announcements>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod multisig { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AsMultiThreshold1 { + pub other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for AsMultiThreshold1 { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi_threshold1"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, 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, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn as_multi_threshold1( + &self, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + AsMultiThreshold1, + DispatchError, + > { + let call = AsMultiThreshold1 { + other_signatories, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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< + runtime_types::polkadot_runtime::Call, + >, + store_call: ::core::primitive::bool, + max_weight: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AsMulti, DispatchError> + { + let call = AsMulti { + threshold, + other_signatories, + maybe_timepoint, + call, + store_call, + max_weight, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ApproveAsMulti, + DispatchError, + > { + let call = ApproveAsMulti { + threshold, + other_signatories, + maybe_timepoint, + call_hash, + max_weight, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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], + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + CancelAsMulti, + DispatchError, + > { + let call = CancelAsMulti { + threshold, + other_signatories, + timepoint, + call_hash, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NewMultisig( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::core::primitive::u8; 32usize], + ); + impl ::subxt::Event for NewMultisig { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "NewMultisig"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MultisigApproval( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::core::primitive::u8; 32usize], + ); + impl ::subxt::Event for MultisigApproval { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigApproval"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MultisigExecuted( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::core::primitive::u8; 32usize], + pub ::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 :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct MultisigCancelled( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::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( + pub ::subxt::sp_core::crypto::AccountId32, + pub [::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(pub [::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 } + } + pub async fn multisigs( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: [::core::primitive::u8; 32usize], + 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 entry = Multisigs(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn multisigs_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Multisigs>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn calls( + &self, + _0: [::core::primitive::u8; 32usize], + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::WrapperKeepOpaque, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ::subxt::BasicError, + > { + let entry = Calls(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn calls_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Calls>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod bounties { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProposeBounty { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub description: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for ProposeBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ApproveBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for ApproveBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "approve_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProposeCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub fee: ::core::primitive::u128, + } + impl ::subxt::Call for ProposeCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnassignCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for UnassignCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "unassign_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AcceptCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for AcceptCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "accept_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct AwardBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + } + impl ::subxt::Call for AwardBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "award_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ClaimBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for ClaimBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "claim_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CloseBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for CloseBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "close_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ExtendBountyExpiry { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub remark: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::Call for ExtendBountyExpiry { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "extend_bounty_expiry"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn propose_bounty( + &self, + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ProposeBounty, + DispatchError, + > { + let call = ProposeBounty { value, description }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ApproveBounty, + DispatchError, + > { + let call = ApproveBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose_curator( + &self, + bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + fee: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ProposeCurator, + DispatchError, + > { + let call = ProposeCurator { + bounty_id, + curator, + fee, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unassign_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + UnassignCurator, + DispatchError, + > { + let call = UnassignCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn accept_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + AcceptCurator, + DispatchError, + > { + let call = AcceptCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn award_bounty( + &self, + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AwardBounty, DispatchError> + { + let call = AwardBounty { + bounty_id, + beneficiary, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn claim_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ClaimBounty, DispatchError> + { + let call = ClaimBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, CloseBounty, DispatchError> + { + let call = CloseBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn extend_bounty_expiry( + &self, + bounty_id: ::core::primitive::u32, + remark: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ExtendBountyExpiry, + DispatchError, + > { + let call = ExtendBountyExpiry { bounty_id, remark }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_bounties::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BountyProposed(pub ::core::primitive::u32); + impl ::subxt::Event for BountyProposed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyProposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BountyRejected( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for BountyRejected { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyRejected"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BountyBecameActive(pub ::core::primitive::u32); + impl ::subxt::Event for BountyBecameActive { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyBecameActive"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BountyAwarded( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for BountyAwarded { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyAwarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BountyClaimed( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for BountyClaimed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyClaimed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BountyCanceled(pub ::core::primitive::u32); + impl ::subxt::Event for BountyCanceled { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyCanceled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct BountyExtended(pub ::core::primitive::u32); + impl ::subxt::Event for BountyExtended { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyExtended"; + } + } + pub mod storage { + use super::runtime_types; + pub struct BountyCount; + impl ::subxt::StorageEntry for BountyCount { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Bounties(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Bounties { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "Bounties"; + type Value = runtime_types::pallet_bounties::Bounty< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct BountyDescriptions(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for BountyDescriptions { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyDescriptions"; + 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 BountyApprovals; + impl ::subxt::StorageEntry for BountyApprovals { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyApprovals"; + type Value = ::std::vec::Vec<::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 } + } + pub async fn bounty_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = BountyCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn bounties( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_bounties::Bounty< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + ::subxt::BasicError, + > { + let entry = Bounties(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bounties_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Bounties>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn bounty_descriptions( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ::subxt::BasicError, + > { + let entry = BountyDescriptions(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bounty_descriptions_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, BountyDescriptions>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn bounty_approvals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = BountyApprovals; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod tips { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReportAwesome { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ReportAwesome { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "report_awesome"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RetractTip { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for RetractTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "retract_tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TipNew { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, + } + impl ::subxt::Call for TipNew { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip_new"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Tip { + pub hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, + } + impl ::subxt::Call for Tip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CloseTip { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for CloseTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "close_tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SlashTip { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for SlashTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "slash_tip"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn report_awesome( + &self, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ReportAwesome, + DispatchError, + > { + let call = ReportAwesome { reason, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn retract_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, RetractTip, DispatchError> + { + let call = RetractTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn tip_new( + &self, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + tip_value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, TipNew, DispatchError> + { + let call = TipNew { + reason, + who, + tip_value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn tip( + &self, + hash: ::subxt::sp_core::H256, + tip_value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Tip, DispatchError> + { + let call = Tip { hash, tip_value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, CloseTip, DispatchError> + { + let call = CloseTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn slash_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, SlashTip, DispatchError> + { + let call = SlashTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_tips::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NewTip(pub ::subxt::sp_core::H256); + impl ::subxt::Event for NewTip { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "NewTip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TipClosing(pub ::subxt::sp_core::H256); + impl ::subxt::Event for TipClosing { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosing"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TipClosed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for TipClosed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TipRetracted(pub ::subxt::sp_core::H256); + impl ::subxt::Event for TipRetracted { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipRetracted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TipSlashed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for TipSlashed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipSlashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Tips(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Tips { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Tips"; + type Value = runtime_types::pallet_tips::OpenTip< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Reasons(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Reasons { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Reasons"; + 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 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 tips( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_tips::OpenTip< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::sp_core::H256, + >, + >, + ::subxt::BasicError, + > { + let entry = Tips(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn tips_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Tips>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn reasons( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ::subxt::BasicError, + > { + let entry = Reasons(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn reasons_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Reasons>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod election_provider_multi_phase { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SubmitUnsigned { pub raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > , pub witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize } + impl ::subxt::Call for SubmitUnsigned { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit_unsigned"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetMinimumUntrustedScore { + pub maybe_next_score: + ::core::option::Option<[::core::primitive::u128; 3usize]>, + } + impl ::subxt::Call for SetMinimumUntrustedScore { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "set_minimum_untrusted_score"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetEmergencyElectionResult { + pub supports: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + } + impl ::subxt::Call for SetEmergencyElectionResult { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "set_emergency_election_result"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Submit { + pub raw_solution: + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::polkadot_runtime::NposCompactSolution16, + >, + pub num_signed_submissions: ::core::primitive::u32, + } + impl ::subxt::Call for Submit { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn submit_unsigned( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, + witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SubmitUnsigned, + DispatchError, + > { + let call = SubmitUnsigned { + raw_solution, + witness, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_minimum_untrusted_score( + &self, + maybe_next_score: ::core::option::Option< + [::core::primitive::u128; 3usize], + >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMinimumUntrustedScore, + DispatchError, + > { + let call = SetMinimumUntrustedScore { maybe_next_score }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_emergency_election_result( + &self, + supports: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetEmergencyElectionResult, + DispatchError, + > { + let call = SetEmergencyElectionResult { supports }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, + num_signed_submissions: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Submit, DispatchError> + { + let call = Submit { + raw_solution, + num_signed_submissions, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = + runtime_types::pallet_election_provider_multi_phase::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SolutionStored( + pub runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + pub ::core::primitive::bool, + ); + impl ::subxt::Event for SolutionStored { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SolutionStored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ElectionFinalized( + pub ::core::option::Option< + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + >, + ); + impl ::subxt::Event for ElectionFinalized { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "ElectionFinalized"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rewarded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Slashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Slashed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SignedPhaseStarted(pub ::core::primitive::u32); + impl ::subxt::Event for SignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SignedPhaseStarted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnsignedPhaseStarted(pub ::core::primitive::u32); + impl ::subxt::Event for UnsignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "UnsignedPhaseStarted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Round; + impl ::subxt::StorageEntry for Round { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "Round"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentPhase; + impl ::subxt::StorageEntry for CurrentPhase { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "CurrentPhase"; + type Value = runtime_types::pallet_election_provider_multi_phase::Phase< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct QueuedSolution; + impl ::subxt::StorageEntry for QueuedSolution { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "QueuedSolution"; + type Value = + runtime_types::pallet_election_provider_multi_phase::ReadySolution< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Snapshot; + impl ::subxt::StorageEntry for Snapshot { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "Snapshot"; + type Value = + runtime_types::pallet_election_provider_multi_phase::RoundSnapshot< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DesiredTargets; + impl ::subxt::StorageEntry for DesiredTargets { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "DesiredTargets"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SnapshotMetadata; + impl ::subxt::StorageEntry for SnapshotMetadata { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SnapshotMetadata"; + type Value = runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionNextIndex; + impl ::subxt::StorageEntry for SignedSubmissionNextIndex { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionNextIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionIndices; + impl ::subxt::StorageEntry for SignedSubmissionIndices { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionIndices"; + type Value = runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionsMap(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for SignedSubmissionsMap { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionsMap"; + type Value = runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct MinimumUntrustedScore; + impl ::subxt::StorageEntry for MinimumUntrustedScore { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "MinimumUntrustedScore"; + type Value = [::core::primitive::u128; 3usize]; + 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 round( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = Round; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_phase( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_election_provider_multi_phase::Phase< + ::core::primitive::u32, + >, + ::subxt::BasicError, + > { + let entry = CurrentPhase; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn queued_solution (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: BasicError >{ + let entry = QueuedSolution; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: BasicError >{ + let entry = Snapshot; + self.client.storage().fetch(&entry, hash).await + } + pub async fn desired_targets( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = DesiredTargets; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: BasicError >{ + let entry = SnapshotMetadata; + self.client.storage().fetch(&entry, hash).await + } + pub async fn signed_submission_next_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = SignedSubmissionNextIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > , :: subxt :: BasicError >{ + let entry = SignedSubmissionIndices; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submissions_map (& self , _0 : :: core :: primitive :: u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > , :: subxt :: BasicError >{ + let entry = SignedSubmissionsMap(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn signed_submissions_map_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SignedSubmissionsMap>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn minimum_untrusted_score( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<[::core::primitive::u128; 3usize]>, + ::subxt::BasicError, + > { + let entry = MinimumUntrustedScore; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod bags_list { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rebag { + pub dislocated: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for Rebag { + const PALLET: &'static str = "BagsList"; + const FUNCTION: &'static str = "rebag"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn rebag( + &self, + dislocated: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Rebag, DispatchError> + { + let call = Rebag { dislocated }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_bags_list::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rebagged( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u64, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for Rebagged { + const PALLET: &'static str = "BagsList"; + const EVENT: &'static str = "Rebagged"; + } + } + pub mod storage { + use super::runtime_types; + pub struct ListNodes(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for ListNodes { + const PALLET: &'static str = "BagsList"; + const STORAGE: &'static str = "ListNodes"; + type Value = runtime_types::pallet_bags_list::list::Node; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct CounterForListNodes; + impl ::subxt::StorageEntry for CounterForListNodes { + const PALLET: &'static str = "BagsList"; + const STORAGE: &'static str = "CounterForListNodes"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ListBags(pub ::core::primitive::u64); + impl ::subxt::StorageEntry for ListBags { + const PALLET: &'static str = "BagsList"; + const STORAGE: &'static str = "ListBags"; + type Value = runtime_types::pallet_bags_list::list::Bag; + 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 } + } + pub async fn list_nodes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + let entry = ListNodes(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn list_nodes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ListNodes>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn counter_for_list_nodes( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = CounterForListNodes; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn list_bags( + &self, + _0: ::core::primitive::u64, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::BasicError, + > { + let entry = ListBags(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn list_bags_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ListBags>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + } + } + } pub mod parachains_origin { use super::runtime_types; } @@ -2770,7 +11080,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetValidationUpgradeFrequency { pub new: ::core::primitive::u32, } @@ -2778,7 +11089,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_validation_upgrade_frequency"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetValidationUpgradeDelay { pub new: ::core::primitive::u32, } @@ -2786,7 +11097,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_validation_upgrade_delay"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetCodeRetentionPeriod { pub new: ::core::primitive::u32, } @@ -2794,7 +11105,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_code_retention_period"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxCodeSize { pub new: ::core::primitive::u32, } @@ -2802,7 +11113,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_code_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxPovSize { pub new: ::core::primitive::u32, } @@ -2810,7 +11121,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_pov_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxHeadDataSize { pub new: ::core::primitive::u32, } @@ -2818,7 +11129,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_head_data_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetParathreadCores { pub new: ::core::primitive::u32, } @@ -2826,7 +11137,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_parathread_cores"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetParathreadRetries { pub new: ::core::primitive::u32, } @@ -2834,7 +11145,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_parathread_retries"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetGroupRotationFrequency { pub new: ::core::primitive::u32, } @@ -2842,7 +11153,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_group_rotation_frequency"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetChainAvailabilityPeriod { pub new: ::core::primitive::u32, } @@ -2850,7 +11161,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_chain_availability_period"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetThreadAvailabilityPeriod { pub new: ::core::primitive::u32, } @@ -2858,7 +11169,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_thread_availability_period"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetSchedulingLookahead { pub new: ::core::primitive::u32, } @@ -2866,7 +11177,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_scheduling_lookahead"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxValidatorsPerCore { pub new: ::core::option::Option<::core::primitive::u32>, } @@ -2874,7 +11185,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_validators_per_core"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxValidators { pub new: ::core::option::Option<::core::primitive::u32>, } @@ -2882,7 +11193,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_validators"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetDisputePeriod { pub new: ::core::primitive::u32, } @@ -2890,7 +11201,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_dispute_period"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetDisputePostConclusionAcceptancePeriod { pub new: ::core::primitive::u32, } @@ -2899,7 +11210,7 @@ pub mod api { const FUNCTION: &'static str = "set_dispute_post_conclusion_acceptance_period"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetDisputeMaxSpamSlots { pub new: ::core::primitive::u32, } @@ -2907,7 +11218,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_dispute_max_spam_slots"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetDisputeConclusionByTimeOutPeriod { pub new: ::core::primitive::u32, } @@ -2916,7 +11227,7 @@ pub mod api { const FUNCTION: &'static str = "set_dispute_conclusion_by_time_out_period"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetNoShowSlots { pub new: ::core::primitive::u32, } @@ -2924,7 +11235,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_no_show_slots"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetNDelayTranches { pub new: ::core::primitive::u32, } @@ -2932,7 +11243,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_n_delay_tranches"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetZerothDelayTrancheWidth { pub new: ::core::primitive::u32, } @@ -2940,7 +11251,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_zeroth_delay_tranche_width"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetNeededApprovals { pub new: ::core::primitive::u32, } @@ -2948,7 +11259,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_needed_approvals"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetRelayVrfModuloSamples { pub new: ::core::primitive::u32, } @@ -2956,7 +11267,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_relay_vrf_modulo_samples"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxUpwardQueueCount { pub new: ::core::primitive::u32, } @@ -2964,7 +11275,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_upward_queue_count"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxUpwardQueueSize { pub new: ::core::primitive::u32, } @@ -2972,7 +11283,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_upward_queue_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxDownwardMessageSize { pub new: ::core::primitive::u32, } @@ -2980,7 +11291,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_downward_message_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetUmpServiceTotalWeight { pub new: ::core::primitive::u64, } @@ -2988,7 +11299,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_ump_service_total_weight"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxUpwardMessageSize { pub new: ::core::primitive::u32, } @@ -2996,7 +11307,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_upward_message_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetMaxUpwardMessageNumPerCandidate { pub new: ::core::primitive::u32, } @@ -3004,7 +11315,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_max_upward_message_num_per_candidate"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpOpenRequestTtl { pub new: ::core::primitive::u32, } @@ -3012,7 +11323,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_open_request_ttl"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpSenderDeposit { pub new: ::core::primitive::u128, } @@ -3020,7 +11331,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_sender_deposit"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpRecipientDeposit { pub new: ::core::primitive::u128, } @@ -3028,7 +11339,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_recipient_deposit"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpChannelMaxCapacity { pub new: ::core::primitive::u32, } @@ -3036,7 +11347,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_channel_max_capacity"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpChannelMaxTotalSize { pub new: ::core::primitive::u32, } @@ -3044,7 +11355,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_channel_max_total_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpMaxParachainInboundChannels { pub new: ::core::primitive::u32, } @@ -3052,7 +11363,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_max_parachain_inbound_channels"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpMaxParathreadInboundChannels { pub new: ::core::primitive::u32, } @@ -3060,7 +11371,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_max_parathread_inbound_channels"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpChannelMaxMessageSize { pub new: ::core::primitive::u32, } @@ -3068,7 +11379,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_channel_max_message_size"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpMaxParachainOutboundChannels { pub new: ::core::primitive::u32, } @@ -3076,7 +11387,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_max_parachain_outbound_channels"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpMaxParathreadOutboundChannels { pub new: ::core::primitive::u32, } @@ -3085,7 +11396,7 @@ pub mod api { const FUNCTION: &'static str = "set_hrmp_max_parathread_outbound_channels"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetHrmpMaxMessageNumPerCandidate { pub new: ::core::primitive::u32, } @@ -3093,7 +11404,7 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_hrmp_max_message_num_per_candidate"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetUmpMaxIndividualWeight { pub new: ::core::primitive::u64, } @@ -3101,132 +11412,229 @@ pub mod api { const PALLET: &'static str = "Configuration"; const FUNCTION: &'static str = "set_ump_max_individual_weight"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn set_validation_upgrade_frequency( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetValidationUpgradeFrequency, + DispatchError, + > { let call = SetValidationUpgradeFrequency { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_validation_upgrade_delay( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetValidationUpgradeDelay, + DispatchError, + > { let call = SetValidationUpgradeDelay { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_code_retention_period( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetCodeRetentionPeriod, + DispatchError, + > { let call = SetCodeRetentionPeriod { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_code_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxCodeSize, + DispatchError, + > { let call = SetMaxCodeSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_pov_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxPovSize, + DispatchError, + > { let call = SetMaxPovSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_head_data_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxHeadDataSize, + DispatchError, + > { let call = SetMaxHeadDataSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_parathread_cores( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetParathreadCores, + DispatchError, + > { let call = SetParathreadCores { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_parathread_retries( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetParathreadRetries, + DispatchError, + > { let call = SetParathreadRetries { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_group_rotation_frequency( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetGroupRotationFrequency, + DispatchError, + > { let call = SetGroupRotationFrequency { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_chain_availability_period( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetChainAvailabilityPeriod, + DispatchError, + > { let call = SetChainAvailabilityPeriod { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_thread_availability_period( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetThreadAvailabilityPeriod, + DispatchError, + > { let call = SetThreadAvailabilityPeriod { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_scheduling_lookahead( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetSchedulingLookahead, + DispatchError, + > { let call = SetSchedulingLookahead { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_validators_per_core( &self, new: ::core::option::Option<::core::primitive::u32>, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxValidatorsPerCore, + DispatchError, + > { let call = SetMaxValidatorsPerCore { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_validators( &self, new: ::core::option::Option<::core::primitive::u32>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxValidators, + DispatchError, + > { let call = SetMaxValidators { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_dispute_period( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetDisputePeriod, + DispatchError, + > { let call = SetDisputePeriod { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -3234,8 +11642,12 @@ pub mod api { &self, new: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< + 'a, T, + X, + A, SetDisputePostConclusionAcceptancePeriod, + DispatchError, > { let call = SetDisputePostConclusionAcceptancePeriod { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -3243,198 +11655,350 @@ pub mod api { pub fn set_dispute_max_spam_slots( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetDisputeMaxSpamSlots, + DispatchError, + > { let call = SetDisputeMaxSpamSlots { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_dispute_conclusion_by_time_out_period( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetDisputeConclusionByTimeOutPeriod, + DispatchError, + > { let call = SetDisputeConclusionByTimeOutPeriod { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_no_show_slots( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetNoShowSlots, + DispatchError, + > { let call = SetNoShowSlots { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_n_delay_tranches( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetNDelayTranches, + DispatchError, + > { let call = SetNDelayTranches { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_zeroth_delay_tranche_width( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetZerothDelayTrancheWidth, + DispatchError, + > { let call = SetZerothDelayTrancheWidth { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_needed_approvals( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetNeededApprovals, + DispatchError, + > { let call = SetNeededApprovals { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_relay_vrf_modulo_samples( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetRelayVrfModuloSamples, + DispatchError, + > { let call = SetRelayVrfModuloSamples { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_upward_queue_count( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxUpwardQueueCount, + DispatchError, + > { let call = SetMaxUpwardQueueCount { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_upward_queue_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxUpwardQueueSize, + DispatchError, + > { let call = SetMaxUpwardQueueSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_downward_message_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxDownwardMessageSize, + DispatchError, + > { let call = SetMaxDownwardMessageSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_ump_service_total_weight( &self, new: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetUmpServiceTotalWeight, + DispatchError, + > { let call = SetUmpServiceTotalWeight { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_upward_message_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxUpwardMessageSize, + DispatchError, + > { let call = SetMaxUpwardMessageSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_max_upward_message_num_per_candidate( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetMaxUpwardMessageNumPerCandidate, + DispatchError, + > { let call = SetMaxUpwardMessageNumPerCandidate { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_open_request_ttl( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpOpenRequestTtl, + DispatchError, + > { let call = SetHrmpOpenRequestTtl { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_sender_deposit( &self, new: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpSenderDeposit, + DispatchError, + > { let call = SetHrmpSenderDeposit { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_recipient_deposit( &self, new: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpRecipientDeposit, + DispatchError, + > { let call = SetHrmpRecipientDeposit { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_channel_max_capacity( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpChannelMaxCapacity, + DispatchError, + > { let call = SetHrmpChannelMaxCapacity { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_channel_max_total_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpChannelMaxTotalSize, + DispatchError, + > { let call = SetHrmpChannelMaxTotalSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_max_parachain_inbound_channels( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpMaxParachainInboundChannels, + DispatchError, + > { let call = SetHrmpMaxParachainInboundChannels { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_max_parathread_inbound_channels( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpMaxParathreadInboundChannels, + DispatchError, + > { let call = SetHrmpMaxParathreadInboundChannels { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_channel_max_message_size( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpChannelMaxMessageSize, + DispatchError, + > { let call = SetHrmpChannelMaxMessageSize { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_max_parachain_outbound_channels( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpMaxParachainOutboundChannels, + DispatchError, + > { let call = SetHrmpMaxParachainOutboundChannels { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_max_parathread_outbound_channels( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpMaxParathreadOutboundChannels, + DispatchError, + > { let call = SetHrmpMaxParathreadOutboundChannels { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_hrmp_max_message_num_per_candidate( &self, new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetHrmpMaxMessageNumPerCandidate, + DispatchError, + > { let call = SetHrmpMaxMessageNumPerCandidate { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_ump_max_individual_weight( &self, new: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + SetUmpMaxIndividualWeight, + DispatchError, + > { let call = SetUmpMaxIndividualWeight { new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -3469,10 +12033,10 @@ pub mod api { impl<'a, T: ::subxt::Config> StorageApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } - } pub async fn active_config (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > , :: subxt :: Error >{ + } pub async fn active_config (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > , :: subxt :: BasicError >{ let entry = ActiveConfig; self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn pending_config (& self , _0 : :: core :: primitive :: u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > > , :: subxt :: Error >{ + } pub async fn pending_config (& self , _0 : :: core :: primitive :: u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ let entry = PendingConfig(_0); self.client.storage().fetch(&entry, hash).await } @@ -3481,7 +12045,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, PendingConfig>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -3492,18 +12056,22 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } } } @@ -3550,7 +12118,7 @@ pub mod api { pub async fn current_session_index( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = CurrentSessionIndex; self.client.storage().fetch_or_default(&entry, hash).await @@ -3562,7 +12130,7 @@ pub mod api { ::std::vec::Vec< runtime_types::polkadot_primitives::v0::ValidatorIndex, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ActiveValidatorIndices; self.client.storage().fetch_or_default(&entry, hash).await @@ -3574,7 +12142,7 @@ pub mod api { ::std::vec::Vec< runtime_types::polkadot_primitives::v0::validator_app::Public, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ActiveValidatorKeys; self.client.storage().fetch_or_default(&entry, hash).await @@ -3586,18 +12154,22 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } } } @@ -3605,7 +12177,7 @@ pub mod api { runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CandidateBacked( pub runtime_types::polkadot_primitives::v1::CandidateReceipt< ::subxt::sp_core::H256, @@ -3618,7 +12190,7 @@ pub mod api { const PALLET: &'static str = "ParaInclusion"; const EVENT: &'static str = "CandidateBacked"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CandidateIncluded( pub runtime_types::polkadot_primitives::v1::CandidateReceipt< ::subxt::sp_core::H256, @@ -3631,7 +12203,7 @@ pub mod api { const PALLET: &'static str = "ParaInclusion"; const EVENT: &'static str = "CandidateIncluded"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CandidateTimedOut( pub runtime_types::polkadot_primitives::v1::CandidateReceipt< ::subxt::sp_core::H256, @@ -3696,7 +12268,7 @@ pub mod api { impl<'a, T: ::subxt::Config> StorageApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } - } pub async fn availability_bitfields (& self , _0 : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , :: subxt :: Error >{ + } pub async fn availability_bitfields (& self , _0 : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , 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 entry = AvailabilityBitfields(_0); self.client.storage().fetch(&entry, hash).await } @@ -3705,10 +12277,10 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, AvailabilityBitfields>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await - } pub async fn pending_availability (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , 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 :: Error >{ + } pub async fn pending_availability (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , 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 entry = PendingAvailability(_0); self.client.storage().fetch(&entry, hash).await } @@ -3717,7 +12289,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, PendingAvailability>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -3731,7 +12303,7 @@ pub mod api { ::core::primitive::u32, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = PendingAvailabilityCommitments(_0); self.client.storage().fetch(&entry, hash).await @@ -3741,7 +12313,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, PendingAvailabilityCommitments>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -3752,7 +12324,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Enter { pub data: runtime_types::polkadot_primitives::v1::InherentData< runtime_types::sp_runtime::generic::header::Header< @@ -3765,18 +12338,21 @@ pub mod api { const PALLET: &'static str = "ParaInherent"; const FUNCTION: &'static str = "enter"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn enter( &self, @@ -3786,7 +12362,8 @@ pub mod api { runtime_types::sp_runtime::traits::BlakeTwo256, >, >, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Enter, DispatchError> + { let call = Enter { data }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -3803,6 +12380,17 @@ pub mod api { ::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::v1::ScrapedOnChainVotes< + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } pub struct StorageApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } @@ -3813,11 +12401,25 @@ pub mod api { pub async fn included( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> { let entry = Included; self.client.storage().fetch(&entry, hash).await } + pub async fn on_chain_votes( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v1::ScrapedOnChainVotes< + ::subxt::sp_core::H256, + >, + >, + ::subxt::BasicError, + > { + let entry = OnChainVotes; + self.client.storage().fetch(&entry, hash).await + } } } } @@ -3906,11 +12508,11 @@ pub mod api { runtime_types::polkadot_primitives::v0::ValidatorIndex, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ValidatorGroups; self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn parathread_queue (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue , :: subxt :: Error >{ + } pub async fn parathread_queue (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue , :: subxt :: BasicError >{ let entry = ParathreadQueue; self.client.storage().fetch_or_default(&entry, hash).await } @@ -3923,7 +12525,7 @@ pub mod api { runtime_types::polkadot_primitives::v1::CoreOccupied, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = AvailabilityCores; self.client.storage().fetch_or_default(&entry, hash).await @@ -3933,7 +12535,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ParathreadClaimIndex; self.client.storage().fetch_or_default(&entry, hash).await @@ -3941,11 +12543,11 @@ pub mod api { pub async fn session_start_block( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = SessionStartBlock; self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn scheduled (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: CoreAssignment > , :: subxt :: Error >{ + } pub async fn scheduled (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: CoreAssignment > , :: subxt :: BasicError >{ let entry = Scheduled; self.client.storage().fetch_or_default(&entry, hash).await } @@ -3956,7 +12558,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceSetCurrentCode { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_code: @@ -3966,7 +12569,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const FUNCTION: &'static str = "force_set_current_code"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceSetCurrentHead { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, @@ -3975,7 +12578,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const FUNCTION: &'static str = "force_set_current_head"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceScheduleCodeUpgrade { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_code: @@ -3986,7 +12589,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const FUNCTION: &'static str = "force_schedule_code_upgrade"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceNoteNewHead { pub para: runtime_types::polkadot_parachain::primitives::Id, pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, @@ -3995,7 +12598,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const FUNCTION: &'static str = "force_note_new_head"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceQueueAction { pub para: runtime_types::polkadot_parachain::primitives::Id, } @@ -4003,25 +12606,34 @@ pub mod api { const PALLET: &'static str = "Paras"; const FUNCTION: &'static str = "force_queue_action"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn force_set_current_code( &self, para: runtime_types::polkadot_parachain::primitives::Id, new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceSetCurrentCode, + DispatchError, + > { let call = ForceSetCurrentCode { para, new_code }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -4029,8 +12641,14 @@ pub mod api { &self, para: runtime_types::polkadot_parachain::primitives::Id, new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceSetCurrentHead, + DispatchError, + > { let call = ForceSetCurrentHead { para, new_head }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -4039,8 +12657,14 @@ pub mod api { para: runtime_types::polkadot_parachain::primitives::Id, new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, relay_parent_number: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceScheduleCodeUpgrade, + DispatchError, + > { let call = ForceScheduleCodeUpgrade { para, new_code, @@ -4052,14 +12676,28 @@ pub mod api { &self, para: runtime_types::polkadot_parachain::primitives::Id, new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceNoteNewHead, + DispatchError, + > { let call = ForceNoteNewHead { para, new_head }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn force_queue_action( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceQueueAction, + DispatchError, + > { let call = ForceQueueAction { para }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -4068,7 +12706,7 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CurrentCodeUpdated( pub runtime_types::polkadot_parachain::primitives::Id, ); @@ -4076,7 +12714,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "CurrentCodeUpdated"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CurrentHeadUpdated( pub runtime_types::polkadot_parachain::primitives::Id, ); @@ -4084,7 +12722,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "CurrentHeadUpdated"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CodeUpgradeScheduled( pub runtime_types::polkadot_parachain::primitives::Id, ); @@ -4092,7 +12730,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "CodeUpgradeScheduled"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct NewHeadNoted( pub runtime_types::polkadot_parachain::primitives::Id, ); @@ -4100,7 +12738,7 @@ pub mod api { const PALLET: &'static str = "Paras"; const EVENT: &'static str = "NewHeadNoted"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ActionQueued( pub runtime_types::polkadot_parachain::primitives::Id, pub ::core::primitive::u32, @@ -4165,8 +12803,8 @@ pub mod api { } } pub struct PastCodeHash( - runtime_types::polkadot_parachain::primitives::Id, - ::core::primitive::u32, + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::core::primitive::u32, ); impl ::subxt::StorageEntry for PastCodeHash { const PALLET: &'static str = "Paras"; @@ -4359,7 +12997,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Parachains; self.client.storage().fetch_or_default(&entry, hash).await @@ -4372,7 +13010,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ParaLifecycles(_0); self.client.storage().fetch(&entry, hash).await @@ -4382,7 +13020,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, ParaLifecycles>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4394,7 +13032,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_parachain::primitives::HeadData, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Heads(_0); self.client.storage().fetch(&entry, hash).await @@ -4402,8 +13040,10 @@ pub mod api { pub async fn heads_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Heads>, ::subxt::Error> - { + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Heads>, + ::subxt::BasicError, + > { self.client.storage().iter(hash).await } pub async fn current_code_hash( @@ -4414,7 +13054,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_parachain::primitives::ValidationCodeHash, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = CurrentCodeHash(_0); self.client.storage().fetch(&entry, hash).await @@ -4424,7 +13064,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, CurrentCodeHash>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4437,7 +13077,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_parachain::primitives::ValidationCodeHash, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = PastCodeHash(_0, _1); self.client.storage().fetch(&entry, hash).await @@ -4447,7 +13087,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, PastCodeHash>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4459,7 +13099,7 @@ pub mod api { runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< ::core::primitive::u32, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = PastCodeMeta(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -4469,7 +13109,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, PastCodeMeta>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4481,7 +13121,7 @@ pub mod api { runtime_types::polkadot_parachain::primitives::Id, ::core::primitive::u32, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = PastCodePruning; self.client.storage().fetch_or_default(&entry, hash).await @@ -4492,7 +13132,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = FutureCodeUpgrades(_0); self.client.storage().fetch(&entry, hash).await @@ -4502,7 +13142,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, FutureCodeUpgrades>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4514,7 +13154,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_parachain::primitives::ValidationCodeHash, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = FutureCodeHash(_0); self.client.storage().fetch(&entry, hash).await @@ -4524,7 +13164,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, FutureCodeHash>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4536,7 +13176,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_primitives::v1::UpgradeGoAhead, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = UpgradeGoAheadSignal(_0); self.client.storage().fetch(&entry, hash).await @@ -4546,7 +13186,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, UpgradeGoAheadSignal>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4558,7 +13198,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_primitives::v1::UpgradeRestriction, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = UpgradeRestrictionSignal(_0); self.client.storage().fetch(&entry, hash).await @@ -4568,7 +13208,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, UpgradeRestrictionSignal>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4580,7 +13220,7 @@ pub mod api { runtime_types::polkadot_parachain::primitives::Id, ::core::primitive::u32, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = UpgradeCooldowns; self.client.storage().fetch_or_default(&entry, hash).await @@ -4593,7 +13233,7 @@ pub mod api { runtime_types::polkadot_parachain::primitives::Id, ::core::primitive::u32, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = UpcomingUpgrades; self.client.storage().fetch_or_default(&entry, hash).await @@ -4604,7 +13244,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ActionsQueue(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -4614,10 +13254,10 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, ActionsQueue>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await - } pub async fn upcoming_paras_genesis (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , :: subxt :: Error >{ + } pub async fn upcoming_paras_genesis (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , :: subxt :: BasicError >{ let entry = UpcomingParasGenesis(_0); self.client.storage().fetch(&entry, hash).await } @@ -4626,7 +13266,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, UpcomingParasGenesis>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4634,7 +13274,7 @@ pub mod api { &self, _0: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = CodeByHashRefs(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -4644,7 +13284,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, CodeByHashRefs>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4656,7 +13296,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_parachain::primitives::ValidationCode, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = CodeByHash(_0); self.client.storage().fetch(&entry, hash).await @@ -4666,7 +13306,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, CodeByHash>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4677,7 +13317,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceApprove { pub up_to: ::core::primitive::u32, } @@ -4685,23 +13326,27 @@ pub mod api { const PALLET: &'static str = "Initializer"; const FUNCTION: &'static str = "force_approve"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn force_approve( &self, up_to: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ForceApprove, DispatchError> + { let call = ForceApprove { up_to }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -4737,11 +13382,11 @@ pub mod api { pub async fn has_initialized( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> { let entry = HasInitialized; self.client.storage().fetch(&entry, hash).await - } pub async fn buffered_session_changes (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > , :: subxt :: Error >{ + } pub async fn buffered_session_changes (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: std :: vec :: Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > , :: subxt :: BasicError >{ let entry = BufferedSessionChanges; self.client.storage().fetch_or_default(&entry, hash).await } @@ -4752,18 +13397,22 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } } } @@ -4818,7 +13467,7 @@ pub mod api { ::core::primitive::u32, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = DownwardMessageQueues(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -4828,7 +13477,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, DownwardMessageQueues>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4836,7 +13485,7 @@ pub mod api { &self, _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::BasicError> { let entry = DownwardMessageQueueHeads(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -4846,7 +13495,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, DownwardMessageQueueHeads>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -4857,7 +13506,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ServiceOverweight { pub index: ::core::primitive::u64, pub weight_limit: ::core::primitive::u64, @@ -4866,24 +13516,34 @@ pub mod api { const PALLET: &'static str = "Ump"; const FUNCTION: &'static str = "service_overweight"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn service_overweight( &self, index: ::core::primitive::u64, weight_limit: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ServiceOverweight, + DispatchError, + > { let call = ServiceOverweight { index, weight_limit, @@ -4895,19 +13555,19 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ExecutedUpward( pub [::core::primitive::u8; 32usize], pub runtime_types::xcm::v2::traits::Outcome, @@ -4916,7 +13576,7 @@ pub mod api { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "ExecutedUpward"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct WeightExhausted( pub [::core::primitive::u8; 32usize], pub ::core::primitive::u64, @@ -4926,7 +13586,7 @@ pub mod api { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "WeightExhausted"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct UpwardMessagesReceived( pub runtime_types::polkadot_parachain::primitives::Id, pub ::core::primitive::u32, @@ -4936,7 +13596,7 @@ pub mod api { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "UpwardMessagesReceived"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct OverweightEnqueued( pub runtime_types::polkadot_parachain::primitives::Id, pub [::core::primitive::u8; 32usize], @@ -4947,7 +13607,7 @@ pub mod api { const PALLET: &'static str = "Ump"; const EVENT: &'static str = "OverweightEnqueued"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct OverweightServiced( pub ::core::primitive::u64, pub ::core::primitive::u64, @@ -5043,7 +13703,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = RelayDispatchQueues(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5053,7 +13713,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, RelayDispatchQueues>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5063,7 +13723,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< (::core::primitive::u32, ::core::primitive::u32), - ::subxt::Error, + ::subxt::BasicError, > { let entry = RelayDispatchQueueSize(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5073,7 +13733,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, RelayDispatchQueueSize>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5082,7 +13742,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec, - ::subxt::Error, + ::subxt::BasicError, > { let entry = NeedsDispatch; self.client.storage().fetch_or_default(&entry, hash).await @@ -5094,7 +13754,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = NextDispatchRoundStartWith; self.client.storage().fetch(&entry, hash).await @@ -5108,7 +13768,7 @@ pub mod api { runtime_types::polkadot_parachain::primitives::Id, ::std::vec::Vec<::core::primitive::u8>, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Overweight(_0); self.client.storage().fetch(&entry, hash).await @@ -5118,14 +13778,14 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Overweight>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } pub async fn overweight_count( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> { let entry = OverweightCount; self.client.storage().fetch_or_default(&entry, hash).await @@ -5137,7 +13797,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct HrmpInitOpenChannel { pub recipient: runtime_types::polkadot_parachain::primitives::Id, pub proposed_max_capacity: ::core::primitive::u32, @@ -5147,7 +13808,7 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "hrmp_init_open_channel"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct HrmpAcceptOpenChannel { pub sender: runtime_types::polkadot_parachain::primitives::Id, } @@ -5155,7 +13816,7 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "hrmp_accept_open_channel"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct HrmpCloseChannel { pub channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, @@ -5164,7 +13825,7 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "hrmp_close_channel"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceCleanHrmp { pub para: runtime_types::polkadot_parachain::primitives::Id, } @@ -5172,19 +13833,19 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "force_clean_hrmp"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceProcessHrmpOpen {} impl ::subxt::Call for ForceProcessHrmpOpen { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "force_process_hrmp_open"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceProcessHrmpClose {} impl ::subxt::Call for ForceProcessHrmpClose { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "force_process_hrmp_close"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct HrmpCancelOpenRequest { pub channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, @@ -5193,26 +13854,35 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "hrmp_cancel_open_request"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } 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, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + HrmpInitOpenChannel, + DispatchError, + > { let call = HrmpInitOpenChannel { recipient, proposed_max_capacity, @@ -5223,44 +13893,82 @@ pub mod api { pub fn hrmp_accept_open_channel( &self, sender: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + HrmpAcceptOpenChannel, + DispatchError, + > { let call = HrmpAcceptOpenChannel { sender }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn hrmp_close_channel( &self, channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + HrmpCloseChannel, + DispatchError, + > { let call = HrmpCloseChannel { channel_id }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn force_clean_hrmp( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceCleanHrmp, + DispatchError, + > { let call = ForceCleanHrmp { para }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn force_process_hrmp_open( &self, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceProcessHrmpOpen, + DispatchError, + > { let call = ForceProcessHrmpOpen {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn force_process_hrmp_close( &self, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceProcessHrmpClose, + DispatchError, + > { let call = ForceProcessHrmpClose {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn hrmp_cancel_open_request( &self, channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, - ) -> ::subxt::SubmittableExtrinsic - { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + HrmpCancelOpenRequest, + DispatchError, + > { let call = HrmpCancelOpenRequest { channel_id }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -5269,7 +13977,7 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct OpenChannelRequested( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_parachain::primitives::Id, @@ -5280,7 +13988,7 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const EVENT: &'static str = "OpenChannelRequested"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct OpenChannelCanceled( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, @@ -5289,7 +13997,7 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const EVENT: &'static str = "OpenChannelCanceled"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct OpenChannelAccepted( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_parachain::primitives::Id, @@ -5298,7 +14006,7 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const EVENT: &'static str = "OpenChannelAccepted"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ChannelClosed( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, @@ -5488,7 +14196,7 @@ pub mod api { impl<'a, T: ::subxt::Config> StorageApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } - } pub async fn hrmp_open_channel_requests (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , :: subxt :: Error >{ + } pub async fn hrmp_open_channel_requests (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , :: subxt :: BasicError >{ let entry = HrmpOpenChannelRequests(_0); self.client.storage().fetch(&entry, hash).await } @@ -5497,7 +14205,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpOpenChannelRequests>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5508,7 +14216,7 @@ pub mod api { ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::HrmpChannelId, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpOpenChannelRequestsList; self.client.storage().fetch_or_default(&entry, hash).await @@ -5517,7 +14225,7 @@ pub mod api { &self, _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = HrmpOpenChannelRequestCount(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5527,7 +14235,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpOpenChannelRequestCount>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5535,7 +14243,7 @@ pub mod api { &self, _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = HrmpAcceptedChannelRequestCount(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5545,7 +14253,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpAcceptedChannelRequestCount>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5553,7 +14261,7 @@ pub mod api { &self, _0: runtime_types::polkadot_parachain::primitives::HrmpChannelId, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> { let entry = HrmpCloseChannelRequests(_0); self.client.storage().fetch(&entry, hash).await @@ -5563,7 +14271,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5574,7 +14282,7 @@ pub mod api { ::std::vec::Vec< runtime_types::polkadot_parachain::primitives::HrmpChannelId, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpCloseChannelRequestsList; self.client.storage().fetch_or_default(&entry, hash).await @@ -5585,7 +14293,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpWatermarks(_0); self.client.storage().fetch(&entry, hash).await @@ -5595,7 +14303,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpWatermarks>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5607,7 +14315,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpChannels(_0); self.client.storage().fetch(&entry, hash).await @@ -5617,7 +14325,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpChannels>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5627,7 +14335,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpIngressChannelsIndex(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5637,7 +14345,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpIngressChannelsIndex>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5647,7 +14355,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpEgressChannelsIndex(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5657,7 +14365,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5671,7 +14379,7 @@ pub mod api { ::core::primitive::u32, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpChannelContents(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5681,7 +14389,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpChannelContents>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5696,7 +14404,7 @@ pub mod api { runtime_types::polkadot_parachain::primitives::Id, >, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = HrmpChannelDigests(_0); self.client.storage().fetch_or_default(&entry, hash).await @@ -5706,7 +14414,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, HrmpChannelDigests>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -5763,7 +14471,7 @@ pub mod api { ::std::vec::Vec< runtime_types::polkadot_primitives::v1::assignment_app::Public, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = AssignmentKeysUnsafe; self.client.storage().fetch_or_default(&entry, hash).await @@ -5771,7 +14479,7 @@ pub mod api { pub async fn earliest_stored_session( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = EarliestStoredSession; self.client.storage().fetch_or_default(&entry, hash).await @@ -5784,7 +14492,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_primitives::v1::SessionInfo, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Sessions(_0); self.client.storage().fetch(&entry, hash).await @@ -5794,229 +14502,19 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Sessions>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } } } } - pub mod paras_disputes { - use super::runtime_types; - pub type Event = - runtime_types::polkadot_runtime_parachains::disputes::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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( - ::core::primitive::u32, - 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::v1::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( - ::core::primitive::u32, - 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(pub ::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 } - } - pub async fn last_pruned_session( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = LastPrunedSession; - self.client.storage().fetch(&entry, hash).await - } - pub async fn disputes( - &self, - _0: ::core::primitive::u32, - _1: runtime_types::polkadot_core_primitives::CandidateHash, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v1::DisputeState< - ::core::primitive::u32, - >, - >, - ::subxt::Error, - > { - let entry = Disputes(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn disputes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Disputes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn included( - &self, - _0: ::core::primitive::u32, - _1: runtime_types::polkadot_core_primitives::CandidateHash, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = Included(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn included_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Included>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn spam_slots( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u32>>, - ::subxt::Error, - > { - let entry = SpamSlots(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn spam_slots_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SpamSlots>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn frozen( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = Frozen; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } pub mod registrar { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Register { pub id: runtime_types::polkadot_parachain::primitives::Id, pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, @@ -6027,7 +14525,7 @@ pub mod api { const PALLET: &'static str = "Registrar"; const FUNCTION: &'static str = "register"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceRegister { pub who: ::subxt::sp_core::crypto::AccountId32, pub deposit: ::core::primitive::u128, @@ -6040,7 +14538,7 @@ pub mod api { const PALLET: &'static str = "Registrar"; const FUNCTION: &'static str = "force_register"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Deregister { pub id: runtime_types::polkadot_parachain::primitives::Id, } @@ -6048,7 +14546,7 @@ pub mod api { const PALLET: &'static str = "Registrar"; const FUNCTION: &'static str = "deregister"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Swap { pub id: runtime_types::polkadot_parachain::primitives::Id, pub other: runtime_types::polkadot_parachain::primitives::Id, @@ -6057,7 +14555,7 @@ pub mod api { const PALLET: &'static str = "Registrar"; const FUNCTION: &'static str = "swap"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceRemoveLock { pub para: runtime_types::polkadot_parachain::primitives::Id, } @@ -6065,31 +14563,35 @@ pub mod api { const PALLET: &'static str = "Registrar"; const FUNCTION: &'static str = "force_remove_lock"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } 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, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Register, DispatchError> + { let call = Register { id, genesis_head, @@ -6104,7 +14606,14 @@ pub mod api { id: runtime_types::polkadot_parachain::primitives::Id, genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceRegister, + DispatchError, + > { let call = ForceRegister { who, deposit, @@ -6117,7 +14626,8 @@ pub mod api { pub fn deregister( &self, id: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Deregister, DispatchError> + { let call = Deregister { id }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -6125,18 +14635,29 @@ pub mod api { &self, id: runtime_types::polkadot_parachain::primitives::Id, other: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Swap, DispatchError> + { let call = Swap { id, other }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn force_remove_lock( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ForceRemoveLock, + DispatchError, + > { let call = ForceRemoveLock { para }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn reserve(&self) -> ::subxt::SubmittableExtrinsic { + pub fn reserve( + &self, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Reserve, DispatchError> + { let call = Reserve {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -6146,7 +14667,7 @@ pub mod api { runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Registered( pub runtime_types::polkadot_parachain::primitives::Id, pub ::subxt::sp_core::crypto::AccountId32, @@ -6155,7 +14676,7 @@ pub mod api { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Registered"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Deregistered( pub runtime_types::polkadot_parachain::primitives::Id, ); @@ -6163,7 +14684,7 @@ pub mod api { const PALLET: &'static str = "Registrar"; const EVENT: &'static str = "Deregistered"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Reserved( pub runtime_types::polkadot_parachain::primitives::Id, pub ::subxt::sp_core::crypto::AccountId32, @@ -6227,7 +14748,7 @@ pub mod api { ::core::option::Option< runtime_types::polkadot_parachain::primitives::Id, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = PendingSwap(_0); self.client.storage().fetch(&entry, hash).await @@ -6237,7 +14758,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, PendingSwap>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -6252,7 +14773,7 @@ pub mod api { ::core::primitive::u128, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Paras(_0); self.client.storage().fetch(&entry, hash).await @@ -6260,8 +14781,10 @@ pub mod api { pub async fn paras_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Paras>, ::subxt::Error> - { + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Paras>, + ::subxt::BasicError, + > { self.client.storage().iter(hash).await } pub async fn next_free_para_id( @@ -6269,7 +14792,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< runtime_types::polkadot_parachain::primitives::Id, - ::subxt::Error, + ::subxt::BasicError, > { let entry = NextFreeParaId; self.client.storage().fetch_or_default(&entry, hash).await @@ -6277,11 +14800,186 @@ pub mod api { } } } + pub mod slots { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, 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, A> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, + } + impl<'a, T, X, A> TransactionApi<'a, T, X, A> + where + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + 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, + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, ForceLease, DispatchError> + { + let call = ForceLease { + para, + leaser, + amount, + period_begin, + period_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_all_leases( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + ClearAllLeases, + DispatchError, + > { + let call = ClearAllLeases { para }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn trigger_onboard( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + TriggerOnboard, + DispatchError, + > { + let call = TriggerOnboard { para }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + 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 :: Encode, :: subxt :: codec :: Decode, Debug)] + 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(pub 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 } + } + pub async fn leases( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + >, + ::subxt::BasicError, + > { + let entry = Leases(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn leases_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Leases>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + } + } + } pub mod auctions { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct NewAuction { #[codec(compact)] pub duration: ::core::primitive::u32, @@ -6292,7 +14990,7 @@ pub mod api { const PALLET: &'static str = "Auctions"; const FUNCTION: &'static str = "new_auction"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Bid { #[codec(compact)] pub para: runtime_types::polkadot_parachain::primitives::Id, @@ -6309,30 +15007,34 @@ pub mod api { const PALLET: &'static str = "Auctions"; const FUNCTION: &'static str = "bid"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn new_auction( &self, duration: ::core::primitive::u32, lease_period_index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, NewAuction, DispatchError> + { let call = NewAuction { duration, lease_period_index, @@ -6346,7 +15048,8 @@ pub mod api { first_slot: ::core::primitive::u32, last_slot: ::core::primitive::u32, amount: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Bid, DispatchError> + { let call = Bid { para, auction_index, @@ -6358,7 +15061,14 @@ pub mod api { } pub fn cancel_auction( &self, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + A, + CancelAuction, + DispatchError, + > { let call = CancelAuction {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -6367,7 +15077,7 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct AuctionStarted( pub ::core::primitive::u32, pub ::core::primitive::u32, @@ -6377,13 +15087,13 @@ pub mod api { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "AuctionStarted"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Reserved( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u128, @@ -6393,7 +15103,7 @@ pub mod api { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "Reserved"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Unreserved( pub ::subxt::sp_core::crypto::AccountId32, pub ::core::primitive::u128, @@ -6402,7 +15112,7 @@ pub mod api { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "Unreserved"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReserveConfiscated( pub runtime_types::polkadot_parachain::primitives::Id, pub ::subxt::sp_core::crypto::AccountId32, @@ -6412,7 +15122,7 @@ pub mod api { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "ReserveConfiscated"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct BidAccepted( pub ::subxt::sp_core::crypto::AccountId32, pub runtime_types::polkadot_parachain::primitives::Id, @@ -6424,7 +15134,7 @@ pub mod api { const PALLET: &'static str = "Auctions"; const EVENT: &'static str = "BidAccepted"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct WinningOffset( pub ::core::primitive::u32, pub ::core::primitive::u32, @@ -6455,8 +15165,8 @@ pub mod api { } } pub struct ReservedAmounts( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_parachain::primitives::Id, ); impl ::subxt::StorageEntry for ReservedAmounts { const PALLET: &'static str = "Auctions"; @@ -6495,7 +15205,7 @@ pub mod api { pub async fn auction_counter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = AuctionCounter; self.client.storage().fetch_or_default(&entry, hash).await @@ -6508,7 +15218,7 @@ pub mod api { ::core::primitive::u32, ::core::primitive::u32, )>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = AuctionInfo; self.client.storage().fetch(&entry, hash).await @@ -6520,7 +15230,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::core::primitive::u128>, - ::subxt::Error, + ::subxt::BasicError, > { let entry = ReservedAmounts(_0, _1); self.client.storage().fetch(&entry, hash).await @@ -6530,7 +15240,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, ReservedAmounts>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -6546,7 +15256,7 @@ pub mod api { ::core::primitive::u128, )>; 36usize], >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Winning(_0); self.client.storage().fetch(&entry, hash).await @@ -6556,7 +15266,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::subxt::KeyIter<'a, T, Winning>, - ::subxt::Error, + ::subxt::BasicError, > { self.client.storage().iter(hash).await } @@ -6567,7 +15277,8 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Create { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -6586,7 +15297,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "create"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Contribute { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -6599,7 +15310,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "contribute"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Withdraw { pub who: ::subxt::sp_core::crypto::AccountId32, #[codec(compact)] @@ -6609,7 +15320,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "withdraw"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Refund { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -6618,7 +15329,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "refund"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Dissolve { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -6627,7 +15338,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "dissolve"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Edit { #[codec(compact)] pub index: runtime_types::polkadot_parachain::primitives::Id, @@ -6646,7 +15357,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "edit"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct AddMemo { pub index: runtime_types::polkadot_parachain::primitives::Id, pub memo: ::std::vec::Vec<::core::primitive::u8>, @@ -6655,7 +15366,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "add_memo"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Poke { pub index: runtime_types::polkadot_parachain::primitives::Id, } @@ -6663,18 +15374,21 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const FUNCTION: &'static str = "poke"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } pub fn create( &self, @@ -6686,7 +15400,8 @@ pub mod api { verifier: ::core::option::Option< runtime_types::sp_runtime::MultiSigner, >, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Create, DispatchError> + { let call = Create { index, cap, @@ -6704,7 +15419,8 @@ pub mod api { signature: ::core::option::Option< runtime_types::sp_runtime::MultiSignature, >, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Contribute, DispatchError> + { let call = Contribute { index, value, @@ -6716,21 +15432,24 @@ pub mod api { &self, who: ::subxt::sp_core::crypto::AccountId32, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Withdraw, DispatchError> + { let call = Withdraw { who, index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn refund( &self, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Refund, DispatchError> + { let call = Refund { index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn dissolve( &self, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Dissolve, DispatchError> + { let call = Dissolve { index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -6744,7 +15463,8 @@ pub mod api { verifier: ::core::option::Option< runtime_types::sp_runtime::MultiSigner, >, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Edit, DispatchError> + { let call = Edit { index, cap, @@ -6759,14 +15479,16 @@ pub mod api { &self, index: runtime_types::polkadot_parachain::primitives::Id, memo: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, AddMemo, DispatchError> + { let call = AddMemo { index, memo }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn poke( &self, index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic<'a, T, X, A, Poke, DispatchError> + { let call = Poke { index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } @@ -6775,13 +15497,13 @@ pub mod api { pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; pub mod events { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Contributed( pub ::subxt::sp_core::crypto::AccountId32, pub runtime_types::polkadot_parachain::primitives::Id, @@ -6791,7 +15513,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Contributed"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Withdrew( pub ::subxt::sp_core::crypto::AccountId32, pub runtime_types::polkadot_parachain::primitives::Id, @@ -6801,7 +15523,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "Withdrew"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct PartiallyRefunded( pub runtime_types::polkadot_parachain::primitives::Id, ); @@ -6809,19 +15531,19 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "PartiallyRefunded"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct HandleBidResult( pub runtime_types::polkadot_parachain::primitives::Id, pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, @@ -6830,13 +15552,13 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "HandleBidResult"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct MemoUpdated( pub ::subxt::sp_core::crypto::AccountId32, pub runtime_types::polkadot_parachain::primitives::Id, @@ -6846,7 +15568,7 @@ pub mod api { const PALLET: &'static str = "Crowdloan"; const EVENT: &'static str = "MemoUpdated"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct AddedToNewRaise( pub runtime_types::polkadot_parachain::primitives::Id, ); @@ -6922,7 +15644,7 @@ pub mod api { ::core::primitive::u32, >, >, - ::subxt::Error, + ::subxt::BasicError, > { let entry = Funds(_0); self.client.storage().fetch(&entry, hash).await @@ -6930,8 +15652,10 @@ pub mod api { pub async fn funds_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Funds>, ::subxt::Error> - { + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Funds>, + ::subxt::BasicError, + > { self.client.storage().iter(hash).await } pub async fn new_raise( @@ -6939,7 +15663,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec, - ::subxt::Error, + ::subxt::BasicError, > { let entry = NewRaise; self.client.storage().fetch_or_default(&entry, hash).await @@ -6947,7 +15671,7 @@ pub mod api { pub async fn endings_count( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = EndingsCount; self.client.storage().fetch_or_default(&entry, hash).await @@ -6955,7 +15679,7 @@ pub mod api { pub async fn next_trie_index( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { let entry = NextTrieIndex; self.client.storage().fetch_or_default(&entry, hash).await @@ -6963,2810 +15687,33 @@ pub mod api { } } } - pub mod slots { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceLease { - para, - leaser, - amount, - period_begin, - period_count, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_all_leases( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearAllLeases { para }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn trigger_onboard( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = TriggerOnboard { para }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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(pub 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 } - } - pub async fn leases( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - >, - ::subxt::Error, - > { - let entry = Leases(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn leases_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Leases>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod paras_sudo_wrapper { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoQueueDownwardXcm { - pub id: runtime_types::polkadot_parachain::primitives::Id, - pub xcm: runtime_types::xcm::VersionedXcm, - } - impl ::subxt::Call for SudoQueueDownwardXcm { - const PALLET: &'static str = "ParasSudoWrapper"; - const FUNCTION: &'static str = "sudo_queue_downward_xcm"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn sudo_schedule_para_initialize( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis : runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoScheduleParaInitialize { id, genesis }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_schedule_para_cleanup( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoScheduleParaCleanup { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_schedule_parathread_upgrade( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoScheduleParathreadUpgrade { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_schedule_parachain_downgrade( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoScheduleParachainDowngrade { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_queue_downward_xcm( - &self, - id: runtime_types::polkadot_parachain::primitives::Id, - xcm: runtime_types::xcm::VersionedXcm, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoQueueDownwardXcm { id, xcm }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoEstablishHrmpChannel { - sender, - recipient, - max_capacity, - max_message_size, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - } - pub mod sudo { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Sudo { - pub call: runtime_types::rococo_runtime::Call, - } - impl ::subxt::Call for Sudo { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoUncheckedWeight { - pub call: runtime_types::rococo_runtime::Call, - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoAs { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub call: runtime_types::rococo_runtime::Call, - } - impl ::subxt::Call for SudoAs { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo_as"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn sudo( - &self, - call: runtime_types::rococo_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Sudo { call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_unchecked_weight( - &self, - call: runtime_types::rococo_runtime::Call, - weight: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoUncheckedWeight { call, weight }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_key( - &self, - new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetKey { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_as( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - call: runtime_types::rococo_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = SudoAs { who, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_sudo::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Sudid( - pub ::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 :: Encode, :: subxt :: codec :: Decode)] - pub struct KeyChanged(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for KeyChanged { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "KeyChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoAsDone( - pub ::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 } - } - pub async fn key( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::Error, - > { - let entry = Key; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod mmr { - 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(pub ::core::primitive::u64); - impl ::subxt::StorageEntry for Nodes { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "Nodes"; - 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 } - } - pub async fn root_hash( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> - { - let entry = RootHash; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn number_of_leaves( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = NumberOfLeaves; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn nodes( - &self, - _0: ::core::primitive::u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::Error, - > { - let entry = Nodes(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn nodes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Nodes>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod beefy { - use super::runtime_types; - 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 } - } - pub async fn authorities( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::Error, - > { - let entry = Authorities; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validator_set_id( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = ValidatorSetId; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn next_authorities( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::Error, - > { - let entry = NextAuthorities; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod mmr_leaf { - 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 } - } - pub async fn beefy_next_authorities( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::beefy_primitives::mmr::BeefyNextAuthoritySet< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = BeefyNextAuthorities; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod validator_manager { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn register_validators( - &self, - validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RegisterValidators { validators }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn deregister_validators( - &self, - validators: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = DeregisterValidators { validators }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::rococo_runtime::validator_manager::RawEvent< - ::subxt::sp_core::crypto::AccountId32, - >; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 } - } - pub async fn validators_to_retire( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = ValidatorsToRetire; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validators_to_add( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = ValidatorsToAdd; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod collective { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct Execute { - pub proposal: runtime_types::rococo_runtime::Call, - #[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 :: Encode, :: subxt :: codec :: Decode)] - pub struct Propose { - #[codec(compact)] - pub threshold: ::core::primitive::u32, - pub proposal: runtime_types::rococo_runtime::Call, - #[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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMembers { - new_members, - prime, - old_count, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn execute( - &self, - proposal: runtime_types::rococo_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Execute { - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn propose( - &self, - threshold: ::core::primitive::u32, - proposal: runtime_types::rococo_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - threshold, - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { - proposal, - index, - approve, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = DisapproveProposal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::H256, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Voted( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - pub ::core::primitive::bool, - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for Voted { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Voted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Approved(pub ::subxt::sp_core::H256); - impl ::subxt::Event for Approved { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Approved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Disapproved(pub ::subxt::sp_core::H256); - impl ::subxt::Event for Disapproved { - const PALLET: &'static str = "Collective"; - const EVENT: &'static str = "Disapproved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Executed( - pub ::subxt::sp_core::H256, - pub ::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 :: Encode, :: subxt :: codec :: Decode)] - pub struct MemberExecuted( - pub ::subxt::sp_core::H256, - pub ::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 :: Encode, :: subxt :: codec :: Decode)] - pub struct Closed( - pub ::subxt::sp_core::H256, - pub ::core::primitive::u32, - pub ::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(pub ::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(pub ::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 } - } - pub async fn proposals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = Proposals; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proposal_of( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proposal_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn voting( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ::subxt::Error, - > { - let entry = Voting(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn voting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn proposal_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ProposalCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod membership { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn add_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddMember { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveMember { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn swap_member( - &self, - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SwapMember { remove, add }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reset_members( - &self, - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = ResetMembers { members }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn change_key( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ChangeKey { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_prime( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetPrime { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_prime( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearPrime {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_membership::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MemberAdded {} - impl ::subxt::Event for MemberAdded { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MemberAdded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MemberRemoved {} - impl ::subxt::Event for MemberRemoved { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MemberRemoved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MembersSwapped {} - impl ::subxt::Event for MembersSwapped { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MembersSwapped"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MembersReset {} - impl ::subxt::Event for MembersReset { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "MembersReset"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KeyChanged {} - impl ::subxt::Event for KeyChanged { - const PALLET: &'static str = "Membership"; - const EVENT: &'static str = "KeyChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 } - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod utility { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct AsDerivative { - pub index: ::core::primitive::u16, - pub call: runtime_types::rococo_runtime::Call, - } - impl ::subxt::Call for AsDerivative { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "as_derivative"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BatchAll { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for BatchAll { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch_all"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn batch( - &self, - calls: ::std::vec::Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Batch { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn as_derivative( - &self, - index: ::core::primitive::u16, - call: runtime_types::rococo_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsDerivative { index, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn batch_all( - &self, - calls: ::std::vec::Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = BatchAll { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_utility::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BatchInterrupted( - pub ::core::primitive::u32, - pub runtime_types::sp_runtime::DispatchError, - ); - impl ::subxt::Event for BatchInterrupted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchInterrupted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BatchCompleted {} - impl ::subxt::Event for BatchCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompleted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ItemCompleted {} - impl ::subxt::Event for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; - } - } - } - pub mod proxy { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proxy { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: - ::core::option::Option, - pub call: runtime_types::rococo_runtime::Call, - } - impl ::subxt::Call for Proxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveProxies {} - impl ::subxt::Call for RemoveProxies { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxies"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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: runtime_types::rococo_runtime::Call, - } - impl ::subxt::Call for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy_announced"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = Proxy { - real, - force_proxy_type, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn add_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddProxy { - delegate, - proxy_type, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxy { - delegate, - proxy_type, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_proxies( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxies {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn anonymous( - &self, - proxy_type: runtime_types::rococo_runtime::ProxyType, - delay: ::core::primitive::u32, - index: ::core::primitive::u16, - ) -> ::subxt::SubmittableExtrinsic { - let call = Anonymous { - proxy_type, - delay, - index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillAnonymous { - spawner, - proxy_type, - index, - height, - ext_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn announce( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = Announce { real, call_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_announcement( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RemoveAnnouncement { real, call_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reject_announcement( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RejectAnnouncement { - delegate, - call_hash, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProxyAnnounced { - delegate, - real, - force_proxy_type, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_proxy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProxyExecuted( - pub ::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 :: Encode, :: subxt :: codec :: Decode)] - pub struct AnonymousCreated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::rococo_runtime::ProxyType, - pub ::core::primitive::u16, - ); - impl ::subxt::Event for AnonymousCreated { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "AnonymousCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Announced( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - ); - impl ::subxt::Event for Announced { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "Announced"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProxyAdded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::rococo_runtime::ProxyType, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for ProxyAdded { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyAdded"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proxies(pub ::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(pub ::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 } - } - pub async fn proxies( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::Error, - > { - let entry = Proxies(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proxies_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Proxies>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn announcements( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::Error, - > { - let entry = Announcements(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn announcements_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Announcements>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod multisig { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AsMultiThreshold1 { - pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub call: runtime_types::rococo_runtime::Call, - } - impl ::subxt::Call for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi_threshold1"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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: ::std::vec::Vec<::core::primitive::u8>, - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn as_multi_threshold1( - &self, - other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, - >, - call: runtime_types::rococo_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMultiThreshold1 { - other_signatories, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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: ::std::vec::Vec<::core::primitive::u8>, - store_call: ::core::primitive::bool, - max_weight: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMulti { - threshold, - other_signatories, - maybe_timepoint, - call, - store_call, - max_weight, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveAsMulti { - threshold, - other_signatories, - maybe_timepoint, - call_hash, - max_weight, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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], - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_multisig::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewMultisig( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::core::primitive::u8; 32usize], - ); - impl ::subxt::Event for NewMultisig { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "NewMultisig"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MultisigApproval( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::core::primitive::u8; 32usize], - ); - impl ::subxt::Event for MultisigApproval { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigApproval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MultisigExecuted( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::core::primitive::u8; 32usize], - pub ::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 :: Encode, :: subxt :: codec :: Decode)] - pub struct MultisigCancelled( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::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( - ::subxt::sp_core::crypto::AccountId32, - [::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(pub [::core::primitive::u8; 32usize]); - impl ::subxt::StorageEntry for Calls { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Calls"; - type Value = ( - ::std::vec::Vec<::core::primitive::u8>, - ::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 } - } - pub async fn multisigs( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: [::core::primitive::u8; 32usize], - 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::Error, - > { - let entry = Multisigs(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn multisigs_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Multisigs>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn calls( - &self, - _0: [::core::primitive::u8; 32usize], - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::Error, - > { - let entry = Calls(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn calls_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Calls>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod xcm_pallet { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Send { - pub dest: runtime_types::xcm::VersionedMultiLocation, - pub message: runtime_types::xcm::VersionedXcm, - } - impl ::subxt::Call for Send { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "send"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TeleportAssets { - pub dest: runtime_types::xcm::VersionedMultiLocation, - pub beneficiary: runtime_types::xcm::VersionedMultiLocation, - pub assets: runtime_types::xcm::VersionedMultiAssets, - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct ReserveTransferAssets { - pub dest: runtime_types::xcm::VersionedMultiLocation, - pub beneficiary: runtime_types::xcm::VersionedMultiLocation, - pub assets: runtime_types::xcm::VersionedMultiAssets, - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct Execute { - pub message: runtime_types::xcm::VersionedXcm, - pub max_weight: ::core::primitive::u64, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceXcmVersion { - pub location: runtime_types::xcm::v1::multilocation::MultiLocation, - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceSubscribeVersionNotify { - pub location: runtime_types::xcm::VersionedMultiLocation, - } - impl ::subxt::Call for ForceSubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_subscribe_version_notify"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceUnsubscribeVersionNotify { - pub location: runtime_types::xcm::VersionedMultiLocation, - } - impl ::subxt::Call for ForceUnsubscribeVersionNotify { - const PALLET: &'static str = "XcmPallet"; - const FUNCTION: &'static str = "force_unsubscribe_version_notify"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn send( - &self, - dest: runtime_types::xcm::VersionedMultiLocation, - message: runtime_types::xcm::VersionedXcm, - ) -> ::subxt::SubmittableExtrinsic { - let call = Send { dest, message }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = TeleportAssets { - dest, - beneficiary, - assets, - fee_asset_item, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReserveTransferAssets { - dest, - beneficiary, - assets, - fee_asset_item, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn execute( - &self, - message: runtime_types::xcm::VersionedXcm, - max_weight: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Execute { - message, - max_weight, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_xcm_version( - &self, - location: runtime_types::xcm::v1::multilocation::MultiLocation, - xcm_version: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceXcmVersion { - location, - xcm_version, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_default_xcm_version( - &self, - maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceDefaultXcmVersion { maybe_xcm_version }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_subscribe_version_notify( - &self, - location: runtime_types::xcm::VersionedMultiLocation, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceSubscribeVersionNotify { location }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_unsubscribe_version_notify( - &self, - location: runtime_types::xcm::VersionedMultiLocation, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceUnsubscribeVersionNotify { location }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_xcm::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct InvalidResponder( - pub runtime_types::xcm::v1::multilocation::MultiLocation, - pub ::core::primitive::u64, - pub ::core::option::Option< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - ); - impl ::subxt::Event for InvalidResponder { - const PALLET: &'static str = "XcmPallet"; - const EVENT: &'static str = "InvalidResponder"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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(pub ::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(pub ::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( - ::core::primitive::u32, - 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( - ::core::primitive::u32, - 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( - ::core::primitive::u32, - 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 } - } - pub async fn query_counter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = QueryCounter; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queries( - &self, - _0: ::core::primitive::u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::QueryStatus< - ::core::primitive::u32, - >, - >, - ::subxt::Error, - > { - let entry = Queries(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn queries_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Queries>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn asset_traps( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = AssetTraps(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn asset_traps_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AssetTraps>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn safe_xcm_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = SafeXcmVersion; - self.client.storage().fetch(&entry, hash).await - } - pub async fn supported_version( - &self, - _0: ::core::primitive::u32, - _1: runtime_types::xcm::VersionedMultiLocation, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = SupportedVersion(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn supported_version_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SupportedVersion>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn version_notifiers( - &self, - _0: ::core::primitive::u32, - _1: runtime_types::xcm::VersionedMultiLocation, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u64>, - ::subxt::Error, - > { - let entry = VersionNotifiers(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn version_notifiers_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifiers>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn version_notify_targets( - &self, - _0: ::core::primitive::u32, - _1: runtime_types::xcm::VersionedMultiLocation, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u64, - ::core::primitive::u64, - ::core::primitive::u32, - )>, - ::subxt::Error, - > { - let entry = VersionNotifyTargets(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn version_notify_targets_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VersionNotifyTargets>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn version_discovery_queue( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u32, - )>, - ::subxt::Error, - > { - let entry = VersionDiscoveryQueue; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_migration( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_xcm::pallet::VersionMigrationStage, - >, - ::subxt::Error, - > { - let entry = CurrentMigration; - self.client.storage().fetch(&entry, hash).await - } - } - } - } 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 :: Encode, :: subxt :: codec :: Decode)] - pub struct Public(pub runtime_types::sp_core::ecdsa::Public); - } - pub mod mmr { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Lsb0 {} } } pub mod finality_grandpa { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Precommit<_0, _1> { pub target_hash: _0, pub target_number: _1, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Prevote<_0, _1> { pub target_hash: _0, pub target_number: _1, @@ -9776,17 +15723,26 @@ pub mod api { use super::runtime_types; pub mod storage { use super::runtime_types; + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct BoundedBTreeMap<_0, _1>( + pub ::std::collections::BTreeMap<_0, _1>, + ); + } pub mod bounded_vec { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct BoundedVec<_0>(pub ::std::vec::Vec<_0>); } pub mod weak_bounded_vec { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); } @@ -9796,7 +15752,14 @@ pub mod api { pub mod misc { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct WrapperKeepOpaque<_0>( + #[codec(compact)] ::core::primitive::u32, + pub _0, + ); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct WrapperOpaque<_0>( #[codec(compact)] ::core::primitive::u32, @@ -9808,7 +15771,9 @@ pub mod api { pub mod misc { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, )] pub enum BalanceStatus { #[codec(index = 0)] @@ -9821,7 +15786,9 @@ pub mod api { } pub mod weights { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum DispatchClass { #[codec(index = 0)] Normal, @@ -9830,31 +15797,41 @@ pub mod api { #[codec(index = 2)] Mandatory, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Pays { #[codec(index = 0)] Yes, #[codec(index = 1)] No, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct PerDispatchClass<_0> { pub normal: _0, pub operational: _0, pub mandatory: _0, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct RuntimeDbWeight { pub read: ::core::primitive::u64, pub write: ::core::primitive::u64, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct WeightToFeeCoefficient<_0> { pub coeff_integer: _0, pub coeff_frac: runtime_types::sp_arithmetic::per_things::Perbill, @@ -9862,7 +15839,7 @@ pub mod api { pub degree: ::core::primitive::u8, } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct PalletId(pub [::core::primitive::u8; 8usize]); } pub mod frame_system { @@ -9872,14 +15849,14 @@ pub mod api { pub mod check_genesis { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct CheckGenesis {} } pub mod check_mortality { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct CheckMortality( pub runtime_types::sp_runtime::generic::era::Era, @@ -9888,41 +15865,45 @@ pub mod api { pub mod check_nonce { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); } pub mod check_spec_version { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct CheckSpecVersion {} } pub mod check_tx_version { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct CheckTxVersion {} } pub mod check_weight { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct CheckWeight {} } } pub mod limits { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct BlockLength { pub max: runtime_types::frame_support::weights::PerDispatchClass< ::core::primitive::u32, >, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct BlockWeights { pub base_block: ::core::primitive::u64, pub max_block: ::core::primitive::u64, @@ -9931,7 +15912,9 @@ pub mod api { runtime_types::frame_system::limits::WeightsPerClass, >, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct WeightsPerClass { pub base_extrinsic: ::core::primitive::u64, pub max_extrinsic: ::core::option::Option<::core::primitive::u64>, @@ -9941,10 +15924,14 @@ pub mod api { } pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { # [codec (index = 0)] fill_block { ratio : runtime_types :: sp_arithmetic :: per_things :: Perbill , } , # [codec (index = 1)] remark { remark : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 2)] set_heap_pages { pages : :: core :: primitive :: u64 , } , # [codec (index = 3)] set_code { code : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 4)] set_code_without_checks { code : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 5)] set_changes_trie_config { changes_trie_config : :: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , # [codec (index = 6)] set_storage { items : :: std :: vec :: Vec < (:: std :: vec :: Vec < :: core :: primitive :: u8 > , :: std :: vec :: Vec < :: core :: primitive :: u8 > ,) > , } , # [codec (index = 7)] kill_storage { keys : :: std :: vec :: Vec < :: std :: vec :: Vec < :: core :: primitive :: u8 > > , } , # [codec (index = 8)] kill_prefix { prefix : :: std :: vec :: Vec < :: core :: primitive :: u8 > , subkeys : :: core :: primitive :: u32 , } , # [codec (index = 9)] remark_with_event { remark : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] InvalidSpecName, @@ -9956,8 +15943,12 @@ pub mod api { NonDefaultComposite, #[codec(index = 4)] NonZeroRefCount, + #[codec(index = 5)] + CallFiltered, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), @@ -9979,7 +15970,7 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct AccountInfo<_0, _1> { pub nonce: _0, pub consumers: _0, @@ -9987,19 +15978,19 @@ pub mod api { pub sufficients: _0, pub data: _1, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct LastRuntimeUpgradeInfo { #[codec(compact)] pub spec_version: ::core::primitive::u32, pub spec_name: ::std::string::String, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Phase { #[codec(index = 0)] ApplyExtrinsic(::core::primitive::u32), @@ -10008,12 +15999,23 @@ pub mod api { #[codec(index = 2)] Initialization, } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum RawOrigin<_0> { + #[codec(index = 0)] + Root, + #[codec(index = 1)] + Signed(_0), + #[codec(index = 2)] + None, + } } pub mod pallet_authorship { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] set_uncles { @@ -10025,7 +16027,9 @@ pub mod api { >, }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] InvalidUncleParent, @@ -10043,7 +16047,7 @@ pub mod api { OldUncle, } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum UncleEntryItem<_0, _1, _2> { #[codec(index = 0)] InclusionHeight(_0), @@ -10055,10 +16059,14 @@ pub mod api { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { # [codec (index = 0)] 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)] 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)] plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] InvalidEquivocationProof, @@ -10069,11 +16077,62 @@ pub mod api { } } } + pub mod pallet_bags_list { + use super::runtime_types; + pub mod list { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Bag { + pub head: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub tail: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Node { + pub id: ::subxt::sp_core::crypto::AccountId32, + pub prev: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub next: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + pub bag_upper: ::core::primitive::u64, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + rebag { + dislocated: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + Rebagged( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + ::core::primitive::u64, + ), + } + } + } pub mod pallet_balances { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] transfer { @@ -10134,7 +16193,9 @@ pub mod api { amount: ::core::primitive::u128, }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] VestingBalance, @@ -10153,7 +16214,9 @@ pub mod api { #[codec(index = 7)] TooManyReserves, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] Endowed( @@ -10178,43 +16241,53 @@ pub mod api { ::core::primitive::u128, ), #[codec(index = 4)] - Deposit( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - #[codec(index = 5)] Reserved( ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, ), - #[codec(index = 6)] + #[codec(index = 5)] Unreserved( ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, ), - #[codec(index = 7)] + #[codec(index = 6)] ReserveRepatriated( ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, runtime_types::frame_support::traits::tokens::misc::BalanceStatus, ), + #[codec(index = 7)] + Deposit( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 8)] + Withdraw( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 9)] + Slashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct AccountData<_0> { pub free: _0, pub reserved: _0, pub misc_frozen: _0, pub fee_frozen: _0, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct BalanceLock<_0> { pub id: [::core::primitive::u8; 8usize], pub amount: _0, pub reasons: runtime_types::pallet_balances::Reasons, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Reasons { #[codec(index = 0)] Fee, @@ -10223,24 +16296,171 @@ pub mod api { #[codec(index = 2)] All, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Releases { #[codec(index = 0)] V1_0_0, #[codec(index = 1)] V2_0_0, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReserveData<_0, _1> { pub id: _0, pub amount: _1, } } + pub mod pallet_bounties { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + propose_bounty { + #[codec(compact)] + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + approve_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 2)] + propose_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 3)] + unassign_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 4)] + accept_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 5)] + award_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 6)] + claim_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 7)] + close_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 8)] + extend_bounty_expiry { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + remark: ::std::vec::Vec<::core::primitive::u8>, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + InsufficientProposersBalance, + #[codec(index = 1)] + InvalidIndex, + #[codec(index = 2)] + ReasonTooBig, + #[codec(index = 3)] + UnexpectedStatus, + #[codec(index = 4)] + RequireCurator, + #[codec(index = 5)] + InvalidValue, + #[codec(index = 6)] + InvalidFee, + #[codec(index = 7)] + PendingPayout, + #[codec(index = 8)] + Premature, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + BountyProposed(::core::primitive::u32), + #[codec(index = 1)] + BountyRejected(::core::primitive::u32, ::core::primitive::u128), + #[codec(index = 2)] + BountyBecameActive(::core::primitive::u32), + #[codec(index = 3)] + BountyAwarded( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 4)] + BountyClaimed( + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 5)] + BountyCanceled(::core::primitive::u32), + #[codec(index = 6)] + BountyExtended(::core::primitive::u32), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Bounty<_0, _1, _2> { + pub proposer: _0, + pub value: _1, + pub fee: _1, + pub curator_deposit: _1, + pub bond: _1, + pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum BountyStatus<_0, _1> { + #[codec(index = 0)] + Proposed, + #[codec(index = 1)] + Approved, + #[codec(index = 2)] + Funded, + #[codec(index = 3)] + CuratorProposed { curator: _0 }, + #[codec(index = 4)] + Active { curator: _0, update_due: _1 }, + #[codec(index = 5)] + PendingPayout { + curator: _0, + beneficiary: _0, + unlock_at: _1, + }, + } + } pub mod pallet_collective { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] set_members { @@ -10252,7 +16472,8 @@ pub mod api { }, #[codec(index = 1)] execute { - proposal: ::std::boxed::Box, + proposal: + ::std::boxed::Box, #[codec(compact)] length_bound: ::core::primitive::u32, }, @@ -10260,7 +16481,8 @@ pub mod api { propose { #[codec(compact)] threshold: ::core::primitive::u32, - proposal: ::std::boxed::Box, + proposal: + ::std::boxed::Box, #[codec(compact)] length_bound: ::core::primitive::u32, }, @@ -10286,7 +16508,9 @@ pub mod api { proposal_hash: ::subxt::sp_core::H256, }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] NotMember, @@ -10309,7 +16533,9 @@ pub mod api { #[codec(index = 9)] WrongProposalLength, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] Proposed( @@ -10354,7 +16580,16 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Votes<_0, _1> { pub index: _1, pub threshold: _1, @@ -10363,11 +16598,660 @@ pub mod api { pub end: _1, } } + pub mod pallet_democracy { + use super::runtime_types; + pub mod conviction { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Conviction { + #[codec(index = 0)] + None, + #[codec(index = 1)] + Locked1x, + #[codec(index = 2)] + Locked2x, + #[codec(index = 3)] + Locked3x, + #[codec(index = 4)] + Locked4x, + #[codec(index = 5)] + Locked5x, + #[codec(index = 6)] + Locked6x, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + propose { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + second { + #[codec(compact)] + proposal: ::core::primitive::u32, + #[codec(compact)] + seconds_upper_bound: ::core::primitive::u32, + }, + #[codec(index = 2)] + vote { + #[codec(compact)] + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + }, + #[codec(index = 3)] + emergency_cancel { ref_index: ::core::primitive::u32 }, + #[codec(index = 4)] + external_propose { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 5)] + external_propose_majority { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 6)] + external_propose_default { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 7)] + fast_track { + proposal_hash: ::subxt::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + }, + #[codec(index = 8)] + veto_external { + proposal_hash: ::subxt::sp_core::H256, + }, + #[codec(index = 9)] + cancel_referendum { + #[codec(compact)] + ref_index: ::core::primitive::u32, + }, + #[codec(index = 10)] + cancel_queued { which: ::core::primitive::u32 }, + #[codec(index = 11)] + delegate { + to: ::subxt::sp_core::crypto::AccountId32, + conviction: + runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + }, + #[codec(index = 12)] + undelegate, + #[codec(index = 13)] + clear_public_proposals, + #[codec(index = 14)] + note_preimage { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 15)] + note_preimage_operational { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 16)] + note_imminent_preimage { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 17)] + note_imminent_preimage_operational { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 18)] + reap_preimage { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + proposal_len_upper_bound: ::core::primitive::u32, + }, + #[codec(index = 19)] + unlock { + target: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 20)] + remove_vote { index: ::core::primitive::u32 }, + #[codec(index = 21)] + remove_other_vote { + target: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + #[codec(index = 22)] + enact_proposal { + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + }, + #[codec(index = 23)] + blacklist { + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + }, + #[codec(index = 24)] + cancel_proposal { + #[codec(compact)] + prop_index: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + ValueLow, + #[codec(index = 1)] + ProposalMissing, + #[codec(index = 2)] + AlreadyCanceled, + #[codec(index = 3)] + DuplicateProposal, + #[codec(index = 4)] + ProposalBlacklisted, + #[codec(index = 5)] + NotSimpleMajority, + #[codec(index = 6)] + InvalidHash, + #[codec(index = 7)] + NoProposal, + #[codec(index = 8)] + AlreadyVetoed, + #[codec(index = 9)] + DuplicatePreimage, + #[codec(index = 10)] + NotImminent, + #[codec(index = 11)] + TooEarly, + #[codec(index = 12)] + Imminent, + #[codec(index = 13)] + PreimageMissing, + #[codec(index = 14)] + ReferendumInvalid, + #[codec(index = 15)] + PreimageInvalid, + #[codec(index = 16)] + NoneWaiting, + #[codec(index = 17)] + NotVoter, + #[codec(index = 18)] + NoPermission, + #[codec(index = 19)] + AlreadyDelegating, + #[codec(index = 20)] + InsufficientFunds, + #[codec(index = 21)] + NotDelegating, + #[codec(index = 22)] + VotesExist, + #[codec(index = 23)] + InstantNotAllowed, + #[codec(index = 24)] + Nonsense, + #[codec(index = 25)] + WrongUpperBound, + #[codec(index = 26)] + MaxVotesReached, + #[codec(index = 27)] + TooManyProposals, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + Proposed(::core::primitive::u32, ::core::primitive::u128), + #[codec(index = 1)] + Tabled( + ::core::primitive::u32, + ::core::primitive::u128, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + ), + #[codec(index = 2)] + ExternalTabled, + #[codec(index = 3)] + Started( + ::core::primitive::u32, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ), + #[codec(index = 4)] + Passed(::core::primitive::u32), + #[codec(index = 5)] + NotPassed(::core::primitive::u32), + #[codec(index = 6)] + Cancelled(::core::primitive::u32), + #[codec(index = 7)] + Executed( + ::core::primitive::u32, + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + #[codec(index = 8)] + Delegated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 9)] + Undelegated(::subxt::sp_core::crypto::AccountId32), + #[codec(index = 10)] + Vetoed( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ::core::primitive::u32, + ), + #[codec(index = 11)] + PreimageNoted( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 12)] + PreimageUsed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 13)] + PreimageInvalid(::subxt::sp_core::H256, ::core::primitive::u32), + #[codec(index = 14)] + PreimageMissing(::subxt::sp_core::H256, ::core::primitive::u32), + #[codec(index = 15)] + PreimageReaped( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 16)] + Blacklisted(::subxt::sp_core::H256), + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Delegations<_0> { + pub votes: _0, + pub capital: _0, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum ReferendumInfo<_0, _1, _2> { + #[codec(index = 0)] + Ongoing( + runtime_types::pallet_democracy::types::ReferendumStatus< + _0, + _1, + _2, + >, + ), + #[codec(index = 1)] + Finished { + approved: ::core::primitive::bool, + end: _0, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ReferendumStatus<_0, _1, _2> { + pub end: _0, + pub proposal_hash: _1, + pub threshold: + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + pub delay: _0, + pub tally: runtime_types::pallet_democracy::types::Tally<_2>, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Tally<_0> { + pub ayes: _0, + pub nays: _0, + pub turnout: _0, + } + } + pub mod vote { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum AccountVote<_0> { + #[codec(index = 0)] + Standard { + vote: runtime_types::pallet_democracy::vote::Vote, + balance: _0, + }, + #[codec(index = 1)] + Split { aye: _0, nay: _0 }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct PriorLock<_0, _1>(pub _0, pub _1); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + )] + pub struct Vote(::core::primitive::u8); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Voting<_0, _1, _2> { + #[codec(index = 0)] + Direct { + votes: ::std::vec::Vec<( + _2, + runtime_types::pallet_democracy::vote::AccountVote<_0>, + )>, + delegations: + runtime_types::pallet_democracy::types::Delegations<_0>, + prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, + }, + #[codec(index = 1)] + Delegating { + balance: _0, + target: _1, + conviction: + runtime_types::pallet_democracy::conviction::Conviction, + delegations: + runtime_types::pallet_democracy::types::Delegations<_0>, + prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, + }, + } + } + pub mod vote_threshold { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum VoteThreshold { + #[codec(index = 0)] + SuperMajorityApprove, + #[codec(index = 1)] + SuperMajorityAgainst, + #[codec(index = 2)] + SimpleMajority, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum PreimageStatus<_0, _1, _2> { + #[codec(index = 0)] + Missing(_2), + #[codec(index = 1)] + Available { + data: ::std::vec::Vec<::core::primitive::u8>, + provider: _0, + deposit: _1, + since: _2, + expiry: ::core::option::Option<_2>, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V1, + } + } + pub mod pallet_election_provider_multi_phase { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < [:: core :: primitive :: u128 ; 3usize] > , } , # [codec (index = 2)] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , num_signed_submissions : :: core :: primitive :: u32 , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + PreDispatchEarlySubmission, + #[codec(index = 1)] + PreDispatchWrongWinnerCount, + #[codec(index = 2)] + PreDispatchWeakSubmission, + #[codec(index = 3)] + SignedQueueFull, + #[codec(index = 4)] + SignedCannotPayDeposit, + #[codec(index = 5)] + SignedInvalidWitness, + #[codec(index = 6)] + SignedTooMuchWeight, + #[codec(index = 7)] + OcwCallWrongEra, + #[codec(index = 8)] + MissingSnapshotMetadata, + #[codec(index = 9)] + InvalidSubmissionIndex, + #[codec(index = 10)] + CallNotAllowed, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + # [codec (index = 0)] SolutionStored (runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , :: core :: primitive :: bool ,) , # [codec (index = 1)] ElectionFinalized (:: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > ,) , # [codec (index = 2)] Rewarded (:: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 ,) , # [codec (index = 3)] Slashed (:: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 ,) , # [codec (index = 4)] SignedPhaseStarted (:: core :: primitive :: u32 ,) , # [codec (index = 5)] UnsignedPhaseStarted (:: core :: primitive :: u32 ,) , } + } + pub mod signed { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SignedSubmission<_0, _1, _2> { + pub who: _0, + pub deposit: _1, + pub raw_solution: + runtime_types::pallet_election_provider_multi_phase::RawSolution< + _2, + >, + pub reward: _1, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum ElectionCompute { + #[codec(index = 0)] + OnChain, + #[codec(index = 1)] + Signed, + #[codec(index = 2)] + Unsigned, + #[codec(index = 3)] + Fallback, + #[codec(index = 4)] + Emergency, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Phase<_0> { + #[codec(index = 0)] + Off, + #[codec(index = 1)] + Signed, + #[codec(index = 2)] + Unsigned((::core::primitive::bool, _0)), + #[codec(index = 3)] + Emergency, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RawSolution<_0> { + pub solution: _0, + pub score: [::core::primitive::u128; 3usize], + pub round: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ReadySolution<_0> { + pub supports: + ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub score: [::core::primitive::u128; 3usize], + pub compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct RoundSnapshot<_0> { + pub voters: + ::std::vec::Vec<(_0, ::core::primitive::u64, ::std::vec::Vec<_0>)>, + pub targets: ::std::vec::Vec<_0>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SolutionOrSnapshotSize { + #[codec(compact)] + pub voters: ::core::primitive::u32, + #[codec(compact)] + pub targets: ::core::primitive::u32, + } + } + pub mod pallet_elections_phragmen { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + vote { + votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + remove_voter, + #[codec(index = 2)] + submit_candidacy { + #[codec(compact)] + candidate_count: ::core::primitive::u32, + }, + #[codec(index = 3)] + renounce_candidacy { + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + }, + #[codec(index = 4)] + remove_member { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + has_replacement: ::core::primitive::bool, + }, + #[codec(index = 5)] + clean_defunct_voters { + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + UnableToVote, + #[codec(index = 1)] + NoVotes, + #[codec(index = 2)] + TooManyVotes, + #[codec(index = 3)] + MaximumVotesExceeded, + #[codec(index = 4)] + LowBalance, + #[codec(index = 5)] + UnableToPayBond, + #[codec(index = 6)] + MustBeVoter, + #[codec(index = 7)] + ReportSelf, + #[codec(index = 8)] + DuplicatedCandidate, + #[codec(index = 9)] + MemberSubmit, + #[codec(index = 10)] + RunnerUpSubmit, + #[codec(index = 11)] + InsufficientCandidateFunds, + #[codec(index = 12)] + NotMember, + #[codec(index = 13)] + InvalidWitnessData, + #[codec(index = 14)] + InvalidVoteCount, + #[codec(index = 15)] + InvalidRenouncing, + #[codec(index = 16)] + InvalidReplacement, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + NewTerm( + ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ), + #[codec(index = 1)] + EmptyTerm, + #[codec(index = 2)] + ElectionError, + #[codec(index = 3)] + MemberKicked(::subxt::sp_core::crypto::AccountId32), + #[codec(index = 4)] + Renounced(::subxt::sp_core::crypto::AccountId32), + #[codec(index = 5)] + CandidateSlashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 6)] + SeatHolderSlashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Renouncing { + #[codec(index = 0)] + Member, + #[codec(index = 1)] + RunnerUp, + #[codec(index = 2)] + Candidate(#[codec(compact)] ::core::primitive::u32), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SeatHolder<_0, _1> { + pub who: _0, + pub stake: _1, + pub deposit: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Voter<_0, _1> { + pub votes: ::std::vec::Vec<_0>, + pub stake: _1, + pub deposit: _1, + } + } pub mod pallet_grandpa { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] report_equivocation { @@ -10395,7 +17279,9 @@ pub mod api { best_finalized_block_number: ::core::primitive::u32, }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] PauseFailed, @@ -10412,7 +17298,9 @@ pub mod api { #[codec(index = 6)] DuplicateOffenceReport, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] NewAuthorities( @@ -10427,9 +17315,9 @@ pub mod api { Resumed, } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum StoredState<_0> { #[codec(index = 0)] Live, @@ -10441,21 +17329,395 @@ pub mod api { PendingResume { scheduled_at: _0, delay: _0 }, } } + pub mod pallet_identity { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + add_registrar { + account: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + set_identity { + info: ::std::boxed::Box< + runtime_types::pallet_identity::types::IdentityInfo, + >, + }, + #[codec(index = 2)] + set_subs { + subs: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + }, + #[codec(index = 3)] + clear_identity, + #[codec(index = 4)] + request_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + #[codec(compact)] + max_fee: ::core::primitive::u128, + }, + #[codec(index = 5)] + cancel_request { reg_index: ::core::primitive::u32 }, + #[codec(index = 6)] + set_fee { + #[codec(compact)] + index: ::core::primitive::u32, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 7)] + set_account_id { + #[codec(compact)] + index: ::core::primitive::u32, + new: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 8)] + set_fields { + #[codec(compact)] + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + }, + #[codec(index = 9)] + provide_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + }, + #[codec(index = 10)] + kill_identity { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 11)] + add_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + #[codec(index = 12)] + rename_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + #[codec(index = 13)] + remove_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 14)] + quit_sub, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + TooManySubAccounts, + #[codec(index = 1)] + NotFound, + #[codec(index = 2)] + NotNamed, + #[codec(index = 3)] + EmptyIndex, + #[codec(index = 4)] + FeeChanged, + #[codec(index = 5)] + NoIdentity, + #[codec(index = 6)] + StickyJudgement, + #[codec(index = 7)] + JudgementGiven, + #[codec(index = 8)] + InvalidJudgement, + #[codec(index = 9)] + InvalidIndex, + #[codec(index = 10)] + InvalidTarget, + #[codec(index = 11)] + TooManyFields, + #[codec(index = 12)] + TooManyRegistrars, + #[codec(index = 13)] + AlreadyClaimed, + #[codec(index = 14)] + NotSub, + #[codec(index = 15)] + NotOwned, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + IdentitySet(::subxt::sp_core::crypto::AccountId32), + #[codec(index = 1)] + IdentityCleared( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 2)] + IdentityKilled( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 3)] + JudgementRequested( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ), + #[codec(index = 4)] + JudgementUnrequested( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ), + #[codec(index = 5)] + JudgementGiven( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ), + #[codec(index = 6)] + RegistrarAdded(::core::primitive::u32), + #[codec(index = 7)] + SubIdentityAdded( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 8)] + SubIdentityRemoved( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 9)] + SubIdentityRevoked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + )] + pub struct BitFlags<_0>( + pub ::core::primitive::u64, + #[codec(skip)] pub ::core::marker::PhantomData<_0>, + ); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Data { + #[codec(index = 0)] + None, + #[codec(index = 1)] + Raw0([::core::primitive::u8; 0usize]), + #[codec(index = 2)] + Raw1([::core::primitive::u8; 1usize]), + #[codec(index = 3)] + Raw2([::core::primitive::u8; 2usize]), + #[codec(index = 4)] + Raw3([::core::primitive::u8; 3usize]), + #[codec(index = 5)] + Raw4([::core::primitive::u8; 4usize]), + #[codec(index = 6)] + Raw5([::core::primitive::u8; 5usize]), + #[codec(index = 7)] + Raw6([::core::primitive::u8; 6usize]), + #[codec(index = 8)] + Raw7([::core::primitive::u8; 7usize]), + #[codec(index = 9)] + Raw8([::core::primitive::u8; 8usize]), + #[codec(index = 10)] + Raw9([::core::primitive::u8; 9usize]), + #[codec(index = 11)] + Raw10([::core::primitive::u8; 10usize]), + #[codec(index = 12)] + Raw11([::core::primitive::u8; 11usize]), + #[codec(index = 13)] + Raw12([::core::primitive::u8; 12usize]), + #[codec(index = 14)] + Raw13([::core::primitive::u8; 13usize]), + #[codec(index = 15)] + Raw14([::core::primitive::u8; 14usize]), + #[codec(index = 16)] + Raw15([::core::primitive::u8; 15usize]), + #[codec(index = 17)] + Raw16([::core::primitive::u8; 16usize]), + #[codec(index = 18)] + Raw17([::core::primitive::u8; 17usize]), + #[codec(index = 19)] + Raw18([::core::primitive::u8; 18usize]), + #[codec(index = 20)] + Raw19([::core::primitive::u8; 19usize]), + #[codec(index = 21)] + Raw20([::core::primitive::u8; 20usize]), + #[codec(index = 22)] + Raw21([::core::primitive::u8; 21usize]), + #[codec(index = 23)] + Raw22([::core::primitive::u8; 22usize]), + #[codec(index = 24)] + Raw23([::core::primitive::u8; 23usize]), + #[codec(index = 25)] + Raw24([::core::primitive::u8; 24usize]), + #[codec(index = 26)] + Raw25([::core::primitive::u8; 25usize]), + #[codec(index = 27)] + Raw26([::core::primitive::u8; 26usize]), + #[codec(index = 28)] + Raw27([::core::primitive::u8; 27usize]), + #[codec(index = 29)] + Raw28([::core::primitive::u8; 28usize]), + #[codec(index = 30)] + Raw29([::core::primitive::u8; 29usize]), + #[codec(index = 31)] + Raw30([::core::primitive::u8; 30usize]), + #[codec(index = 32)] + Raw31([::core::primitive::u8; 31usize]), + #[codec(index = 33)] + Raw32([::core::primitive::u8; 32usize]), + #[codec(index = 34)] + BlakeTwo256([::core::primitive::u8; 32usize]), + #[codec(index = 35)] + Sha256([::core::primitive::u8; 32usize]), + #[codec(index = 36)] + Keccak256([::core::primitive::u8; 32usize]), + #[codec(index = 37)] + ShaThree256([::core::primitive::u8; 32usize]), + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum IdentityField { + #[codec(index = 1)] + Display, + #[codec(index = 2)] + Legal, + #[codec(index = 4)] + Web, + #[codec(index = 8)] + Riot, + #[codec(index = 16)] + Email, + #[codec(index = 32)] + PgpFingerprint, + #[codec(index = 64)] + Image, + #[codec(index = 128)] + Twitter, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct IdentityInfo { + pub additional: + runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + runtime_types::pallet_identity::types::Data, + runtime_types::pallet_identity::types::Data, + )>, + pub display: runtime_types::pallet_identity::types::Data, + pub legal: runtime_types::pallet_identity::types::Data, + pub web: runtime_types::pallet_identity::types::Data, + pub riot: runtime_types::pallet_identity::types::Data, + pub email: runtime_types::pallet_identity::types::Data, + pub pgp_fingerprint: + ::core::option::Option<[::core::primitive::u8; 20usize]>, + pub image: runtime_types::pallet_identity::types::Data, + pub twitter: runtime_types::pallet_identity::types::Data, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Judgement<_0> { + #[codec(index = 0)] + Unknown, + #[codec(index = 1)] + FeePaid(_0), + #[codec(index = 2)] + Reasonable, + #[codec(index = 3)] + KnownGood, + #[codec(index = 4)] + OutOfDate, + #[codec(index = 5)] + LowQuality, + #[codec(index = 6)] + Erroneous, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct RegistrarInfo<_0, _1> { + pub account: _1, + pub fee: _0, + pub fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Registration<_0> { + pub judgements: + runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + ::core::primitive::u32, + runtime_types::pallet_identity::types::Judgement<_0>, + )>, + pub deposit: _0, + pub info: runtime_types::pallet_identity::types::IdentityInfo, + } + } + } pub mod pallet_im_online { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { # [codec (index = 0)] heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < :: core :: primitive :: u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] InvalidKey, #[codec(index = 1)] DuplicatedHeartbeat, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] HeartbeatReceived( @@ -10465,7 +17727,13 @@ pub mod api { AllGood, #[codec(index = 2)] SomeOffline( - ::std::vec::Vec<(::subxt::sp_core::crypto::AccountId32, ())>, + ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + )>, ), } } @@ -10474,18 +17742,18 @@ pub mod api { pub mod app_sr25519 { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Heartbeat<_0> { pub block_number: _0, pub network_state: runtime_types::sp_core::offchain::OpaqueNetworkState, @@ -10498,7 +17766,9 @@ pub mod api { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] claim { index: ::core::primitive::u32 }, @@ -10518,7 +17788,9 @@ pub mod api { #[codec(index = 4)] freeze { index: ::core::primitive::u32 }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] NotAssigned, @@ -10531,7 +17803,9 @@ pub mod api { #[codec(index = 4)] Permanent, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] IndexAssigned( @@ -10552,7 +17826,9 @@ pub mod api { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] add_member { @@ -10582,14 +17858,18 @@ pub mod api { #[codec(index = 6)] clear_prime, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] AlreadyMember, #[codec(index = 1)] NotMember, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] MemberAdded, @@ -10610,13 +17890,15 @@ pub mod api { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] as_multi_threshold_1 { other_signatories: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - call: ::std::boxed::Box, + call: ::std::boxed::Box, }, #[codec(index = 1)] as_multi { @@ -10628,7 +17910,9 @@ pub mod api { ::core::primitive::u32, >, >, - call: ::std::vec::Vec<::core::primitive::u8>, + call: ::subxt::WrapperKeepOpaque< + runtime_types::polkadot_runtime::Call, + >, store_call: ::core::primitive::bool, max_weight: ::core::primitive::u64, }, @@ -10656,7 +17940,9 @@ pub mod api { call_hash: [::core::primitive::u8; 32usize], }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] MinimumThreshold, @@ -10687,7 +17973,9 @@ pub mod api { #[codec(index = 13)] AlreadyStored, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] NewMultisig( @@ -10722,14 +18010,14 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Timepoint<_0> { pub height: _0, pub index: _0, @@ -10739,7 +18027,9 @@ pub mod api { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] Offence( @@ -10753,40 +18043,42 @@ pub mod api { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] proxy { real: ::subxt::sp_core::crypto::AccountId32, force_proxy_type: ::core::option::Option< - runtime_types::rococo_runtime::ProxyType, + runtime_types::polkadot_runtime::ProxyType, >, - call: ::std::boxed::Box, + call: ::std::boxed::Box, }, #[codec(index = 1)] add_proxy { delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, + proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, }, #[codec(index = 2)] remove_proxy { delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, + proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, }, #[codec(index = 3)] remove_proxies, #[codec(index = 4)] anonymous { - proxy_type: runtime_types::rococo_runtime::ProxyType, + proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, index: ::core::primitive::u16, }, #[codec(index = 5)] kill_anonymous { spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::rococo_runtime::ProxyType, + proxy_type: runtime_types::polkadot_runtime::ProxyType, index: ::core::primitive::u16, #[codec(compact)] height: ::core::primitive::u32, @@ -10813,12 +18105,14 @@ pub mod api { delegate: ::subxt::sp_core::crypto::AccountId32, real: ::subxt::sp_core::crypto::AccountId32, force_proxy_type: ::core::option::Option< - runtime_types::rococo_runtime::ProxyType, + runtime_types::polkadot_runtime::ProxyType, >, - call: ::std::boxed::Box, + call: ::std::boxed::Box, }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] TooMany, @@ -10837,7 +18131,9 @@ pub mod api { #[codec(index = 7)] NoSelfProxy, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] ProxyExecuted( @@ -10850,7 +18146,7 @@ pub mod api { AnonymousCreated( ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::ProxyType, + runtime_types::polkadot_runtime::ProxyType, ::core::primitive::u16, ), #[codec(index = 2)] @@ -10863,39 +18159,154 @@ pub mod api { ProxyAdded( ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::crypto::AccountId32, - runtime_types::rococo_runtime::ProxyType, + runtime_types::polkadot_runtime::ProxyType, ::core::primitive::u32, ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Announcement<_0, _1, _2> { pub real: _0, pub call_hash: _1, pub height: _2, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ProxyDefinition<_0, _1, _2> { pub delegate: _0, pub proxy_type: _1, pub delay: _2, } } + pub mod pallet_scheduler { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + schedule { + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box, + }, + #[codec(index = 1)] + cancel { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + #[codec(index = 2)] + schedule_named { + id: ::std::vec::Vec<::core::primitive::u8>, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box, + }, + #[codec(index = 3)] + cancel_named { + id: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + schedule_after { + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box, + }, + #[codec(index = 5)] + schedule_named_after { + id: ::std::vec::Vec<::core::primitive::u8>, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + FailedToSchedule, + #[codec(index = 1)] + NotFound, + #[codec(index = 2)] + TargetBlockNumberInPast, + #[codec(index = 3)] + RescheduleNoChange, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + Scheduled(::core::primitive::u32, ::core::primitive::u32), + #[codec(index = 1)] + Canceled(::core::primitive::u32, ::core::primitive::u32), + #[codec(index = 2)] + Dispatched( + (::core::primitive::u32, ::core::primitive::u32), + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V1, + #[codec(index = 1)] + V2, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ScheduledV2<_0, _1, _2, _3> { + pub maybe_id: + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub priority: ::core::primitive::u8, + pub call: _0, + pub maybe_periodic: ::core::option::Option<(_1, _1)>, + pub origin: _2, + #[codec(skip)] + pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, + } + } pub mod pallet_session { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] set_keys { - keys: runtime_types::rococo_runtime::SessionKeys, + keys: runtime_types::polkadot_runtime::SessionKeys, proof: ::std::vec::Vec<::core::primitive::u8>, }, #[codec(index = 1)] purge_keys, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] InvalidProof, @@ -10908,75 +18319,403 @@ pub mod api { #[codec(index = 4)] NoAccount, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] NewSession(::core::primitive::u32), } } } - pub mod pallet_sudo { + pub mod pallet_staking { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - #[codec(index = 0)] - sudo { - call: ::std::boxed::Box, - }, - #[codec(index = 1)] - sudo_unchecked_weight { - call: ::std::boxed::Box, - weight: ::core::primitive::u64, - }, - #[codec(index = 2)] - set_key { - new: ::subxt::sp_runtime::MultiAddress< + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + bond { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + #[codec(index = 1)] + bond_extra { + #[codec(compact)] + max_additional: ::core::primitive::u128, + }, + #[codec(index = 2)] + unbond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 3)] + withdraw_unbonded { + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 4)] + validate { + prefs: runtime_types::pallet_staking::ValidatorPrefs, + }, + #[codec(index = 5)] + nominate { + targets: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + }, + #[codec(index = 6)] + chill, + #[codec(index = 7)] + set_payee { + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + #[codec(index = 8)] + set_controller { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 9)] + set_validator_count { + #[codec(compact)] + new: ::core::primitive::u32, + }, + #[codec(index = 10)] + increase_validator_count { + #[codec(compact)] + additional: ::core::primitive::u32, + }, + #[codec(index = 11)] + scale_validator_count { + factor: runtime_types::sp_arithmetic::per_things::Percent, + }, + #[codec(index = 12)] + force_no_eras, + #[codec(index = 13)] + force_new_era, + #[codec(index = 14)] + set_invulnerables { + invulnerables: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, + }, + #[codec(index = 15)] + force_unstake { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 16)] + force_new_era_always, + #[codec(index = 17)] + cancel_deferred_slash { + era: ::core::primitive::u32, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, + }, + #[codec(index = 18)] + payout_stakers { + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + }, + #[codec(index = 19)] + rebond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 20)] + set_history_depth { + #[codec(compact)] + new_history_depth: ::core::primitive::u32, + #[codec(compact)] + era_items_deleted: ::core::primitive::u32, + }, + #[codec(index = 21)] + reap_stash { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 22)] + kick { + who: ::std::vec::Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + }, + #[codec(index = 23)] + set_staking_limits { + min_nominator_bond: ::core::primitive::u128, + min_validator_bond: ::core::primitive::u128, + max_nominator_count: + ::core::option::Option<::core::primitive::u32>, + max_validator_count: + ::core::option::Option<::core::primitive::u32>, + threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + }, + #[codec(index = 24)] + chill_other { + controller: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + NotController, + #[codec(index = 1)] + NotStash, + #[codec(index = 2)] + AlreadyBonded, + #[codec(index = 3)] + AlreadyPaired, + #[codec(index = 4)] + EmptyTargets, + #[codec(index = 5)] + DuplicateIndex, + #[codec(index = 6)] + InvalidSlashIndex, + #[codec(index = 7)] + InsufficientBond, + #[codec(index = 8)] + NoMoreChunks, + #[codec(index = 9)] + NoUnlockChunk, + #[codec(index = 10)] + FundedTarget, + #[codec(index = 11)] + InvalidEraToReward, + #[codec(index = 12)] + InvalidNumberOfNominations, + #[codec(index = 13)] + NotSortedAndUnique, + #[codec(index = 14)] + AlreadyClaimed, + #[codec(index = 15)] + IncorrectHistoryDepth, + #[codec(index = 16)] + IncorrectSlashingSpans, + #[codec(index = 17)] + BadState, + #[codec(index = 18)] + TooManyTargets, + #[codec(index = 19)] + BadTarget, + #[codec(index = 20)] + CannotChillOther, + #[codec(index = 21)] + TooManyNominators, + #[codec(index = 22)] + TooManyValidators, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + EraPaid( + ::core::primitive::u32, + ::core::primitive::u128, + ::core::primitive::u128, + ), + #[codec(index = 1)] + Rewarded( ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - #[codec(index = 3)] - sudo_as { - who: ::subxt::sp_runtime::MultiAddress< + ::core::primitive::u128, + ), + #[codec(index = 2)] + Slashed( ::subxt::sp_core::crypto::AccountId32, - (), - >, - call: ::std::boxed::Box, - }, + ::core::primitive::u128, + ), + #[codec(index = 3)] + OldSlashingReportDiscarded(::core::primitive::u32), + #[codec(index = 4)] + StakersElected, + #[codec(index = 5)] + Bonded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 6)] + Unbonded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 7)] + Withdrawn( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 8)] + Kicked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 9)] + StakingElectionFailed, + #[codec(index = 10)] + Chilled(::subxt::sp_core::crypto::AccountId32), + #[codec(index = 11)] + PayoutStarted( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - #[codec(index = 0)] - RequireSudo, + } + pub mod slashing { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SlashingSpans { + pub span_index: ::core::primitive::u32, + pub last_start: ::core::primitive::u32, + pub last_nonzero_slash: ::core::primitive::u32, + pub prior: ::std::vec::Vec<::core::primitive::u32>, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - #[codec(index = 0)] - Sudid( - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - #[codec(index = 1)] - KeyChanged(::subxt::sp_core::crypto::AccountId32), - #[codec(index = 2)] - SudoAsDone( - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SpanRecord<_0> { + pub slashed: _0, + pub paid_out: _0, } } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ActiveEraInfo { + pub index: ::core::primitive::u32, + pub start: ::core::option::Option<::core::primitive::u64>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct EraRewardPoints<_0> { + pub total: ::core::primitive::u32, + pub individual: ::std::collections::BTreeMap<_0, ::core::primitive::u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Exposure<_0, _1> { + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub own: _1, + pub others: ::std::vec::Vec< + runtime_types::pallet_staking::IndividualExposure<_0, _1>, + >, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Forcing { + #[codec(index = 0)] + NotForcing, + #[codec(index = 1)] + ForceNew, + #[codec(index = 2)] + ForceNone, + #[codec(index = 3)] + ForceAlways, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct IndividualExposure<_0, _1> { + pub who: _0, + #[codec(compact)] + pub value: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Nominations<_0> { + pub targets: ::std::vec::Vec<_0>, + pub submitted_in: ::core::primitive::u32, + pub suppressed: ::core::primitive::bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V1_0_0Ancient, + #[codec(index = 1)] + V2_0_0, + #[codec(index = 2)] + V3_0_0, + #[codec(index = 3)] + V4_0_0, + #[codec(index = 4)] + V5_0_0, + #[codec(index = 5)] + V6_0_0, + #[codec(index = 6)] + V7_0_0, + #[codec(index = 7)] + V8_0_0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum RewardDestination<_0> { + #[codec(index = 0)] + Staked, + #[codec(index = 1)] + Stash, + #[codec(index = 2)] + Controller, + #[codec(index = 3)] + Account(_0), + #[codec(index = 4)] + None, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct StakingLedger<_0, _1> { + pub stash: _0, + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub active: _1, + pub unlocking: + ::std::vec::Vec>, + pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnappliedSlash<_0, _1> { + pub validator: _0, + pub own: _1, + pub others: ::std::vec::Vec<(_0, _1)>, + pub reporters: ::std::vec::Vec<_0>, + pub payout: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct UnlockChunk<_0> { + #[codec(compact)] + pub value: _0, + #[codec(compact)] + pub era: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ValidatorPrefs { + #[codec(compact)] + pub commission: runtime_types::sp_arithmetic::per_things::Perbill, + pub blocked: ::core::primitive::bool, + } } pub mod pallet_timestamp { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] set { @@ -10986,13 +18725,98 @@ pub mod api { } } } + pub mod pallet_tips { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + report_awesome { + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + retract_tip { hash: ::subxt::sp_core::H256 }, + #[codec(index = 2)] + tip_new { + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + #[codec(index = 3)] + tip { + hash: ::subxt::sp_core::H256, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + #[codec(index = 4)] + close_tip { hash: ::subxt::sp_core::H256 }, + #[codec(index = 5)] + slash_tip { hash: ::subxt::sp_core::H256 }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + ReasonTooBig, + #[codec(index = 1)] + AlreadyKnown, + #[codec(index = 2)] + UnknownTip, + #[codec(index = 3)] + NotFinder, + #[codec(index = 4)] + StillOpen, + #[codec(index = 5)] + Premature, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + NewTip(::subxt::sp_core::H256), + #[codec(index = 1)] + TipClosing(::subxt::sp_core::H256), + #[codec(index = 2)] + TipClosed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 3)] + TipRetracted(::subxt::sp_core::H256), + #[codec(index = 4)] + TipSlashed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct OpenTip<_0, _1, _2, _3> { + pub reason: _3, + pub who: _0, + pub finder: _0, + pub deposit: _1, + pub closes: ::core::option::Option<_2>, + pub tips: ::std::vec::Vec<(_0, _1)>, + pub finders_fee: ::core::primitive::bool, + } + } pub mod pallet_transaction_payment { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ChargeTransactionPayment( #[codec(compact)] pub ::core::primitive::u128, ); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Releases { #[codec(index = 0)] V1Ancient, @@ -11000,32 +18824,116 @@ pub mod api { V2, } } + pub mod pallet_treasury { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + propose_spend { + #[codec(compact)] + value: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 1)] + reject_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 2)] + approve_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + InsufficientProposersBalance, + #[codec(index = 1)] + InvalidIndex, + #[codec(index = 2)] + TooManyApprovals, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + Proposed(::core::primitive::u32), + #[codec(index = 1)] + Spending(::core::primitive::u128), + #[codec(index = 2)] + Awarded( + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ), + #[codec(index = 3)] + Rejected(::core::primitive::u32, ::core::primitive::u128), + #[codec(index = 4)] + Burnt(::core::primitive::u128), + #[codec(index = 5)] + Rollover(::core::primitive::u128), + #[codec(index = 6)] + Deposit(::core::primitive::u128), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Proposal<_0, _1> { + pub proposer: _0, + pub value: _1, + pub beneficiary: _0, + pub bond: _1, + } + } pub mod pallet_utility { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] batch { - calls: ::std::vec::Vec, + calls: ::std::vec::Vec, }, #[codec(index = 1)] as_derivative { index: ::core::primitive::u16, - call: ::std::boxed::Box, + call: ::std::boxed::Box, }, #[codec(index = 2)] batch_all { - calls: ::std::vec::Vec, + calls: ::std::vec::Vec, + }, + #[codec(index = 3)] + dispatch_as { + as_origin: ::std::boxed::Box< + runtime_types::polkadot_runtime::OriginCaller, + >, + call: ::std::boxed::Box, }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] TooManyCalls, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] BatchInterrupted( @@ -11036,238 +18944,129 @@ pub mod api { BatchCompleted, #[codec(index = 2)] ItemCompleted, + #[codec(index = 3)] + DispatchedAs( + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), } } } - pub mod pallet_xcm { + pub mod pallet_vesting { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Call { #[codec(index = 0)] - send { - dest: - ::std::boxed::Box, - message: ::std::boxed::Box, - }, + vest, #[codec(index = 1)] - teleport_assets { - dest: - ::std::boxed::Box, - beneficiary: - ::std::boxed::Box, - assets: - ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, + vest_other { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, }, #[codec(index = 2)] - reserve_transfer_assets { - dest: - ::std::boxed::Box, - beneficiary: - ::std::boxed::Box, - assets: - ::std::boxed::Box, - fee_asset_item: ::core::primitive::u32, + vested_transfer { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, }, #[codec(index = 3)] - execute { - message: ::std::boxed::Box, - max_weight: ::core::primitive::u64, + force_vested_transfer { + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, }, #[codec(index = 4)] - force_xcm_version { - location: ::std::boxed::Box< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - xcm_version: ::core::primitive::u32, - }, - #[codec(index = 5)] - force_default_xcm_version { - maybe_xcm_version: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 6)] - force_subscribe_version_notify { - location: - ::std::boxed::Box, - }, - #[codec(index = 7)] - force_unsubscribe_version_notify { - location: - ::std::boxed::Box, + merge_schedules { + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, }, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Error { #[codec(index = 0)] - Unreachable, + NotVesting, #[codec(index = 1)] - SendFailure, + AtMaxVestingSchedules, #[codec(index = 2)] - Filtered, + AmountLow, #[codec(index = 3)] - UnweighableMessage, + ScheduleIndexOutOfBounds, #[codec(index = 4)] - DestinationNotInvertible, - #[codec(index = 5)] - Empty, - #[codec(index = 6)] - CannotReanchor, - #[codec(index = 7)] - TooManyAssets, - #[codec(index = 8)] - InvalidOrigin, - #[codec(index = 9)] - BadVersion, - #[codec(index = 10)] - BadLocation, - #[codec(index = 11)] - NoSubscription, - #[codec(index = 12)] - AlreadySubscribed, + InvalidScheduleParams, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum Event { #[codec(index = 0)] - Attempted(runtime_types::xcm::v2::traits::Outcome), + VestingUpdated( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), #[codec(index = 1)] - Sent( - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::v2::Xcm, - ), - #[codec(index = 2)] - UnexpectedResponse( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ), - #[codec(index = 3)] - ResponseReady( - ::core::primitive::u64, - runtime_types::xcm::v2::Response, - ), - #[codec(index = 4)] - Notified( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 5)] - NotifyOverweight( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ::core::primitive::u64, - ::core::primitive::u64, - ), - #[codec(index = 6)] - NotifyDispatchError( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 7)] - NotifyDecodeFailed( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), - #[codec(index = 8)] - InvalidResponder( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ::core::option::Option< - runtime_types::xcm::v1::multilocation::MultiLocation, - >, - ), - #[codec(index = 9)] - InvalidResponderVersion( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - ), - #[codec(index = 10)] - ResponseTaken(::core::primitive::u64), - #[codec(index = 11)] - AssetsTrapped( - ::subxt::sp_core::H256, - runtime_types::xcm::v1::multilocation::MultiLocation, - runtime_types::xcm::VersionedMultiAssets, - ), - #[codec(index = 12)] - VersionChangeNotified( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u32, - ), - #[codec(index = 13)] - SupportedVersionChanged( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u32, - ), - #[codec(index = 14)] - NotifyTargetSendFail( - runtime_types::xcm::v1::multilocation::MultiLocation, - ::core::primitive::u64, - runtime_types::xcm::v2::traits::Error, - ), - #[codec(index = 15)] - NotifyTargetMigrationFail( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u64, - ), + VestingCompleted(::subxt::sp_core::crypto::AccountId32), } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 vesting_info { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct VestingInfo<_0, _1> { + pub locked: _0, + pub per_block: _0, + pub starting_block: _1, } } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Releases { + #[codec(index = 0)] + V0, + #[codec(index = 1)] + V1, + } } pub mod polkadot_core_primitives { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CandidateHash(pub ::subxt::sp_core::H256); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct InboundDownwardMessage<_0> { pub sent_at: _0, pub msg: ::std::vec::Vec<::core::primitive::u8>, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct InboundHrmpMessage<_0> { pub sent_at: _0, pub data: ::std::vec::Vec<::core::primitive::u8>, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct OutboundHrmpMessage<_0> { pub recipient: _0, pub data: ::std::vec::Vec<::core::primitive::u8>, @@ -11277,9 +19076,13 @@ pub mod api { use super::runtime_types; pub mod primitives { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct HeadData(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct HrmpChannelId { pub sender: runtime_types::polkadot_parachain::primitives::Id, pub recipient: runtime_types::polkadot_parachain::primitives::Id, @@ -11288,11 +19091,16 @@ pub mod api { :: subxt :: codec :: CompactAs, :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + Debug, )] pub struct Id(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ValidationCode(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ValidationCodeHash(pub ::subxt::sp_core::H256); } } @@ -11303,22 +19111,22 @@ pub mod api { pub mod collator_app { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } pub mod validator_app { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } @@ -11326,9 +19134,12 @@ pub mod api { :: subxt :: codec :: CompactAs, :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + Debug, )] pub struct ValidatorIndex(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum ValidityAttestation { #[codec(index = 1)] Implicit( @@ -11345,25 +19156,29 @@ pub mod api { pub mod assignment_app { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } pub mod signed { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > , } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct AvailabilityBitfield( pub ::subxt::bitvec::vec::BitVec< ::subxt::bitvec::order::Lsb0, ::core::primitive::u8, >, ); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct BackedCandidate<_0> { pub candidate: runtime_types::polkadot_primitives::v1::CommittedCandidateReceipt< @@ -11377,7 +19192,9 @@ pub mod api { ::core::primitive::u8, >, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct CandidateCommitments<_0> { pub upward_messages: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, @@ -11394,7 +19211,9 @@ pub mod api { pub processed_downward_messages: _0, pub hrmp_watermark: _0, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct CandidateDescriptor<_0> { pub para_id: runtime_types::polkadot_parachain::primitives::Id, pub relay_parent: _0, @@ -11409,13 +19228,17 @@ pub mod api { pub validation_code_hash: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct CandidateReceipt<_0> { pub descriptor: runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, pub commitments_hash: _0, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct CommittedCandidateReceipt<_0> { pub descriptor: runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, @@ -11428,32 +19251,26 @@ pub mod api { :: subxt :: codec :: CompactAs, :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + Debug, )] pub struct CoreIndex(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum CoreOccupied { #[codec(index = 0)] Parathread(runtime_types::polkadot_primitives::v1::ParathreadEntry), #[codec(index = 1)] Parachain, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DisputeState<_0> { - pub validators_for: ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, - ::core::primitive::u8, - >, - pub validators_against: ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, - ::core::primitive::u8, - >, - pub start: _0, - pub concluded_at: ::core::option::Option<_0>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum DisputeStatement { # [codec (index = 0)] Valid (runtime_types :: polkadot_primitives :: v1 :: ValidDisputeStatementKind ,) , # [codec (index = 1)] Invalid (runtime_types :: polkadot_primitives :: v1 :: InvalidDisputeStatementKind ,) , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct DisputeStatementSet { pub candidate_hash: runtime_types::polkadot_core_primitives::CandidateHash, @@ -11468,9 +19285,12 @@ pub mod api { :: subxt :: codec :: CompactAs, :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + Debug, )] pub struct GroupIndex(pub ::core::primitive::u32); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct InherentData<_0> { pub bitfields: ::std::vec::Vec< runtime_types::polkadot_primitives::v1::signed::UncheckedSigned< @@ -11488,22 +19308,46 @@ pub mod api { >, pub parent_header: _0, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum InvalidDisputeStatementKind { #[codec(index = 0)] Explicit, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ParathreadClaim( pub runtime_types::polkadot_parachain::primitives::Id, pub runtime_types::polkadot_primitives::v0::collator_app::Public, ); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ParathreadEntry { pub claim: runtime_types::polkadot_primitives::v1::ParathreadClaim, pub retries: ::core::primitive::u32, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct ScrapedOnChainVotes<_0> { + pub session: ::core::primitive::u32, + pub backing_validators_per_candidate: ::std::vec::Vec<( + runtime_types::polkadot_primitives::v1::CandidateReceipt<_0>, + ::std::vec::Vec<( + runtime_types::polkadot_primitives::v0::ValidatorIndex, + runtime_types::polkadot_primitives::v0::ValidityAttestation, + )>, + )>, + pub disputes: ::std::vec::Vec< + runtime_types::polkadot_primitives::v1::DisputeStatementSet, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct SessionInfo { pub validators: ::std::vec::Vec< runtime_types::polkadot_primitives::v0::validator_app::Public, @@ -11526,19 +19370,25 @@ pub mod api { pub no_show_slots: ::core::primitive::u32, pub needed_approvals: ::core::primitive::u32, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum UpgradeGoAhead { #[codec(index = 0)] Abort, #[codec(index = 1)] GoAhead, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum UpgradeRestriction { #[codec(index = 0)] Present, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum ValidDisputeStatementKind { #[codec(index = 0)] Explicit, @@ -11551,6 +19401,198 @@ pub mod api { } } } + pub mod polkadot_runtime { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Call { + # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Call ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Call ,) , # [codec (index = 2)] Babe (runtime_types :: pallet_babe :: pallet :: Call ,) , # [codec (index = 3)] Timestamp (runtime_types :: pallet_timestamp :: pallet :: Call ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Call ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Call ,) , # [codec (index = 6)] Authorship (runtime_types :: pallet_authorship :: pallet :: Call ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Call ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Call ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Call ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Call ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Call ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Call ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Call ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Call ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Call ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Call ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Call ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Call ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Call ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Call ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Call ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Call ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Call ,) , # [codec (index = 37)] BagsList (runtime_types :: pallet_bags_list :: pallet :: Call ,) , # [codec (index = 51)] Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , # [codec (index = 52)] ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , # [codec (index = 54)] ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , # [codec (index = 57)] Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , # [codec (index = 58)] Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Call ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Call ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Call ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Call ,) , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Event { + # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Event ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , # [codec (index = 8)] Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Event ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , # [codec (index = 37)] BagsList (runtime_types :: pallet_bags_list :: pallet :: Event ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct NposCompactSolution16 { + votes1: ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u16)>, + votes2: ::std::vec::Vec<( + ::core::primitive::u32, + ( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ), + ::core::primitive::u16, + )>, + votes3: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 2usize], + ::core::primitive::u16, + )>, + votes4: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 3usize], + ::core::primitive::u16, + )>, + votes5: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 4usize], + ::core::primitive::u16, + )>, + votes6: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 5usize], + ::core::primitive::u16, + )>, + votes7: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 6usize], + ::core::primitive::u16, + )>, + votes8: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 7usize], + ::core::primitive::u16, + )>, + votes9: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 8usize], + ::core::primitive::u16, + )>, + votes10: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 9usize], + ::core::primitive::u16, + )>, + votes11: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 10usize], + ::core::primitive::u16, + )>, + votes12: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 11usize], + ::core::primitive::u16, + )>, + votes13: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 12usize], + ::core::primitive::u16, + )>, + votes14: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 13usize], + ::core::primitive::u16, + )>, + votes15: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 14usize], + ::core::primitive::u16, + )>, + votes16: ::std::vec::Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 15usize], + ::core::primitive::u16, + )>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum OriginCaller { + #[codec(index = 0)] + system( + runtime_types::frame_system::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 15)] + Council( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 16)] + TechnicalCommittee( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 50)] + ParachainsOrigin( + runtime_types::polkadot_runtime_parachains::origin::pallet::Origin, + ), + #[codec(index = 4)] + Void(runtime_types::sp_core::Void), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum ProxyType { + #[codec(index = 0)] + Any, + #[codec(index = 1)] + NonTransfer, + #[codec(index = 2)] + Governance, + #[codec(index = 3)] + Staking, + #[codec(index = 5)] + IdentityJudgement, + #[codec(index = 6)] + CancelProxy, + #[codec(index = 7)] + Auction, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Runtime {} + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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::v0::validator_app::Public, + pub para_assignment: + runtime_types::polkadot_primitives::v1::assignment_app::Public, + pub authority_discovery: + runtime_types::sp_authority_discovery::app::Public, + } + } pub mod polkadot_runtime_common { use super::runtime_types; pub mod auctions { @@ -11558,7 +19600,7 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { #[codec(index = 0)] @@ -11585,7 +19627,7 @@ pub mod api { cancel_auction, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -11604,7 +19646,7 @@ pub mod api { AlreadyLeasedOut, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -11645,12 +19687,66 @@ pub mod api { } } } + pub mod claims { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + # [codec (index = 0)] claim { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , # [codec (index = 1)] mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : :: core :: primitive :: u128 , vesting_schedule : :: core :: option :: Option < (:: core :: primitive :: u128 , :: core :: primitive :: u128 , :: core :: primitive :: u32 ,) > , statement : :: core :: option :: Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , # [codec (index = 2)] claim_attest { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 3)] attest { statement : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , # [codec (index = 4)] move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : :: core :: option :: Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + InvalidEthereumSignature, + #[codec(index = 1)] + SignerHasNoClaim, + #[codec(index = 2)] + SenderHasNoClaim, + #[codec(index = 3)] + PotUnderflow, + #[codec(index = 4)] + InvalidStatement, + #[codec(index = 5)] + VestedBalanceExists, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + # [codec (index = 0)] Claimed (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , :: core :: primitive :: u128 ,) , } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct EcdsaSignature(pub [::core::primitive::u8; 65usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct EthereumAddress(pub [::core::primitive::u8; 20usize]); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct PrevalidateAttests {} + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum StatementKind { + #[codec(index = 0)] + Regular, + #[codec(index = 1)] + Saft, + } + } pub mod crowdloan { use super::runtime_types; pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { #[codec(index = 0)] @@ -11722,7 +19818,7 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -11773,7 +19869,7 @@ pub mod api { NoLeasePeriod, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -11820,9 +19916,13 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : :: core :: option :: Option < runtime_types :: sp_runtime :: MultiSigner > , 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 trie_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum LastContribution<_0> { #[codec(index = 0)] Never, @@ -11837,12 +19937,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { # [codec (index = 0)] 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)] 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)] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] reserve , } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -11871,7 +19971,7 @@ pub mod api { NotReserved, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -11888,51 +19988,21 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Call { - # [codec (index = 0)] sudo_schedule_para_initialize { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis : runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs , } , # [codec (index = 1)] sudo_schedule_para_cleanup { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] sudo_schedule_parathread_upgrade { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] sudo_schedule_parachain_downgrade { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] sudo_queue_downward_xcm { id : runtime_types :: polkadot_parachain :: primitives :: Id , xcm : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , } , # [codec (index = 5)] 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 :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Error { - #[codec(index = 0)] - ParaDoesntExist, - #[codec(index = 1)] - ParaAlreadyExists, - #[codec(index = 2)] - ExceedsMaxMessageSize, - #[codec(index = 3)] - CouldntCleanup, - #[codec(index = 4)] - NotParathread, - #[codec(index = 5)] - NotParachain, - #[codec(index = 6)] - CannotUpgrade, - #[codec(index = 7)] - CannotDowngrade, - } - } - } pub mod slots { use super::runtime_types; pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { #[codec(index = 0)] @@ -11953,7 +20023,7 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -11962,7 +20032,7 @@ pub mod api { LeaseError, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -11987,7 +20057,7 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { #[codec(index = 0)] @@ -12094,14 +20164,16 @@ pub mod api { set_ump_max_individual_weight { new: ::core::primitive::u64 }, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] InvalidNewValue, } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct HostConfiguration<_0> { pub max_code_size: _0, pub max_head_data_size: _0, @@ -12145,56 +20217,12 @@ pub mod api { pub ump_max_individual_weight: ::core::primitive::u64, } } - pub mod disputes { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Error { - #[codec(index = 0)] - DuplicateDisputeStatementSets, - #[codec(index = 1)] - AncientDisputeStatement, - #[codec(index = 2)] - ValidatorIndexOutOfBounds, - #[codec(index = 3)] - InvalidSignature, - #[codec(index = 4)] - DuplicateStatement, - #[codec(index = 5)] - PotentialSpam, - #[codec(index = 6)] - SingleSidedDispute, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Event { - # [codec (index = 0)] DisputeInitiated (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeLocation ,) , # [codec (index = 1)] DisputeConcluded (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeResult ,) , # [codec (index = 2)] DisputeTimedOut (runtime_types :: polkadot_core_primitives :: CandidateHash ,) , # [codec (index = 3)] Revert (:: core :: primitive :: u32 ,) , } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum DisputeLocation { - #[codec(index = 0)] - Local, - #[codec(index = 1)] - Remote, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call {} } @@ -12204,12 +20232,12 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { # [codec (index = 0)] 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)] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] force_process_hrmp_open , # [codec (index = 5)] force_process_hrmp_close , # [codec (index = 6)] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -12250,7 +20278,7 @@ pub mod api { OpenHrmpChannelAlreadyConfirmed, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -12277,7 +20305,9 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct HrmpChannel { pub max_capacity: ::core::primitive::u32, pub max_total_size: ::core::primitive::u32, @@ -12288,7 +20318,9 @@ pub mod api { pub sender_deposit: ::core::primitive::u128, pub recipient_deposit: ::core::primitive::u128, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct HrmpOpenChannelRequest { pub confirmed: ::core::primitive::bool, pub _age: ::core::primitive::u32, @@ -12303,11 +20335,11 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call {} #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -12335,34 +20367,30 @@ pub mod api { #[codec(index = 11)] CandidateNotInParentContext, #[codec(index = 12)] - UnoccupiedBitInBitfield, - #[codec(index = 13)] InvalidGroupIndex, - #[codec(index = 14)] + #[codec(index = 13)] InsufficientBacking, - #[codec(index = 15)] + #[codec(index = 14)] InvalidBacking, - #[codec(index = 16)] + #[codec(index = 15)] NotCollatorSigned, - #[codec(index = 17)] + #[codec(index = 16)] ValidationDataHashMismatch, - #[codec(index = 18)] - InternalError, - #[codec(index = 19)] + #[codec(index = 17)] IncorrectDownwardMessageHandling, - #[codec(index = 20)] + #[codec(index = 18)] InvalidUpwardMessages, - #[codec(index = 21)] + #[codec(index = 19)] HrmpWatermarkMishandling, - #[codec(index = 22)] + #[codec(index = 20)] InvalidOutboundHrmp, - #[codec(index = 23)] + #[codec(index = 21)] InvalidValidationCodeHash, - #[codec(index = 24)] + #[codec(index = 22)] ParaHeadMismatch, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -12393,13 +20421,17 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct AvailabilityBitfieldRecord<_0> { pub bitfield: runtime_types::polkadot_primitives::v1::AvailabilityBitfield, pub submitted_at: _0, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct CandidatePendingAvailability<_0, _1> { pub core: runtime_types::polkadot_primitives::v1::CoreIndex, pub hash: runtime_types::polkadot_core_primitives::CandidateHash, @@ -12423,14 +20455,16 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { #[codec(index = 0)] force_approve { up_to: ::core::primitive::u32 }, } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct BufferedSessionChange { pub validators: ::std::vec::Vec< runtime_types::polkadot_primitives::v0::validator_app::Public, @@ -12441,17 +20475,30 @@ pub mod api { pub session_index: ::core::primitive::u32, } } + pub mod origin { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { # [codec (index = 0)] force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 2)] 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)] force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 4)] force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -12466,7 +20513,7 @@ pub mod api { CannotDowngrade, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -12490,7 +20537,9 @@ pub mod api { ), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ParaGenesisArgs { pub genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, @@ -12498,7 +20547,9 @@ pub mod api { runtime_types::polkadot_parachain::primitives::ValidationCode, pub parachain: ::core::primitive::bool, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum ParaLifecycle { #[codec(index = 0)] Onboarding, @@ -12515,9 +20566,13 @@ pub mod api { #[codec(index = 6)] OffboardingParachain, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ReplacementTimes<_0> { pub expected_at: _0, pub activated_at: _0, @@ -12528,7 +20583,7 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { #[codec(index = 0)] @@ -12542,7 +20597,7 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -12556,7 +20611,9 @@ pub mod api { } pub mod scheduler { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum AssignmentKind { #[codec(index = 0)] Parachain, @@ -12566,11 +20623,17 @@ pub mod api { ::core::primitive::u32, ), } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v1 :: 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 :: v1 :: GroupIndex , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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 :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct QueuedParathread { pub claim: runtime_types::polkadot_primitives::v1::ParathreadEntry, pub core_offset: ::core::primitive::u32, @@ -12581,7 +20644,7 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call {} } @@ -12591,7 +20654,7 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { #[codec(index = 0)] @@ -12601,7 +20664,7 @@ pub mod api { }, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -12610,7 +20673,7 @@ pub mod api { WeightOverLimit, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Event { #[codec(index = 0)] @@ -12652,68 +20715,9 @@ pub mod api { } pub mod primitive_types { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - #[codec(index = 0)] - register_validators { - validators: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - #[codec(index = 1)] - deregister_validators { - validators: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error {} - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum RawEvent<_0> { - #[codec(index = 0)] - ValidatorsRegistered(::std::vec::Vec<_0>), - #[codec(index = 1)] - ValidatorsDeregistered(::std::vec::Vec<_0>), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 = 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)] Sudo (runtime_types :: pallet_sudo :: pallet :: Call ,) , # [codec (index = 35)] ValidatorManager (runtime_types :: rococo_runtime :: validator_manager :: 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 :: Encode, :: subxt :: codec :: Decode)] - 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)] Sudo (runtime_types :: pallet_sudo :: pallet :: Event ,) , # [codec (index = 35)] ValidatorManager (runtime_types :: rococo_runtime :: validator_manager :: RawEvent < :: subxt :: sp_core :: crypto :: AccountId32 > ,) , # [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 :: Encode, :: subxt :: codec :: Decode)] - pub enum ProxyType { - #[codec(index = 0)] - Any, - #[codec(index = 1)] - CancelProxy, - #[codec(index = 2)] - Auction, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Runtime {} - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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::v0::validator_app::Public, - pub para_assignment: - runtime_types::polkadot_primitives::v1::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 { @@ -12722,6 +20726,7 @@ pub mod api { :: subxt :: codec :: CompactAs, :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + Debug, )] pub struct FixedU128(pub ::core::primitive::u128); } @@ -12731,15 +20736,39 @@ pub mod api { :: subxt :: codec :: CompactAs, :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + Debug, + )] + pub struct PerU16(pub ::core::primitive::u16); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, )] pub struct Perbill(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + )] + pub struct Percent(pub ::core::primitive::u8); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + )] + pub struct Permill(pub ::core::primitive::u32); } } pub mod sp_authority_discovery { use super::runtime_types; pub mod app { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } } @@ -12747,12 +20776,16 @@ pub mod api { use super::runtime_types; pub mod app { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } pub mod digests { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum NextConfigDescriptor { #[codec(index = 1)] V1 { @@ -12761,7 +20794,7 @@ pub mod api { }, } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum AllowedSlots { #[codec(index = 0)] PrimarySlots, @@ -12770,7 +20803,7 @@ pub mod api { #[codec(index = 2)] PrimaryAndSecondaryVRFSlots, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct BabeEpochConfiguration { pub c: (::core::primitive::u64, ::core::primitive::u64), pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, @@ -12778,7 +20811,7 @@ pub mod api { } pub mod sp_consensus_slots { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct EquivocationProof<_0, _1> { pub offender: _1, pub slot: runtime_types::sp_consensus_slots::Slot, @@ -12789,6 +20822,7 @@ pub mod api { :: subxt :: codec :: CompactAs, :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + Debug, )] pub struct Slot(pub ::core::primitive::u64); } @@ -12796,7 +20830,9 @@ pub mod api { use super::runtime_types; pub mod changes_trie { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ChangesTrieConfiguration { pub digest_interval: ::core::primitive::u32, pub digest_levels: ::core::primitive::u32, @@ -12804,30 +20840,46 @@ pub mod api { } pub mod crypto { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct AccountId32(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); } pub mod ecdsa { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Public(pub [::core::primitive::u8; 33usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Signature(pub [::core::primitive::u8; 65usize]); } pub mod ed25519 { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Signature(pub [::core::primitive::u8; 64usize]); } pub mod offchain { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct OpaqueNetworkState { pub peer_id: runtime_types::sp_core::OpaquePeerId, pub external_addresses: ::std::vec::Vec< @@ -12837,24 +20889,34 @@ pub mod api { } pub mod sr25519 { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Signature(pub [::core::primitive::u8; 64usize]); } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum Void {} } pub mod sp_finality_grandpa { use super::runtime_types; pub mod app { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Public(pub runtime_types::sp_core::ed25519::Public); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Equivocation<_0, _1> { #[codec(index = 0)] Prevote( @@ -12873,13 +20935,21 @@ pub mod api { >, ), } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, 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_npos_elections { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Support<_0> { + pub total: ::core::primitive::u128, + pub voters: ::std::vec::Vec<(_0, ::core::primitive::u128)>, + } + } pub mod sp_runtime { use super::runtime_types; pub mod generic { @@ -12887,12 +20957,12 @@ pub mod api { pub mod digest { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum ChangesTrieSignal { # [codec (index = 0)] NewConfiguration (:: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > ,) , } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Digest<_0> { pub logs: ::std::vec::Vec< @@ -12900,7 +20970,7 @@ pub mod api { >, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum DigestItem<_0> { #[codec(index = 2)] @@ -12933,7 +21003,7 @@ pub mod api { pub mod era { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Era { #[codec(index = 0)] @@ -13453,7 +21523,7 @@ pub mod api { pub mod header { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Header<_0, _1> { pub parent_hash: ::subxt::sp_core::H256, @@ -13471,17 +21541,19 @@ pub mod api { pub mod unchecked_extrinsic { use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct UncheckedExtrinsic<_0, _1, _2, _3>( ::std::vec::Vec<::core::primitive::u8>, - #[codec(skip)] pub ::core::marker::PhantomData<(_0, _2, _1, _3)>, + #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, ); } } pub mod multiaddress { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum MultiAddress<_0, _1> { #[codec(index = 0)] Id(_0), @@ -13497,10 +21569,12 @@ pub mod api { } pub mod traits { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct BlakeTwo256 {} } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum ArithmeticError { #[codec(index = 0)] Underflow, @@ -13509,7 +21583,7 @@ pub mod api { #[codec(index = 2)] DivisionByZero, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum DispatchError { #[codec(index = 0)] Other, @@ -13531,7 +21605,7 @@ pub mod api { #[codec(index = 7)] Arithmetic(runtime_types::sp_runtime::ArithmeticError), } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum MultiSignature { #[codec(index = 0)] Ed25519(runtime_types::sp_core::ed25519::Signature), @@ -13540,7 +21614,7 @@ pub mod api { #[codec(index = 2)] Ecdsa(runtime_types::sp_core::ecdsa::Signature), } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum MultiSigner { #[codec(index = 0)] Ed25519(runtime_types::sp_core::ed25519::Public), @@ -13549,7 +21623,7 @@ pub mod api { #[codec(index = 2)] Ecdsa(runtime_types::sp_core::ecdsa::Public), } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum TokenError { #[codec(index = 0)] NoFunds, @@ -13569,7 +21643,7 @@ pub mod api { } pub mod sp_session { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct MembershipProof { pub session: ::core::primitive::u32, pub trie_nodes: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, @@ -13580,7 +21654,9 @@ pub mod api { use super::runtime_types; pub mod offence { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct OffenceDetails<_0, _1> { pub offender: _1, pub reporters: ::std::vec::Vec<_0>, @@ -13589,7 +21665,7 @@ pub mod api { } pub mod sp_version { use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct RuntimeVersion { pub spec_name: ::std::string::String, pub impl_name: ::std::string::String, @@ -13605,764 +21681,12 @@ pub mod api { } pub mod xcm { use super::runtime_types; - pub mod double_encoded { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Order { - #[codec(index = 0)] - Null, - #[codec(index = 1)] - DepositAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 2)] - DepositReserveAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 3)] - ExchangeAsset { - give: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - receive: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - }, - #[codec(index = 4)] - InitiateReserveWithdraw { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - reserve: - runtime_types::xcm::v0::multi_location::MultiLocation, - effects: - ::std::vec::Vec, - }, - #[codec(index = 5)] - InitiateTeleport { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - 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< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - }, - #[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 :: Encode, :: subxt :: codec :: Decode)] - pub enum OriginKind { - #[codec(index = 0)] - Native, - #[codec(index = 1)] - SovereignAccount, - #[codec(index = 2)] - Superuser, - #[codec(index = 3)] - Xcm, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Response { - #[codec(index = 0)] - Assets( - ::std::vec::Vec, - ), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Xcm { - #[codec(index = 0)] - WithdrawAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - effects: ::std::vec::Vec, - }, - #[codec(index = 1)] - ReserveAssetDeposit { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - effects: ::std::vec::Vec, - }, - #[codec(index = 2)] - TeleportAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - 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< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - dest: runtime_types::xcm::v0::multi_location::MultiLocation, - }, - #[codec(index = 5)] - TransferReserveAsset { - assets: ::std::vec::Vec< - runtime_types::xcm::v0::multi_asset::MultiAsset, - >, - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - pub struct MultiAsset { - pub id: runtime_types::xcm::v1::multiasset::AssetId, - pub fun: runtime_types::xcm::v1::multiasset::Fungibility, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - pub struct MultiAssets( - pub ::std::vec::Vec< - runtime_types::xcm::v1::multiasset::MultiAsset, - >, - ); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum WildFungibility { - #[codec(index = 0)] - Fungible, - #[codec(index = 1)] - NonFungible, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode, - )] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub enum Response { - #[codec(index = 0)] - Assets(runtime_types::xcm::v1::multiasset::MultiAssets), - #[codec(index = 1)] - Version(::core::primitive::u32), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Error { #[codec(index = 0)] @@ -14419,7 +21743,7 @@ pub mod api { WeightNotComputable, } #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Outcome { #[codec(index = 0)] @@ -14433,283 +21757,89 @@ pub mod api { Error(runtime_types::xcm::v2::traits::Error), } } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - pub enum WeightLimit { - #[codec(index = 0)] - Unlimited, - #[codec(index = 1)] - Limited(#[codec(compact)] ::core::primitive::u64), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Xcm(pub ::std::vec::Vec); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum VersionedMultiAssets { - #[codec(index = 0)] - V0(::std::vec::Vec), - #[codec(index = 1)] - V1(runtime_types::xcm::v1::multiasset::MultiAssets), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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 :: Encode, :: subxt :: codec :: Decode)] - 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" Default configuration of common types for a target Substrate runtime."] - #[derive(Clone, Debug, Default, Eq, PartialEq)] - pub struct DefaultConfig; - impl ::subxt::Config for DefaultConfig { - type Index = u32; - type BlockNumber = u32; - type Hash = ::subxt::sp_core::H256; - type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; - type AccountId = ::subxt::sp_runtime::AccountId32; - type Address = ::subxt::sp_runtime::MultiAddress; - type Header = ::subxt::sp_runtime::generic::Header< - Self::BlockNumber, - ::subxt::sp_runtime::traits::BlakeTwo256, - >; - type Signature = ::subxt::sp_runtime::MultiSignature; - type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; + #[doc = r" The default error type returned when there is a runtime issue."] + pub type DispatchError = self::runtime_types::sp_runtime::DispatchError; + pub struct ErrorDetails { + pub pallet: &'static str, + pub error: &'static str, + pub docs: &'static str, } - impl ::subxt::ExtrinsicExtraData for DefaultConfig { - type AccountData = AccountData; - type Extra = ::subxt::DefaultExtra; + impl DispatchError { + pub fn details(&self) -> Option { + if let Self::Module { index, error } = self { + match (index , error) { (0u8 , 0u8) => Some (ErrorDetails { pallet : "System" , error : "InvalidSpecName" , docs : "The name of specification does not match between the current runtime\nand the new runtime." }) , (0u8 , 1u8) => Some (ErrorDetails { pallet : "System" , error : "SpecVersionNeedsToIncrease" , docs : "The specification version is not allowed to decrease between the current runtime\nand the new runtime." }) , (0u8 , 2u8) => Some (ErrorDetails { pallet : "System" , error : "FailedToExtractRuntimeVersion" , docs : "Failed to extract the runtime version from the new runtime.\n\nEither calling `Core_version` or decoding `RuntimeVersion` failed." }) , (0u8 , 3u8) => Some (ErrorDetails { pallet : "System" , error : "NonDefaultComposite" , docs : "Suicide called when the account has non-default composite data." }) , (0u8 , 4u8) => Some (ErrorDetails { pallet : "System" , error : "NonZeroRefCount" , docs : "There is a non-zero reference count preventing the account from being purged." }) , (0u8 , 5u8) => Some (ErrorDetails { pallet : "System" , error : "CallFiltered" , docs : "The origin filter prevent the call to be dispatched." }) , (1u8 , 0u8) => Some (ErrorDetails { pallet : "Scheduler" , error : "FailedToSchedule" , docs : "Failed to schedule a call" }) , (1u8 , 1u8) => Some (ErrorDetails { pallet : "Scheduler" , error : "NotFound" , docs : "Cannot find the scheduled call." }) , (1u8 , 2u8) => Some (ErrorDetails { pallet : "Scheduler" , error : "TargetBlockNumberInPast" , docs : "Given target block number is in the past." }) , (1u8 , 3u8) => Some (ErrorDetails { pallet : "Scheduler" , error : "RescheduleNoChange" , docs : "Reschedule failed because it does not change scheduled time." }) , (2u8 , 0u8) => Some (ErrorDetails { pallet : "Babe" , error : "InvalidEquivocationProof" , docs : "An equivocation proof provided as part of an equivocation report is invalid." }) , (2u8 , 1u8) => Some (ErrorDetails { pallet : "Babe" , error : "InvalidKeyOwnershipProof" , docs : "A key ownership proof provided as part of an equivocation report is invalid." }) , (2u8 , 2u8) => Some (ErrorDetails { pallet : "Babe" , error : "DuplicateOffenceReport" , docs : "A given equivocation report is valid but already previously reported." }) , (4u8 , 0u8) => Some (ErrorDetails { pallet : "Indices" , error : "NotAssigned" , docs : "The index was not already assigned." }) , (4u8 , 1u8) => Some (ErrorDetails { pallet : "Indices" , error : "NotOwner" , docs : "The index is assigned to another account." }) , (4u8 , 2u8) => Some (ErrorDetails { pallet : "Indices" , error : "InUse" , docs : "The index was not available." }) , (4u8 , 3u8) => Some (ErrorDetails { pallet : "Indices" , error : "NotTransfer" , docs : "The source and destination accounts are identical." }) , (4u8 , 4u8) => Some (ErrorDetails { pallet : "Indices" , error : "Permanent" , docs : "The index is permanent and may not be freed/changed." }) , (5u8 , 0u8) => Some (ErrorDetails { pallet : "Balances" , error : "VestingBalance" , docs : "Vesting balance too high to send value" }) , (5u8 , 1u8) => Some (ErrorDetails { pallet : "Balances" , error : "LiquidityRestrictions" , docs : "Account liquidity restrictions prevent withdrawal" }) , (5u8 , 2u8) => Some (ErrorDetails { pallet : "Balances" , error : "InsufficientBalance" , docs : "Balance too low to send value" }) , (5u8 , 3u8) => Some (ErrorDetails { pallet : "Balances" , error : "ExistentialDeposit" , docs : "Value too low to create account due to existential deposit" }) , (5u8 , 4u8) => Some (ErrorDetails { pallet : "Balances" , error : "KeepAlive" , docs : "Transfer/payment would kill account" }) , (5u8 , 5u8) => Some (ErrorDetails { pallet : "Balances" , error : "ExistingVestingSchedule" , docs : "A vesting schedule already exists for this account" }) , (5u8 , 6u8) => Some (ErrorDetails { pallet : "Balances" , error : "DeadAccount" , docs : "Beneficiary account must pre-exist" }) , (5u8 , 7u8) => Some (ErrorDetails { pallet : "Balances" , error : "TooManyReserves" , docs : "Number of named reserves exceed MaxReserves" }) , (6u8 , 0u8) => Some (ErrorDetails { pallet : "Authorship" , error : "InvalidUncleParent" , docs : "The uncle parent not in the chain." }) , (6u8 , 1u8) => Some (ErrorDetails { pallet : "Authorship" , error : "UnclesAlreadySet" , docs : "Uncles already set in the block." }) , (6u8 , 2u8) => Some (ErrorDetails { pallet : "Authorship" , error : "TooManyUncles" , docs : "Too many uncles." }) , (6u8 , 3u8) => Some (ErrorDetails { pallet : "Authorship" , error : "GenesisUncle" , docs : "The uncle is genesis." }) , (6u8 , 4u8) => Some (ErrorDetails { pallet : "Authorship" , error : "TooHighUncle" , docs : "The uncle is too high in chain." }) , (6u8 , 5u8) => Some (ErrorDetails { pallet : "Authorship" , error : "UncleAlreadyIncluded" , docs : "The uncle is already included." }) , (6u8 , 6u8) => Some (ErrorDetails { pallet : "Authorship" , error : "OldUncle" , docs : "The uncle isn't recent enough to be included." }) , (7u8 , 0u8) => Some (ErrorDetails { pallet : "Staking" , error : "NotController" , docs : "Not a controller account." }) , (7u8 , 1u8) => Some (ErrorDetails { pallet : "Staking" , error : "NotStash" , docs : "Not a stash account." }) , (7u8 , 2u8) => Some (ErrorDetails { pallet : "Staking" , error : "AlreadyBonded" , docs : "Stash is already bonded." }) , (7u8 , 3u8) => Some (ErrorDetails { pallet : "Staking" , error : "AlreadyPaired" , docs : "Controller is already paired." }) , (7u8 , 4u8) => Some (ErrorDetails { pallet : "Staking" , error : "EmptyTargets" , docs : "Targets cannot be empty." }) , (7u8 , 5u8) => Some (ErrorDetails { pallet : "Staking" , error : "DuplicateIndex" , docs : "Duplicate index." }) , (7u8 , 6u8) => Some (ErrorDetails { pallet : "Staking" , error : "InvalidSlashIndex" , docs : "Slash record index out of bounds." }) , (7u8 , 7u8) => Some (ErrorDetails { pallet : "Staking" , error : "InsufficientBond" , docs : "Can not bond with value less than minimum required." }) , (7u8 , 8u8) => Some (ErrorDetails { pallet : "Staking" , error : "NoMoreChunks" , docs : "Can not schedule more unlock chunks." }) , (7u8 , 9u8) => Some (ErrorDetails { pallet : "Staking" , error : "NoUnlockChunk" , docs : "Can not rebond without unlocking chunks." }) , (7u8 , 10u8) => Some (ErrorDetails { pallet : "Staking" , error : "FundedTarget" , docs : "Attempting to target a stash that still has funds." }) , (7u8 , 11u8) => Some (ErrorDetails { pallet : "Staking" , error : "InvalidEraToReward" , docs : "Invalid era to reward." }) , (7u8 , 12u8) => Some (ErrorDetails { pallet : "Staking" , error : "InvalidNumberOfNominations" , docs : "Invalid number of nominations." }) , (7u8 , 13u8) => Some (ErrorDetails { pallet : "Staking" , error : "NotSortedAndUnique" , docs : "Items are not sorted and unique." }) , (7u8 , 14u8) => Some (ErrorDetails { pallet : "Staking" , error : "AlreadyClaimed" , docs : "Rewards for this era have already been claimed for this validator." }) , (7u8 , 15u8) => Some (ErrorDetails { pallet : "Staking" , error : "IncorrectHistoryDepth" , docs : "Incorrect previous history depth input provided." }) , (7u8 , 16u8) => Some (ErrorDetails { pallet : "Staking" , error : "IncorrectSlashingSpans" , docs : "Incorrect number of slashing spans provided." }) , (7u8 , 17u8) => Some (ErrorDetails { pallet : "Staking" , error : "BadState" , docs : "Internal state has become somehow corrupted and the operation cannot continue." }) , (7u8 , 18u8) => Some (ErrorDetails { pallet : "Staking" , error : "TooManyTargets" , docs : "Too many nomination targets supplied." }) , (7u8 , 19u8) => Some (ErrorDetails { pallet : "Staking" , error : "BadTarget" , docs : "A nomination target was supplied that was blocked or otherwise not a validator." }) , (7u8 , 20u8) => Some (ErrorDetails { pallet : "Staking" , error : "CannotChillOther" , docs : "The user has enough bond and thus cannot be chilled forcefully by an external person." }) , (7u8 , 21u8) => Some (ErrorDetails { pallet : "Staking" , error : "TooManyNominators" , docs : "There are too many nominators in the system. Governance needs to adjust the staking\nsettings to keep things safe for the runtime." }) , (7u8 , 22u8) => Some (ErrorDetails { pallet : "Staking" , error : "TooManyValidators" , docs : "There are too many validators in the system. Governance needs to adjust the staking\nsettings to keep things safe for the runtime." }) , (9u8 , 0u8) => Some (ErrorDetails { pallet : "Session" , error : "InvalidProof" , docs : "Invalid ownership proof." }) , (9u8 , 1u8) => Some (ErrorDetails { pallet : "Session" , error : "NoAssociatedValidatorId" , docs : "No associated validator ID for account." }) , (9u8 , 2u8) => Some (ErrorDetails { pallet : "Session" , error : "DuplicatedKey" , docs : "Registered duplicate key." }) , (9u8 , 3u8) => Some (ErrorDetails { pallet : "Session" , error : "NoKeys" , docs : "No keys are associated with this account." }) , (9u8 , 4u8) => Some (ErrorDetails { pallet : "Session" , error : "NoAccount" , docs : "Key setting account is not live, so it's impossible to associate keys." }) , (11u8 , 0u8) => Some (ErrorDetails { pallet : "Grandpa" , error : "PauseFailed" , docs : "Attempt to signal GRANDPA pause when the authority set isn't live\n(either paused or already pending pause)." }) , (11u8 , 1u8) => Some (ErrorDetails { pallet : "Grandpa" , error : "ResumeFailed" , docs : "Attempt to signal GRANDPA resume when the authority set isn't paused\n(either live or already pending resume)." }) , (11u8 , 2u8) => Some (ErrorDetails { pallet : "Grandpa" , error : "ChangePending" , docs : "Attempt to signal GRANDPA change with one already pending." }) , (11u8 , 3u8) => Some (ErrorDetails { pallet : "Grandpa" , error : "TooSoon" , docs : "Cannot signal forced change so soon after last." }) , (11u8 , 4u8) => Some (ErrorDetails { pallet : "Grandpa" , error : "InvalidKeyOwnershipProof" , docs : "A key ownership proof provided as part of an equivocation report is invalid." }) , (11u8 , 5u8) => Some (ErrorDetails { pallet : "Grandpa" , error : "InvalidEquivocationProof" , docs : "An equivocation proof provided as part of an equivocation report is invalid." }) , (11u8 , 6u8) => Some (ErrorDetails { pallet : "Grandpa" , error : "DuplicateOffenceReport" , docs : "A given equivocation report is valid but already previously reported." }) , (12u8 , 0u8) => Some (ErrorDetails { pallet : "ImOnline" , error : "InvalidKey" , docs : "Non existent public key." }) , (12u8 , 1u8) => Some (ErrorDetails { pallet : "ImOnline" , error : "DuplicatedHeartbeat" , docs : "Duplicated heartbeat." }) , (14u8 , 0u8) => Some (ErrorDetails { pallet : "Democracy" , error : "ValueLow" , docs : "Value too low" }) , (14u8 , 1u8) => Some (ErrorDetails { pallet : "Democracy" , error : "ProposalMissing" , docs : "Proposal does not exist" }) , (14u8 , 2u8) => Some (ErrorDetails { pallet : "Democracy" , error : "AlreadyCanceled" , docs : "Cannot cancel the same proposal twice" }) , (14u8 , 3u8) => Some (ErrorDetails { pallet : "Democracy" , error : "DuplicateProposal" , docs : "Proposal already made" }) , (14u8 , 4u8) => Some (ErrorDetails { pallet : "Democracy" , error : "ProposalBlacklisted" , docs : "Proposal still blacklisted" }) , (14u8 , 5u8) => Some (ErrorDetails { pallet : "Democracy" , error : "NotSimpleMajority" , docs : "Next external proposal not simple majority" }) , (14u8 , 6u8) => Some (ErrorDetails { pallet : "Democracy" , error : "InvalidHash" , docs : "Invalid hash" }) , (14u8 , 7u8) => Some (ErrorDetails { pallet : "Democracy" , error : "NoProposal" , docs : "No external proposal" }) , (14u8 , 8u8) => Some (ErrorDetails { pallet : "Democracy" , error : "AlreadyVetoed" , docs : "Identity may not veto a proposal twice" }) , (14u8 , 9u8) => Some (ErrorDetails { pallet : "Democracy" , error : "DuplicatePreimage" , docs : "Preimage already noted" }) , (14u8 , 10u8) => Some (ErrorDetails { pallet : "Democracy" , error : "NotImminent" , docs : "Not imminent" }) , (14u8 , 11u8) => Some (ErrorDetails { pallet : "Democracy" , error : "TooEarly" , docs : "Too early" }) , (14u8 , 12u8) => Some (ErrorDetails { pallet : "Democracy" , error : "Imminent" , docs : "Imminent" }) , (14u8 , 13u8) => Some (ErrorDetails { pallet : "Democracy" , error : "PreimageMissing" , docs : "Preimage not found" }) , (14u8 , 14u8) => Some (ErrorDetails { pallet : "Democracy" , error : "ReferendumInvalid" , docs : "Vote given for invalid referendum" }) , (14u8 , 15u8) => Some (ErrorDetails { pallet : "Democracy" , error : "PreimageInvalid" , docs : "Invalid preimage" }) , (14u8 , 16u8) => Some (ErrorDetails { pallet : "Democracy" , error : "NoneWaiting" , docs : "No proposals waiting" }) , (14u8 , 17u8) => Some (ErrorDetails { pallet : "Democracy" , error : "NotVoter" , docs : "The given account did not vote on the referendum." }) , (14u8 , 18u8) => Some (ErrorDetails { pallet : "Democracy" , error : "NoPermission" , docs : "The actor has no permission to conduct the action." }) , (14u8 , 19u8) => Some (ErrorDetails { pallet : "Democracy" , error : "AlreadyDelegating" , docs : "The account is already delegating." }) , (14u8 , 20u8) => Some (ErrorDetails { pallet : "Democracy" , error : "InsufficientFunds" , docs : "Too high a balance was provided that the account cannot afford." }) , (14u8 , 21u8) => Some (ErrorDetails { pallet : "Democracy" , error : "NotDelegating" , docs : "The account is not currently delegating." }) , (14u8 , 22u8) => Some (ErrorDetails { pallet : "Democracy" , error : "VotesExist" , docs : "The account currently has votes attached to it and the operation cannot succeed until\nthese are removed, either through `unvote` or `reap_vote`." }) , (14u8 , 23u8) => Some (ErrorDetails { pallet : "Democracy" , error : "InstantNotAllowed" , docs : "The instant referendum origin is currently disallowed." }) , (14u8 , 24u8) => Some (ErrorDetails { pallet : "Democracy" , error : "Nonsense" , docs : "Delegation to oneself makes no sense." }) , (14u8 , 25u8) => Some (ErrorDetails { pallet : "Democracy" , error : "WrongUpperBound" , docs : "Invalid upper bound." }) , (14u8 , 26u8) => Some (ErrorDetails { pallet : "Democracy" , error : "MaxVotesReached" , docs : "Maximum number of votes reached." }) , (14u8 , 27u8) => Some (ErrorDetails { pallet : "Democracy" , error : "TooManyProposals" , docs : "Maximum number of proposals reached." }) , (15u8 , 0u8) => Some (ErrorDetails { pallet : "Council" , error : "NotMember" , docs : "Account is not a member" }) , (15u8 , 1u8) => Some (ErrorDetails { pallet : "Council" , error : "DuplicateProposal" , docs : "Duplicate proposals not allowed" }) , (15u8 , 2u8) => Some (ErrorDetails { pallet : "Council" , error : "ProposalMissing" , docs : "Proposal must exist" }) , (15u8 , 3u8) => Some (ErrorDetails { pallet : "Council" , error : "WrongIndex" , docs : "Mismatched index" }) , (15u8 , 4u8) => Some (ErrorDetails { pallet : "Council" , error : "DuplicateVote" , docs : "Duplicate vote ignored" }) , (15u8 , 5u8) => Some (ErrorDetails { pallet : "Council" , error : "AlreadyInitialized" , docs : "Members are already initialized!" }) , (15u8 , 6u8) => Some (ErrorDetails { pallet : "Council" , error : "TooEarly" , docs : "The close call was made too early, before the end of the voting." }) , (15u8 , 7u8) => Some (ErrorDetails { pallet : "Council" , error : "TooManyProposals" , docs : "There can only be a maximum of `MaxProposals` active proposals." }) , (15u8 , 8u8) => Some (ErrorDetails { pallet : "Council" , error : "WrongProposalWeight" , docs : "The given weight bound for the proposal was too low." }) , (15u8 , 9u8) => Some (ErrorDetails { pallet : "Council" , error : "WrongProposalLength" , docs : "The given length bound for the proposal was too low." }) , (16u8 , 0u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "NotMember" , docs : "Account is not a member" }) , (16u8 , 1u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "DuplicateProposal" , docs : "Duplicate proposals not allowed" }) , (16u8 , 2u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "ProposalMissing" , docs : "Proposal must exist" }) , (16u8 , 3u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "WrongIndex" , docs : "Mismatched index" }) , (16u8 , 4u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "DuplicateVote" , docs : "Duplicate vote ignored" }) , (16u8 , 5u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "AlreadyInitialized" , docs : "Members are already initialized!" }) , (16u8 , 6u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "TooEarly" , docs : "The close call was made too early, before the end of the voting." }) , (16u8 , 7u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "TooManyProposals" , docs : "There can only be a maximum of `MaxProposals` active proposals." }) , (16u8 , 8u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "WrongProposalWeight" , docs : "The given weight bound for the proposal was too low." }) , (16u8 , 9u8) => Some (ErrorDetails { pallet : "TechnicalCommittee" , error : "WrongProposalLength" , docs : "The given length bound for the proposal was too low." }) , (17u8 , 0u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "UnableToVote" , docs : "Cannot vote when no candidates or members exist." }) , (17u8 , 1u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "NoVotes" , docs : "Must vote for at least one candidate." }) , (17u8 , 2u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "TooManyVotes" , docs : "Cannot vote more than candidates." }) , (17u8 , 3u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "MaximumVotesExceeded" , docs : "Cannot vote more than maximum allowed." }) , (17u8 , 4u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "LowBalance" , docs : "Cannot vote with stake less than minimum balance." }) , (17u8 , 5u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "UnableToPayBond" , docs : "Voter can not pay voting bond." }) , (17u8 , 6u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "MustBeVoter" , docs : "Must be a voter." }) , (17u8 , 7u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "ReportSelf" , docs : "Cannot report self." }) , (17u8 , 8u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "DuplicatedCandidate" , docs : "Duplicated candidate submission." }) , (17u8 , 9u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "MemberSubmit" , docs : "Member cannot re-submit candidacy." }) , (17u8 , 10u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "RunnerUpSubmit" , docs : "Runner cannot re-submit candidacy." }) , (17u8 , 11u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "InsufficientCandidateFunds" , docs : "Candidate does not have enough funds." }) , (17u8 , 12u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "NotMember" , docs : "Not a member." }) , (17u8 , 13u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "InvalidWitnessData" , docs : "The provided count of number of candidates is incorrect." }) , (17u8 , 14u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "InvalidVoteCount" , docs : "The provided count of number of votes is incorrect." }) , (17u8 , 15u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "InvalidRenouncing" , docs : "The renouncing origin presented a wrong `Renouncing` parameter." }) , (17u8 , 16u8) => Some (ErrorDetails { pallet : "PhragmenElection" , error : "InvalidReplacement" , docs : "Prediction regarding replacement after member removal is wrong." }) , (18u8 , 0u8) => Some (ErrorDetails { pallet : "TechnicalMembership" , error : "AlreadyMember" , docs : "Already a member." }) , (18u8 , 1u8) => Some (ErrorDetails { pallet : "TechnicalMembership" , error : "NotMember" , docs : "Not a member." }) , (19u8 , 0u8) => Some (ErrorDetails { pallet : "Treasury" , error : "InsufficientProposersBalance" , docs : "Proposer's balance is too low." }) , (19u8 , 1u8) => Some (ErrorDetails { pallet : "Treasury" , error : "InvalidIndex" , docs : "No proposal or bounty at that index." }) , (19u8 , 2u8) => Some (ErrorDetails { pallet : "Treasury" , error : "TooManyApprovals" , docs : "Too many approvals in the queue." }) , (24u8 , 0u8) => Some (ErrorDetails { pallet : "Claims" , error : "InvalidEthereumSignature" , docs : "Invalid Ethereum signature." }) , (24u8 , 1u8) => Some (ErrorDetails { pallet : "Claims" , error : "SignerHasNoClaim" , docs : "Ethereum address has no claim." }) , (24u8 , 2u8) => Some (ErrorDetails { pallet : "Claims" , error : "SenderHasNoClaim" , docs : "Account ID sending transaction has no claim." }) , (24u8 , 3u8) => Some (ErrorDetails { pallet : "Claims" , error : "PotUnderflow" , docs : "There's not enough in the pot to pay out some unvested amount. Generally implies a logic\nerror." }) , (24u8 , 4u8) => Some (ErrorDetails { pallet : "Claims" , error : "InvalidStatement" , docs : "A needed statement was not included." }) , (24u8 , 5u8) => Some (ErrorDetails { pallet : "Claims" , error : "VestedBalanceExists" , docs : "The account already has a vested balance." }) , (25u8 , 0u8) => Some (ErrorDetails { pallet : "Vesting" , error : "NotVesting" , docs : "The account given is not vesting." }) , (25u8 , 1u8) => Some (ErrorDetails { pallet : "Vesting" , error : "AtMaxVestingSchedules" , docs : "The account already has `MaxVestingSchedules` count of schedules and thus\ncannot add another one. Consider merging existing schedules in order to add another." }) , (25u8 , 2u8) => Some (ErrorDetails { pallet : "Vesting" , error : "AmountLow" , docs : "Amount being transferred is too low to create a vesting schedule." }) , (25u8 , 3u8) => Some (ErrorDetails { pallet : "Vesting" , error : "ScheduleIndexOutOfBounds" , docs : "An index was out of bounds of the vesting schedules." }) , (25u8 , 4u8) => Some (ErrorDetails { pallet : "Vesting" , error : "InvalidScheduleParams" , docs : "Failed to create a new schedule because some parameter was invalid." }) , (26u8 , 0u8) => Some (ErrorDetails { pallet : "Utility" , error : "TooManyCalls" , docs : "Too many calls batched." }) , (28u8 , 0u8) => Some (ErrorDetails { pallet : "Identity" , error : "TooManySubAccounts" , docs : "Too many subs-accounts." }) , (28u8 , 1u8) => Some (ErrorDetails { pallet : "Identity" , error : "NotFound" , docs : "Account isn't found." }) , (28u8 , 2u8) => Some (ErrorDetails { pallet : "Identity" , error : "NotNamed" , docs : "Account isn't named." }) , (28u8 , 3u8) => Some (ErrorDetails { pallet : "Identity" , error : "EmptyIndex" , docs : "Empty index." }) , (28u8 , 4u8) => Some (ErrorDetails { pallet : "Identity" , error : "FeeChanged" , docs : "Fee is changed." }) , (28u8 , 5u8) => Some (ErrorDetails { pallet : "Identity" , error : "NoIdentity" , docs : "No identity found." }) , (28u8 , 6u8) => Some (ErrorDetails { pallet : "Identity" , error : "StickyJudgement" , docs : "Sticky judgement." }) , (28u8 , 7u8) => Some (ErrorDetails { pallet : "Identity" , error : "JudgementGiven" , docs : "Judgement given." }) , (28u8 , 8u8) => Some (ErrorDetails { pallet : "Identity" , error : "InvalidJudgement" , docs : "Invalid judgement." }) , (28u8 , 9u8) => Some (ErrorDetails { pallet : "Identity" , error : "InvalidIndex" , docs : "The index is invalid." }) , (28u8 , 10u8) => Some (ErrorDetails { pallet : "Identity" , error : "InvalidTarget" , docs : "The target is invalid." }) , (28u8 , 11u8) => Some (ErrorDetails { pallet : "Identity" , error : "TooManyFields" , docs : "Too many additional fields." }) , (28u8 , 12u8) => Some (ErrorDetails { pallet : "Identity" , error : "TooManyRegistrars" , docs : "Maximum amount of registrars reached. Cannot add any more." }) , (28u8 , 13u8) => Some (ErrorDetails { pallet : "Identity" , error : "AlreadyClaimed" , docs : "Account ID is already named." }) , (28u8 , 14u8) => Some (ErrorDetails { pallet : "Identity" , error : "NotSub" , docs : "Sender is not a sub-account." }) , (28u8 , 15u8) => Some (ErrorDetails { pallet : "Identity" , error : "NotOwned" , docs : "Sub-account isn't owned by sender." }) , (29u8 , 0u8) => Some (ErrorDetails { pallet : "Proxy" , error : "TooMany" , docs : "There are too many proxies registered or too many announcements pending." }) , (29u8 , 1u8) => Some (ErrorDetails { pallet : "Proxy" , error : "NotFound" , docs : "Proxy registration not found." }) , (29u8 , 2u8) => Some (ErrorDetails { pallet : "Proxy" , error : "NotProxy" , docs : "Sender is not a proxy of the account to be proxied." }) , (29u8 , 3u8) => Some (ErrorDetails { pallet : "Proxy" , error : "Unproxyable" , docs : "A call which is incompatible with the proxy type's filter was attempted." }) , (29u8 , 4u8) => Some (ErrorDetails { pallet : "Proxy" , error : "Duplicate" , docs : "Account is already a proxy." }) , (29u8 , 5u8) => Some (ErrorDetails { pallet : "Proxy" , error : "NoPermission" , docs : "Call may not be made by proxy because it may escalate its privileges." }) , (29u8 , 6u8) => Some (ErrorDetails { pallet : "Proxy" , error : "Unannounced" , docs : "Announcement, if made at all, was made too recently." }) , (29u8 , 7u8) => Some (ErrorDetails { pallet : "Proxy" , error : "NoSelfProxy" , docs : "Cannot add self as proxy." }) , (30u8 , 0u8) => Some (ErrorDetails { pallet : "Multisig" , error : "MinimumThreshold" , docs : "Threshold must be 2 or greater." }) , (30u8 , 1u8) => Some (ErrorDetails { pallet : "Multisig" , error : "AlreadyApproved" , docs : "Call is already approved by this signatory." }) , (30u8 , 2u8) => Some (ErrorDetails { pallet : "Multisig" , error : "NoApprovalsNeeded" , docs : "Call doesn't need any (more) approvals." }) , (30u8 , 3u8) => Some (ErrorDetails { pallet : "Multisig" , error : "TooFewSignatories" , docs : "There are too few signatories in the list." }) , (30u8 , 4u8) => Some (ErrorDetails { pallet : "Multisig" , error : "TooManySignatories" , docs : "There are too many signatories in the list." }) , (30u8 , 5u8) => Some (ErrorDetails { pallet : "Multisig" , error : "SignatoriesOutOfOrder" , docs : "The signatories were provided out of order; they should be ordered." }) , (30u8 , 6u8) => Some (ErrorDetails { pallet : "Multisig" , error : "SenderInSignatories" , docs : "The sender was contained in the other signatories; it shouldn't be." }) , (30u8 , 7u8) => Some (ErrorDetails { pallet : "Multisig" , error : "NotFound" , docs : "Multisig operation not found when attempting to cancel." }) , (30u8 , 8u8) => Some (ErrorDetails { pallet : "Multisig" , error : "NotOwner" , docs : "Only the account that originally created the multisig is able to cancel it." }) , (30u8 , 9u8) => Some (ErrorDetails { pallet : "Multisig" , error : "NoTimepoint" , docs : "No timepoint was given, yet the multisig operation is already underway." }) , (30u8 , 10u8) => Some (ErrorDetails { pallet : "Multisig" , error : "WrongTimepoint" , docs : "A different timepoint was given to the multisig operation that is underway." }) , (30u8 , 11u8) => Some (ErrorDetails { pallet : "Multisig" , error : "UnexpectedTimepoint" , docs : "A timepoint was given, yet no multisig operation is underway." }) , (30u8 , 12u8) => Some (ErrorDetails { pallet : "Multisig" , error : "MaxWeightTooLow" , docs : "The maximum weight information provided was too low." }) , (30u8 , 13u8) => Some (ErrorDetails { pallet : "Multisig" , error : "AlreadyStored" , docs : "The data to be stored is already stored." }) , (34u8 , 0u8) => Some (ErrorDetails { pallet : "Bounties" , error : "InsufficientProposersBalance" , docs : "Proposer's balance is too low." }) , (34u8 , 1u8) => Some (ErrorDetails { pallet : "Bounties" , error : "InvalidIndex" , docs : "No proposal or bounty at that index." }) , (34u8 , 2u8) => Some (ErrorDetails { pallet : "Bounties" , error : "ReasonTooBig" , docs : "The reason given is just too big." }) , (34u8 , 3u8) => Some (ErrorDetails { pallet : "Bounties" , error : "UnexpectedStatus" , docs : "The bounty status is unexpected." }) , (34u8 , 4u8) => Some (ErrorDetails { pallet : "Bounties" , error : "RequireCurator" , docs : "Require bounty curator." }) , (34u8 , 5u8) => Some (ErrorDetails { pallet : "Bounties" , error : "InvalidValue" , docs : "Invalid bounty value." }) , (34u8 , 6u8) => Some (ErrorDetails { pallet : "Bounties" , error : "InvalidFee" , docs : "Invalid bounty fee." }) , (34u8 , 7u8) => Some (ErrorDetails { pallet : "Bounties" , error : "PendingPayout" , docs : "A bounty payout is pending.\nTo cancel the bounty, you must unassign and slash the curator." }) , (34u8 , 8u8) => Some (ErrorDetails { pallet : "Bounties" , error : "Premature" , docs : "The bounties cannot be claimed/closed because it's still in the countdown period." }) , (35u8 , 0u8) => Some (ErrorDetails { pallet : "Tips" , error : "ReasonTooBig" , docs : "The reason given is just too big." }) , (35u8 , 1u8) => Some (ErrorDetails { pallet : "Tips" , error : "AlreadyKnown" , docs : "The tip was already found/started." }) , (35u8 , 2u8) => Some (ErrorDetails { pallet : "Tips" , error : "UnknownTip" , docs : "The tip hash is unknown." }) , (35u8 , 3u8) => Some (ErrorDetails { pallet : "Tips" , error : "NotFinder" , docs : "The account attempting to retract the tip is not the finder of the tip." }) , (35u8 , 4u8) => Some (ErrorDetails { pallet : "Tips" , error : "StillOpen" , docs : "The tip cannot be claimed/closed because there are not enough tippers yet." }) , (35u8 , 5u8) => Some (ErrorDetails { pallet : "Tips" , error : "Premature" , docs : "The tip cannot be claimed/closed because it's still in the countdown period." }) , (36u8 , 0u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "PreDispatchEarlySubmission" , docs : "Submission was too early." }) , (36u8 , 1u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "PreDispatchWrongWinnerCount" , docs : "Wrong number of winners presented." }) , (36u8 , 2u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "PreDispatchWeakSubmission" , docs : "Submission was too weak, score-wise." }) , (36u8 , 3u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "SignedQueueFull" , docs : "The queue was full, and the solution was not better than any of the existing ones." }) , (36u8 , 4u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "SignedCannotPayDeposit" , docs : "The origin failed to pay the deposit." }) , (36u8 , 5u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "SignedInvalidWitness" , docs : "Witness data to dispatchable is invalid." }) , (36u8 , 6u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "SignedTooMuchWeight" , docs : "The signed submission consumes too much weight" }) , (36u8 , 7u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "OcwCallWrongEra" , docs : "OCW submitted solution for wrong round" }) , (36u8 , 8u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "MissingSnapshotMetadata" , docs : "Snapshot metadata should exist but didn't." }) , (36u8 , 9u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "InvalidSubmissionIndex" , docs : "`Self::insert_submission` returned an invalid index." }) , (36u8 , 10u8) => Some (ErrorDetails { pallet : "ElectionProviderMultiPhase" , error : "CallNotAllowed" , docs : "The call is not allowed at this point." }) , (51u8 , 0u8) => Some (ErrorDetails { pallet : "Configuration" , error : "InvalidNewValue" , docs : "The new value for a configuration parameter is invalid." }) , (53u8 , 0u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "WrongBitfieldSize" , docs : "Availability bitfield has unexpected size." }) , (53u8 , 1u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "BitfieldDuplicateOrUnordered" , docs : "Multiple bitfields submitted by same validator or validators out of order by index." }) , (53u8 , 2u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "ValidatorIndexOutOfBounds" , docs : "Validator index out of bounds." }) , (53u8 , 3u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "InvalidBitfieldSignature" , docs : "Invalid signature" }) , (53u8 , 4u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "UnscheduledCandidate" , docs : "Candidate submitted but para not scheduled." }) , (53u8 , 5u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "CandidateScheduledBeforeParaFree" , docs : "Candidate scheduled despite pending candidate already existing for the para." }) , (53u8 , 6u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "WrongCollator" , docs : "Candidate included with the wrong collator." }) , (53u8 , 7u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "ScheduledOutOfOrder" , docs : "Scheduled cores out of order." }) , (53u8 , 8u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "HeadDataTooLarge" , docs : "Head data exceeds the configured maximum." }) , (53u8 , 9u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "PrematureCodeUpgrade" , docs : "Code upgrade prematurely." }) , (53u8 , 10u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "NewCodeTooLarge" , docs : "Output code is too large" }) , (53u8 , 11u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "CandidateNotInParentContext" , docs : "Candidate not in parent context." }) , (53u8 , 12u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "InvalidGroupIndex" , docs : "Invalid group index in core assignment." }) , (53u8 , 13u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "InsufficientBacking" , docs : "Insufficient (non-majority) backing." }) , (53u8 , 14u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "InvalidBacking" , docs : "Invalid (bad signature, unknown validator, etc.) backing." }) , (53u8 , 15u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "NotCollatorSigned" , docs : "Collator did not sign PoV." }) , (53u8 , 16u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "ValidationDataHashMismatch" , docs : "The validation data hash does not match expected." }) , (53u8 , 17u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "IncorrectDownwardMessageHandling" , docs : "The downward message queue is not processed correctly." }) , (53u8 , 18u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "InvalidUpwardMessages" , docs : "At least one upward message sent does not pass the acceptance criteria." }) , (53u8 , 19u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "HrmpWatermarkMishandling" , docs : "The candidate didn't follow the rules of HRMP watermark advancement." }) , (53u8 , 20u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "InvalidOutboundHrmp" , docs : "The HRMP messages sent by the candidate is not valid." }) , (53u8 , 21u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "InvalidValidationCodeHash" , docs : "The validation code hash of the candidate is not valid." }) , (53u8 , 22u8) => Some (ErrorDetails { pallet : "ParaInclusion" , error : "ParaHeadMismatch" , docs : "The `para_head` hash in the candidate descriptor doesn't match the hash of the actual para head in the\ncommitments." }) , (54u8 , 0u8) => Some (ErrorDetails { pallet : "ParaInherent" , error : "TooManyInclusionInherents" , docs : "Inclusion inherent called more than once per block." }) , (54u8 , 1u8) => Some (ErrorDetails { pallet : "ParaInherent" , error : "InvalidParentHeader" , docs : "The hash of the submitted parent header doesn't correspond to the saved block hash of\nthe parent." }) , (54u8 , 2u8) => Some (ErrorDetails { pallet : "ParaInherent" , error : "CandidateConcludedInvalid" , docs : "Disputed candidate that was concluded invalid." }) , (56u8 , 0u8) => Some (ErrorDetails { pallet : "Paras" , error : "NotRegistered" , docs : "Para is not registered in our system." }) , (56u8 , 1u8) => Some (ErrorDetails { pallet : "Paras" , error : "CannotOnboard" , docs : "Para cannot be onboarded because it is already tracked by our system." }) , (56u8 , 2u8) => Some (ErrorDetails { pallet : "Paras" , error : "CannotOffboard" , docs : "Para cannot be offboarded at this time." }) , (56u8 , 3u8) => Some (ErrorDetails { pallet : "Paras" , error : "CannotUpgrade" , docs : "Para cannot be upgraded to a parachain." }) , (56u8 , 4u8) => Some (ErrorDetails { pallet : "Paras" , error : "CannotDowngrade" , docs : "Para cannot be downgraded to a parathread." }) , (59u8 , 0u8) => Some (ErrorDetails { pallet : "Ump" , error : "UnknownMessageIndex" , docs : "The message index given is unknown." }) , (59u8 , 1u8) => Some (ErrorDetails { pallet : "Ump" , error : "WeightOverLimit" , docs : "The amount of weight given is possibly not enough for executing the message." }) , (60u8 , 0u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelToSelf" , docs : "The sender tried to open a channel to themselves." }) , (60u8 , 1u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelInvalidRecipient" , docs : "The recipient is not a valid para." }) , (60u8 , 2u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelZeroCapacity" , docs : "The requested capacity is zero." }) , (60u8 , 3u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelCapacityExceedsLimit" , docs : "The requested capacity exceeds the global limit." }) , (60u8 , 4u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelZeroMessageSize" , docs : "The requested maximum message size is 0." }) , (60u8 , 5u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelMessageSizeExceedsLimit" , docs : "The open request requested the message size that exceeds the global limit." }) , (60u8 , 6u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelAlreadyExists" , docs : "The channel already exists" }) , (60u8 , 7u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelAlreadyRequested" , docs : "There is already a request to open the same channel." }) , (60u8 , 8u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelLimitExceeded" , docs : "The sender already has the maximum number of allowed outbound channels." }) , (60u8 , 9u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "AcceptHrmpChannelDoesntExist" , docs : "The channel from the sender to the origin doesn't exist." }) , (60u8 , 10u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "AcceptHrmpChannelAlreadyConfirmed" , docs : "The channel is already confirmed." }) , (60u8 , 11u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "AcceptHrmpChannelLimitExceeded" , docs : "The recipient already has the maximum number of allowed inbound channels." }) , (60u8 , 12u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "CloseHrmpChannelUnauthorized" , docs : "The origin tries to close a channel where it is neither the sender nor the recipient." }) , (60u8 , 13u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "CloseHrmpChannelDoesntExist" , docs : "The channel to be closed doesn't exist." }) , (60u8 , 14u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "CloseHrmpChannelAlreadyUnderway" , docs : "The channel close request is already requested." }) , (60u8 , 15u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "CancelHrmpOpenChannelUnauthorized" , docs : "Canceling is requested by neither the sender nor recipient of the open channel request." }) , (60u8 , 16u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelDoesntExist" , docs : "The open request doesn't exist." }) , (60u8 , 17u8) => Some (ErrorDetails { pallet : "Hrmp" , error : "OpenHrmpChannelAlreadyConfirmed" , docs : "Cannot cancel an HRMP open channel request because it is already confirmed." }) , (70u8 , 0u8) => Some (ErrorDetails { pallet : "Registrar" , error : "NotRegistered" , docs : "The ID is not registered." }) , (70u8 , 1u8) => Some (ErrorDetails { pallet : "Registrar" , error : "AlreadyRegistered" , docs : "The ID is already registered." }) , (70u8 , 2u8) => Some (ErrorDetails { pallet : "Registrar" , error : "NotOwner" , docs : "The caller is not the owner of this Id." }) , (70u8 , 3u8) => Some (ErrorDetails { pallet : "Registrar" , error : "CodeTooLarge" , docs : "Invalid para code size." }) , (70u8 , 4u8) => Some (ErrorDetails { pallet : "Registrar" , error : "HeadDataTooLarge" , docs : "Invalid para head data size." }) , (70u8 , 5u8) => Some (ErrorDetails { pallet : "Registrar" , error : "NotParachain" , docs : "Para is not a Parachain." }) , (70u8 , 6u8) => Some (ErrorDetails { pallet : "Registrar" , error : "NotParathread" , docs : "Para is not a Parathread." }) , (70u8 , 7u8) => Some (ErrorDetails { pallet : "Registrar" , error : "CannotDeregister" , docs : "Cannot deregister para" }) , (70u8 , 8u8) => Some (ErrorDetails { pallet : "Registrar" , error : "CannotDowngrade" , docs : "Cannot schedule downgrade of parachain to parathread" }) , (70u8 , 9u8) => Some (ErrorDetails { pallet : "Registrar" , error : "CannotUpgrade" , docs : "Cannot schedule upgrade of parathread to parachain" }) , (70u8 , 10u8) => Some (ErrorDetails { pallet : "Registrar" , error : "ParaLocked" , docs : "Para is locked from manipulation by the manager. Must use parachain or relay chain governance." }) , (70u8 , 11u8) => Some (ErrorDetails { pallet : "Registrar" , error : "NotReserved" , docs : "The ID given for registration has not been reserved." }) , (71u8 , 0u8) => Some (ErrorDetails { pallet : "Slots" , error : "ParaNotOnboarding" , docs : "The parachain ID is not onboarding." }) , (71u8 , 1u8) => Some (ErrorDetails { pallet : "Slots" , error : "LeaseError" , docs : "There was an error with the lease." }) , (72u8 , 0u8) => Some (ErrorDetails { pallet : "Auctions" , error : "AuctionInProgress" , docs : "This auction is already in progress." }) , (72u8 , 1u8) => Some (ErrorDetails { pallet : "Auctions" , error : "LeasePeriodInPast" , docs : "The lease period is in the past." }) , (72u8 , 2u8) => Some (ErrorDetails { pallet : "Auctions" , error : "ParaNotRegistered" , docs : "Para is not registered" }) , (72u8 , 3u8) => Some (ErrorDetails { pallet : "Auctions" , error : "NotCurrentAuction" , docs : "Not a current auction." }) , (72u8 , 4u8) => Some (ErrorDetails { pallet : "Auctions" , error : "NotAuction" , docs : "Not an auction." }) , (72u8 , 5u8) => Some (ErrorDetails { pallet : "Auctions" , error : "AuctionEnded" , docs : "Auction has already ended." }) , (72u8 , 6u8) => Some (ErrorDetails { pallet : "Auctions" , error : "AlreadyLeasedOut" , docs : "The para is already leased out for part of this range." }) , (73u8 , 0u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "FirstPeriodInPast" , docs : "The current lease period is more than the first lease period." }) , (73u8 , 1u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "FirstPeriodTooFarInFuture" , docs : "The first lease period needs to at least be less than 3 `max_value`." }) , (73u8 , 2u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "LastPeriodBeforeFirstPeriod" , docs : "Last lease period must be greater than first lease period." }) , (73u8 , 3u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "LastPeriodTooFarInFuture" , docs : "The last lease period cannot be more than 3 periods after the first period." }) , (73u8 , 4u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "CannotEndInPast" , docs : "The campaign ends before the current block number. The end must be in the future." }) , (73u8 , 5u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "EndTooFarInFuture" , docs : "The end date for this crowdloan is not sensible." }) , (73u8 , 6u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "Overflow" , docs : "There was an overflow." }) , (73u8 , 7u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "ContributionTooSmall" , docs : "The contribution was below the minimum, `MinContribution`." }) , (73u8 , 8u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "InvalidParaId" , docs : "Invalid fund index." }) , (73u8 , 9u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "CapExceeded" , docs : "Contributions exceed maximum amount." }) , (73u8 , 10u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "ContributionPeriodOver" , docs : "The contribution period has already ended." }) , (73u8 , 11u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "InvalidOrigin" , docs : "The origin of this call is invalid." }) , (73u8 , 12u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "NotParachain" , docs : "This crowdloan does not correspond to a parachain." }) , (73u8 , 13u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "LeaseActive" , docs : "This parachain lease is still active and retirement cannot yet begin." }) , (73u8 , 14u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "BidOrLeaseActive" , docs : "This parachain's bid or lease is still active and withdraw cannot yet begin." }) , (73u8 , 15u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "FundNotEnded" , docs : "The crowdloan has not yet ended." }) , (73u8 , 16u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "NoContributions" , docs : "There are no contributions stored in this crowdloan." }) , (73u8 , 17u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "NotReadyToDissolve" , docs : "The crowdloan is not ready to dissolve. Potentially still has a slot or in retirement period." }) , (73u8 , 18u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "InvalidSignature" , docs : "Invalid signature." }) , (73u8 , 19u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "MemoTooLarge" , docs : "The provided memo is too large." }) , (73u8 , 20u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "AlreadyInNewRaise" , docs : "The fund is already in `NewRaise`" }) , (73u8 , 21u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "VrfDelayInProgress" , docs : "No contributions allowed during the VRF delay" }) , (73u8 , 22u8) => Some (ErrorDetails { pallet : "Crowdloan" , error : "NoLeasePeriod" , docs : "A lease period has not started yet, due to an offset in the starting block." }) , _ => None } + } else { + None + } + } } - pub type AccountData = self::system::storage::Account; - impl ::subxt::AccountData for AccountData { + #[doc = r" The default storage entry from which to fetch an account nonce, required for"] + #[doc = r" constructing a transaction."] + pub enum DefaultAccountData {} + impl ::subxt::AccountData for DefaultAccountData { + type StorageEntry = self::system::storage::Account; + type AccountId = ::subxt::sp_core::crypto::AccountId32; + type Index = ::core::primitive::u32; fn nonce( - result: &::Value, - ) -> ::Index { + result: &::Value, + ) -> Self::Index { result.nonce } - fn storage_entry( - account_id: ::AccountId, - ) -> Self { - Self(account_id) + fn storage_entry(account_id: Self::AccountId) -> Self::StorageEntry { + self::system::storage::Account(account_id) } } - pub struct RuntimeApi> { + pub struct RuntimeApi { pub client: ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl ::core::convert::From<::subxt::Client> for RuntimeApi + impl ::core::convert::From<::subxt::Client> for RuntimeApi where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { fn from(client: ::subxt::Client) -> Self { - Self { client } + Self { + client, + marker: ::core::marker::PhantomData, + } } } - impl<'a, T> RuntimeApi + impl<'a, T, X, A> RuntimeApi where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { pub fn storage(&'a self) -> StorageApi<'a, T> { StorageApi { client: &self.client, } } - pub fn tx(&'a self) -> TransactionApi<'a, T> { + pub fn tx(&'a self) -> TransactionApi<'a, T, X, A> { TransactionApi { client: &self.client, + marker: ::core::marker::PhantomData, } } } - pub struct StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { + pub struct StorageApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } impl<'a, T> StorageApi<'a, T> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, { pub fn system(&self) -> system::storage::StorageApi<'a, T> { system::storage::StorageApi::new(self.client) } + pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { + scheduler::storage::StorageApi::new(self.client) + } pub fn babe(&self) -> babe::storage::StorageApi<'a, T> { babe::storage::StorageApi::new(self.client) } @@ -14730,6 +21860,9 @@ pub mod api { pub fn authorship(&self) -> authorship::storage::StorageApi<'a, T> { authorship::storage::StorageApi::new(self.client) } + pub fn staking(&self) -> staking::storage::StorageApi<'a, T> { + staking::storage::StorageApi::new(self.client) + } pub fn offences(&self) -> offences::storage::StorageApi<'a, T> { offences::storage::StorageApi::new(self.client) } @@ -14742,6 +21875,57 @@ pub mod api { pub fn im_online(&self) -> im_online::storage::StorageApi<'a, T> { im_online::storage::StorageApi::new(self.client) } + pub fn democracy(&self) -> democracy::storage::StorageApi<'a, T> { + democracy::storage::StorageApi::new(self.client) + } + pub fn council(&self) -> council::storage::StorageApi<'a, T> { + council::storage::StorageApi::new(self.client) + } + pub fn technical_committee( + &self, + ) -> technical_committee::storage::StorageApi<'a, T> { + technical_committee::storage::StorageApi::new(self.client) + } + pub fn phragmen_election(&self) -> phragmen_election::storage::StorageApi<'a, T> { + phragmen_election::storage::StorageApi::new(self.client) + } + pub fn technical_membership( + &self, + ) -> technical_membership::storage::StorageApi<'a, T> { + technical_membership::storage::StorageApi::new(self.client) + } + pub fn treasury(&self) -> treasury::storage::StorageApi<'a, T> { + treasury::storage::StorageApi::new(self.client) + } + pub fn claims(&self) -> claims::storage::StorageApi<'a, T> { + claims::storage::StorageApi::new(self.client) + } + pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { + vesting::storage::StorageApi::new(self.client) + } + pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { + identity::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 bounties(&self) -> bounties::storage::StorageApi<'a, T> { + bounties::storage::StorageApi::new(self.client) + } + pub fn tips(&self) -> tips::storage::StorageApi<'a, T> { + tips::storage::StorageApi::new(self.client) + } + pub fn election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::storage::StorageApi<'a, T> { + election_provider_multi_phase::storage::StorageApi::new(self.client) + } + pub fn bags_list(&self) -> bags_list::storage::StorageApi<'a, T> { + bags_list::storage::StorageApi::new(self.client) + } pub fn configuration(&self) -> configuration::storage::StorageApi<'a, T> { configuration::storage::StorageApi::new(self.client) } @@ -14775,155 +21959,158 @@ pub mod api { 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 slots(&self) -> slots::storage::StorageApi<'a, T> { + slots::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 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 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 + ::subxt::ExtrinsicExtraData> { + pub struct TransactionApi<'a, T: ::subxt::Config, X, A> { client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData<(X, A)>, } - impl<'a, T> TransactionApi<'a, T> + impl<'a, T, X, A> TransactionApi<'a, T, X, A> where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + T: ::subxt::Config, + X: ::subxt::SignedExtra, + A: ::subxt::AccountData, { - pub fn system(&self) -> system::calls::TransactionApi<'a, T> { + pub fn system(&self) -> system::calls::TransactionApi<'a, T, X, A> { system::calls::TransactionApi::new(self.client) } - pub fn babe(&self) -> babe::calls::TransactionApi<'a, T> { + pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T, X, A> { + scheduler::calls::TransactionApi::new(self.client) + } + pub fn babe(&self) -> babe::calls::TransactionApi<'a, T, X, A> { babe::calls::TransactionApi::new(self.client) } - pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T> { + pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T, X, A> { timestamp::calls::TransactionApi::new(self.client) } - pub fn indices(&self) -> indices::calls::TransactionApi<'a, T> { + pub fn indices(&self) -> indices::calls::TransactionApi<'a, T, X, A> { indices::calls::TransactionApi::new(self.client) } - pub fn balances(&self) -> balances::calls::TransactionApi<'a, T> { + pub fn balances(&self) -> balances::calls::TransactionApi<'a, T, X, A> { balances::calls::TransactionApi::new(self.client) } - pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T> { + pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T, X, A> { authorship::calls::TransactionApi::new(self.client) } - pub fn session(&self) -> session::calls::TransactionApi<'a, T> { + pub fn staking(&self) -> staking::calls::TransactionApi<'a, T, X, A> { + staking::calls::TransactionApi::new(self.client) + } + pub fn session(&self) -> session::calls::TransactionApi<'a, T, X, A> { session::calls::TransactionApi::new(self.client) } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T> { + pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T, X, A> { grandpa::calls::TransactionApi::new(self.client) } - pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T> { + pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T, X, A> { im_online::calls::TransactionApi::new(self.client) } - pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T> { - configuration::calls::TransactionApi::new(self.client) + pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T, X, A> { + democracy::calls::TransactionApi::new(self.client) } - pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T> { - paras_shared::calls::TransactionApi::new(self.client) + pub fn council(&self) -> council::calls::TransactionApi<'a, T, X, A> { + council::calls::TransactionApi::new(self.client) } - pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi<'a, T> { - para_inclusion::calls::TransactionApi::new(self.client) - } - pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T> { - para_inherent::calls::TransactionApi::new(self.client) - } - pub fn paras(&self) -> paras::calls::TransactionApi<'a, T> { - paras::calls::TransactionApi::new(self.client) - } - pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T> { - initializer::calls::TransactionApi::new(self.client) - } - pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T> { - dmp::calls::TransactionApi::new(self.client) - } - pub fn ump(&self) -> ump::calls::TransactionApi<'a, T> { - ump::calls::TransactionApi::new(self.client) - } - pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T> { - hrmp::calls::TransactionApi::new(self.client) - } - pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T> { - registrar::calls::TransactionApi::new(self.client) - } - pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T> { - auctions::calls::TransactionApi::new(self.client) - } - pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T> { - crowdloan::calls::TransactionApi::new(self.client) - } - pub fn slots(&self) -> slots::calls::TransactionApi<'a, T> { - slots::calls::TransactionApi::new(self.client) - } - pub fn paras_sudo_wrapper( + pub fn technical_committee( &self, - ) -> paras_sudo_wrapper::calls::TransactionApi<'a, T> { - paras_sudo_wrapper::calls::TransactionApi::new(self.client) + ) -> technical_committee::calls::TransactionApi<'a, T, X, A> { + technical_committee::calls::TransactionApi::new(self.client) } - pub fn sudo(&self) -> sudo::calls::TransactionApi<'a, T> { - sudo::calls::TransactionApi::new(self.client) - } - pub fn validator_manager( + pub fn phragmen_election( &self, - ) -> validator_manager::calls::TransactionApi<'a, T> { - validator_manager::calls::TransactionApi::new(self.client) + ) -> phragmen_election::calls::TransactionApi<'a, T, X, A> { + phragmen_election::calls::TransactionApi::new(self.client) } - pub fn collective(&self) -> collective::calls::TransactionApi<'a, T> { - collective::calls::TransactionApi::new(self.client) + pub fn technical_membership( + &self, + ) -> technical_membership::calls::TransactionApi<'a, T, X, A> { + technical_membership::calls::TransactionApi::new(self.client) } - pub fn membership(&self) -> membership::calls::TransactionApi<'a, T> { - membership::calls::TransactionApi::new(self.client) + pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T, X, A> { + treasury::calls::TransactionApi::new(self.client) } - pub fn utility(&self) -> utility::calls::TransactionApi<'a, T> { + pub fn claims(&self) -> claims::calls::TransactionApi<'a, T, X, A> { + claims::calls::TransactionApi::new(self.client) + } + pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T, X, A> { + vesting::calls::TransactionApi::new(self.client) + } + pub fn utility(&self) -> utility::calls::TransactionApi<'a, T, X, A> { utility::calls::TransactionApi::new(self.client) } - pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T> { + pub fn identity(&self) -> identity::calls::TransactionApi<'a, T, X, A> { + identity::calls::TransactionApi::new(self.client) + } + pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T, X, A> { proxy::calls::TransactionApi::new(self.client) } - pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T> { + pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T, X, A> { multisig::calls::TransactionApi::new(self.client) } - pub fn xcm_pallet(&self) -> xcm_pallet::calls::TransactionApi<'a, T> { - xcm_pallet::calls::TransactionApi::new(self.client) + pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T, X, A> { + bounties::calls::TransactionApi::new(self.client) + } + pub fn tips(&self) -> tips::calls::TransactionApi<'a, T, X, A> { + tips::calls::TransactionApi::new(self.client) + } + pub fn election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::calls::TransactionApi<'a, T, X, A> { + election_provider_multi_phase::calls::TransactionApi::new(self.client) + } + pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T, X, A> { + bags_list::calls::TransactionApi::new(self.client) + } + pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T, X, A> { + configuration::calls::TransactionApi::new(self.client) + } + pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T, X, A> { + paras_shared::calls::TransactionApi::new(self.client) + } + pub fn para_inclusion( + &self, + ) -> para_inclusion::calls::TransactionApi<'a, T, X, A> { + para_inclusion::calls::TransactionApi::new(self.client) + } + pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T, X, A> { + para_inherent::calls::TransactionApi::new(self.client) + } + pub fn paras(&self) -> paras::calls::TransactionApi<'a, T, X, A> { + paras::calls::TransactionApi::new(self.client) + } + pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T, X, A> { + initializer::calls::TransactionApi::new(self.client) + } + pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T, X, A> { + dmp::calls::TransactionApi::new(self.client) + } + pub fn ump(&self) -> ump::calls::TransactionApi<'a, T, X, A> { + ump::calls::TransactionApi::new(self.client) + } + pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T, X, A> { + hrmp::calls::TransactionApi::new(self.client) + } + pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T, X, A> { + registrar::calls::TransactionApi::new(self.client) + } + pub fn slots(&self) -> slots::calls::TransactionApi<'a, T, X, A> { + slots::calls::TransactionApi::new(self.client) + } + pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T, X, A> { + auctions::calls::TransactionApi::new(self.client) + } + pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T, X, A> { + crowdloan::calls::TransactionApi::new(self.client) } } } diff --git a/tests/integration/frame/balances.rs b/subxt/tests/integration/frame/balances.rs similarity index 85% rename from tests/integration/frame/balances.rs rename to subxt/tests/integration/frame/balances.rs index 4df9a16c99..405ca90fc1 100644 --- a/tests/integration/frame/balances.rs +++ b/subxt/tests/integration/frame/balances.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -19,8 +19,9 @@ use crate::{ balances, runtime_types, system, - DefaultConfig, + DispatchError, }, + pair_signer, test_context, }; use codec::Decode; @@ -30,20 +31,16 @@ use sp_core::{ }; use sp_keyring::AccountKeyring; use subxt::{ - extrinsic::{ - PairSigner, - Signer, - }, + DefaultConfig, Error, EventSubscription, - PalletError, - RuntimeError, + Signer, }; #[async_std::test] -async fn tx_basic_transfer() -> Result<(), subxt::Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); +async fn tx_basic_transfer() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = pair_signer(AccountKeyring::Bob.pair()); let bob_address = bob.account_id().clone().into(); let cxt = test_context().await; let api = &cxt.api; @@ -113,8 +110,8 @@ async fn storage_total_issuance() { } #[async_std::test] -async fn storage_balance_lock() -> Result<(), subxt::Error> { - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); +async fn storage_balance_lock() -> Result<(), subxt::Error> { + let bob = pair_signer(AccountKeyring::Bob.pair()); let charlie = AccountKeyring::Charlie.to_account_id(); let cxt = test_context().await; @@ -155,9 +152,9 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { #[async_std::test] async fn transfer_error() { env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = pair_signer(AccountKeyring::Alice.pair()); let alice_addr = alice.account_id().clone().into(); - let hans = PairSigner::::new(Pair::generate().0); + let hans = pair_signer(Pair::generate().0); let hans_address = hans.account_id().clone().into(); let cxt = test_context().await; @@ -183,13 +180,10 @@ async fn transfer_error() { .wait_for_finalized_success() .await; - if let Err(Error::Runtime(RuntimeError::Module(error))) = res { - let error2 = PalletError { - pallet: "Balances".into(), - error: "InsufficientBalance".into(), - description: vec!["Balance too low to send value".to_string()], - }; - assert_eq!(error, error2); + if let Err(Error::Runtime(err)) = res { + let details = err.inner().details().unwrap(); + assert_eq!(details.pallet, "Balances"); + assert_eq!(details.error, "InsufficientBalance"); } else { panic!("expected a runtime module error"); } @@ -198,7 +192,7 @@ async fn transfer_error() { #[async_std::test] async fn transfer_subscription() { env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id(); let bob_addr = bob.clone().into(); let cxt = test_context().await; @@ -230,7 +224,7 @@ async fn transfer_subscription() { #[async_std::test] async fn transfer_implicit_subscription() { env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id(); let bob_addr = bob.clone().into(); let cxt = test_context().await; @@ -267,4 +261,12 @@ async fn constant_existential_deposit() { let constant_metadata = balances_metadata.constant("ExistentialDeposit").unwrap(); let existential_deposit = u128::decode(&mut &constant_metadata.value[..]).unwrap(); assert_eq!(existential_deposit, 100_000_000_000_000); + assert_eq!( + existential_deposit, + cxt.api + .constants() + .balances() + .existential_deposit() + .unwrap() + ); } diff --git a/tests/integration/frame/contracts.rs b/subxt/tests/integration/frame/contracts.rs similarity index 91% rename from tests/integration/frame/contracts.rs rename to subxt/tests/integration/frame/contracts.rs index 63fff6222d..72b106f8bc 100644 --- a/tests/integration/frame/contracts.rs +++ b/subxt/tests/integration/frame/contracts.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -24,9 +24,11 @@ use crate::{ storage, }, system, - DefaultConfig, + DefaultAccountData, + DispatchError, }, test_context, + NodeRuntimeSignedExtra, TestContext, }; use sp_core::sr25519::Pair; @@ -34,6 +36,7 @@ use sp_runtime::MultiAddress; use subxt::{ Client, Config, + DefaultConfig, Error, PairSigner, TransactionProgress, @@ -41,7 +44,7 @@ use subxt::{ struct ContractsTestContext { cxt: TestContext, - signer: PairSigner, + signer: PairSigner, } type Hash = ::Hash; @@ -59,11 +62,15 @@ impl ContractsTestContext { self.cxt.client() } - fn contracts_tx(&self) -> TransactionApi { + fn contracts_tx( + &self, + ) -> TransactionApi { self.cxt.api.tx().contracts() } - async fn instantiate_with_code(&self) -> Result<(Hash, AccountId), Error> { + async fn instantiate_with_code( + &self, + ) -> Result<(Hash, AccountId), Error> { log::info!("instantiate_with_code:"); const CONTRACT: &str = r#" (module @@ -114,7 +121,7 @@ impl ContractsTestContext { code_hash: Hash, data: Vec, salt: Vec, - ) -> Result { + ) -> Result> { // call instantiate extrinsic let result = self .contracts_tx() @@ -143,7 +150,8 @@ impl ContractsTestContext { &self, contract: AccountId, input_data: Vec, - ) -> Result, Error> { + ) -> Result, Error> + { log::info!("call: {:?}", contract); let result = self .contracts_tx() diff --git a/tests/integration/frame/mod.rs b/subxt/tests/integration/frame/mod.rs similarity index 93% rename from tests/integration/frame/mod.rs rename to subxt/tests/integration/frame/mod.rs index c7ec95aa03..a4dc4dfaa0 100644 --- a/tests/integration/frame/mod.rs +++ b/subxt/tests/integration/frame/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/tests/integration/frame/staking.rs b/subxt/tests/integration/frame/staking.rs similarity index 71% rename from tests/integration/frame/staking.rs rename to subxt/tests/integration/frame/staking.rs index 3f7b8f77a5..b34ae5fcca 100644 --- a/tests/integration/frame/staking.rs +++ b/subxt/tests/integration/frame/staking.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -21,8 +21,9 @@ use crate::{ ValidatorPrefs, }, staking, - DefaultConfig, + DispatchError, }, + pair_signer, test_context, }; use assert_matches::assert_matches; @@ -32,12 +33,8 @@ use sp_core::{ }; use sp_keyring::AccountKeyring; use subxt::{ - extrinsic::{ - PairSigner, - Signer, - }, Error, - RuntimeError, + Signer, }; /// Helper function to generate a crypto pair from seed @@ -55,7 +52,7 @@ fn default_validator_prefs() -> ValidatorPrefs { #[async_std::test] async fn validate_with_controller_account() { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = pair_signer(AccountKeyring::Alice.pair()); let cxt = test_context().await; cxt.api .tx() @@ -70,8 +67,8 @@ async fn validate_with_controller_account() { } #[async_std::test] -async fn validate_not_possible_for_stash_account() -> Result<(), Error> { - let alice_stash = PairSigner::::new(get_from_seed("Alice//stash")); +async fn validate_not_possible_for_stash_account() -> Result<(), Error> { + let alice_stash = pair_signer(get_from_seed("Alice//stash")); let cxt = test_context().await; let announce_validator = cxt .api @@ -82,17 +79,18 @@ async fn validate_not_possible_for_stash_account() -> Result<(), Error> { .await? .wait_for_finalized_success() .await; - assert_matches!(announce_validator, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.pallet, "Staking"); - assert_eq!(module_err.error, "NotController"); + assert_matches!(announce_validator, Err(Error::Runtime(err)) => { + let details = err.inner().details().unwrap(); + assert_eq!(details.pallet, "Staking"); + assert_eq!(details.error, "NotController"); }); Ok(()) } #[async_std::test] async fn nominate_with_controller_account() { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let alice = pair_signer(AccountKeyring::Alice.pair()); + let bob = pair_signer(AccountKeyring::Bob.pair()); let cxt = test_context().await; cxt.api @@ -108,10 +106,9 @@ async fn nominate_with_controller_account() { } #[async_std::test] -async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { - let alice_stash = - PairSigner::::new(get_from_seed("Alice//stash")); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); +async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { + let alice_stash = pair_signer(get_from_seed("Alice//stash")); + let bob = pair_signer(AccountKeyring::Bob.pair()); let cxt = test_context().await; let nomination = cxt @@ -124,20 +121,19 @@ async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { .wait_for_finalized_success() .await; - assert_matches!(nomination, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.pallet, "Staking"); - assert_eq!(module_err.error, "NotController"); + assert_matches!(nomination, Err(Error::Runtime(err)) => { + let details = err.inner().details().unwrap(); + assert_eq!(details.pallet, "Staking"); + assert_eq!(details.error, "NotController"); }); Ok(()) } #[async_std::test] -async fn chill_works_for_controller_only() -> Result<(), Error> { - let alice_stash = - PairSigner::::new(get_from_seed("Alice//stash")); - let bob_stash = - PairSigner::::new(get_from_seed("Bob//stash")); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +async fn chill_works_for_controller_only() -> Result<(), Error> { + let alice_stash = pair_signer(get_from_seed("Alice//stash")); + let bob_stash = pair_signer(get_from_seed("Bob//stash")); + let alice = pair_signer(AccountKeyring::Alice.pair()); let cxt = test_context().await; // this will fail the second time, which is why this is one test, not two @@ -169,9 +165,10 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { .wait_for_finalized_success() .await; - assert_matches!(chill, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.pallet, "Staking"); - assert_eq!(module_err.error, "NotController"); + assert_matches!(chill, Err(Error::Runtime(err)) => { + let details = err.inner().details().unwrap(); + assert_eq!(details.pallet, "Staking"); + assert_eq!(details.error, "NotController"); }); let is_chilled = cxt @@ -190,8 +187,8 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { } #[async_std::test] -async fn tx_bond() -> Result<(), Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +async fn tx_bond() -> Result<(), Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); let cxt = test_context().await; let bond = cxt @@ -224,16 +221,16 @@ async fn tx_bond() -> Result<(), Error> { .wait_for_finalized_success() .await; - assert_matches!(bond_again, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.pallet, "Staking"); - assert_eq!(module_err.error, "AlreadyBonded"); + assert_matches!(bond_again, Err(Error::Runtime(err)) => { + let details = err.inner().details().unwrap(); + assert_eq!(details.pallet, "Staking"); + assert_eq!(details.error, "AlreadyBonded"); }); - Ok(()) } #[async_std::test] -async fn storage_history_depth() -> Result<(), Error> { +async fn storage_history_depth() -> Result<(), Error> { let cxt = test_context().await; let history_depth = cxt.api.storage().staking().history_depth(None).await?; assert_eq!(history_depth, 84); @@ -241,7 +238,7 @@ async fn storage_history_depth() -> Result<(), Error> { } #[async_std::test] -async fn storage_current_era() -> Result<(), Error> { +async fn storage_current_era() -> Result<(), Error> { let cxt = test_context().await; let _current_era = cxt .api @@ -254,7 +251,7 @@ async fn storage_current_era() -> Result<(), Error> { } #[async_std::test] -async fn storage_era_reward_points() -> Result<(), Error> { +async fn storage_era_reward_points() -> Result<(), Error> { let cxt = test_context().await; let current_era_result = cxt .api diff --git a/tests/integration/frame/sudo.rs b/subxt/tests/integration/frame/sudo.rs similarity index 85% rename from tests/integration/frame/sudo.rs rename to subxt/tests/integration/frame/sudo.rs index 36e2cd843b..eb8495c08c 100644 --- a/tests/integration/frame/sudo.rs +++ b/subxt/tests/integration/frame/sudo.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -18,19 +18,19 @@ use crate::{ node_runtime::{ runtime_types, sudo, - DefaultConfig, + DispatchError, }, + pair_signer, test_context, }; use sp_keyring::AccountKeyring; -use subxt::extrinsic::PairSigner; type Call = runtime_types::node_runtime::Call; type BalancesCall = runtime_types::pallet_balances::pallet::Call; #[async_std::test] -async fn test_sudo() -> Result<(), subxt::Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +async fn test_sudo() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id().into(); let cxt = test_context().await; @@ -55,8 +55,8 @@ async fn test_sudo() -> Result<(), subxt::Error> { } #[async_std::test] -async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id().into(); let cxt = test_context().await; diff --git a/tests/integration/frame/system.rs b/subxt/tests/integration/frame/system.rs similarity index 77% rename from tests/integration/frame/system.rs rename to subxt/tests/integration/frame/system.rs index e99ff878be..8be7a7d3b6 100644 --- a/tests/integration/frame/system.rs +++ b/subxt/tests/integration/frame/system.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -17,20 +17,18 @@ use crate::{ node_runtime::{ system, - DefaultConfig, + DispatchError, }, + pair_signer, test_context, }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::extrinsic::{ - PairSigner, - Signer, -}; +use subxt::Signer; #[async_std::test] -async fn storage_account() -> Result<(), subxt::Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +async fn storage_account() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); let cxt = test_context().await; let account_info = cxt @@ -45,8 +43,8 @@ async fn storage_account() -> Result<(), subxt::Error> { } #[async_std::test] -async fn tx_remark_with_event() -> Result<(), subxt::Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +async fn tx_remark_with_event() -> Result<(), subxt::Error> { + let alice = pair_signer(AccountKeyring::Alice.pair()); let cxt = test_context().await; let found_event = cxt diff --git a/tests/integration/frame/timestamp.rs b/subxt/tests/integration/frame/timestamp.rs similarity index 94% rename from tests/integration/frame/timestamp.rs rename to subxt/tests/integration/frame/timestamp.rs index 1aa9f78dd9..c5187e5927 100644 --- a/tests/integration/frame/timestamp.rs +++ b/subxt/tests/integration/frame/timestamp.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/tests/integration/main.rs b/subxt/tests/integration/main.rs similarity index 93% rename from tests/integration/main.rs rename to subxt/tests/integration/main.rs index afe6e603f2..796df152fa 100644 --- a/tests/integration/main.rs +++ b/subxt/tests/integration/main.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/tests/integration/utils/context.rs b/subxt/tests/integration/utils/context.rs similarity index 78% rename from tests/integration/utils/context.rs rename to subxt/tests/integration/utils/context.rs index 321a568ca4..1a56a168c1 100644 --- a/tests/integration/utils/context.rs +++ b/subxt/tests/integration/utils/context.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -15,19 +15,26 @@ // along with subxt. If not, see . pub use crate::{ - node_runtime::{ - self, - DefaultConfig, - }, + node_runtime, TestNodeProcess, }; +use sp_core::sr25519::Pair; use sp_keyring::AccountKeyring; -use subxt::Client; +use subxt::{ + extrinsic::ChargeAssetTxPayment, + Client, + DefaultConfig, + DefaultExtraWithTxPayment, + PairSigner, +}; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; +pub type NodeRuntimeSignedExtra = + DefaultExtraWithTxPayment>; + pub async fn test_node_process_with( key: AccountKeyring, ) -> TestNodeProcess { @@ -53,7 +60,7 @@ pub async fn test_node_process() -> TestNodeProcess { pub struct TestContext { pub node_proc: TestNodeProcess, - pub api: node_runtime::RuntimeApi, + pub api: node_runtime::RuntimeApi, } impl TestContext { @@ -68,3 +75,9 @@ pub async fn test_context() -> TestContext { let api = node_proc.client().clone().to_runtime_api(); TestContext { node_proc, api } } + +pub fn pair_signer( + pair: Pair, +) -> PairSigner { + PairSigner::new(pair) +} diff --git a/tests/integration/utils/mod.rs b/subxt/tests/integration/utils/mod.rs similarity index 93% rename from tests/integration/utils/mod.rs rename to subxt/tests/integration/utils/mod.rs index d0e05c8234..d2041160d6 100644 --- a/tests/integration/utils/mod.rs +++ b/subxt/tests/integration/utils/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/tests/integration/utils/node_proc.rs b/subxt/tests/integration/utils/node_proc.rs similarity index 99% rename from tests/integration/utils/node_proc.rs rename to subxt/tests/integration/utils/node_proc.rs index caeb74e9da..60d6136f1d 100644 --- a/tests/integration/utils/node_proc.rs +++ b/subxt/tests/integration/utils/node_proc.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify diff --git a/test-runtime/Cargo.toml b/test-runtime/Cargo.toml index 81ef982524..cfa9617bf1 100644 --- a/test-runtime/Cargo.toml +++ b/test-runtime/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "test-runtime" -version = "0.1.0" +version = "0.16.0" edition = "2021" [dependencies] -subxt = { path = ".." } -sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "master" } +subxt = { path = "../subxt" } +sp-runtime = "4.0.0" codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } [build-dependencies] -subxt = { path = ".." } -sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "master" } -jsonrpsee = { version = "0.7.0", features = ["http-client"] } +subxt = { path = "../subxt", version = "0.16.0" } +sp-core = "4.0.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } which = "4.2.2" +jsonrpsee = { version = "0.8", features = ["http-client"] } diff --git a/test-runtime/build.rs b/test-runtime/build.rs index 4e1545ad56..2b3b9b2702 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify @@ -101,7 +101,7 @@ async fn run() { r#" #[subxt::subxt( runtime_metadata_path = "{}", - generated_type_derives = "Debug, Eq, PartialEq" + generated_type_derives = "Eq, PartialEq" )] pub mod node_runtime {{ #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] diff --git a/test-runtime/src/lib.rs b/test-runtime/src/lib.rs index 68b389dc2e..e5bbb383e1 100644 --- a/test-runtime/src/lib.rs +++ b/test-runtime/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// Copyright 2019-2022 Parity Technologies (UK) Ltd. // This file is part of subxt. // // subxt is free software: you can redistribute it and/or modify